* Words with spaces highlighted in elisp-mode comments @ 2023-07-16 22:49 uzibalqa 2023-07-16 23:08 ` Emanuel Berg 0 siblings, 1 reply; 15+ messages in thread From: uzibalqa @ 2023-07-16 22:49 UTC (permalink / raw) To: uzibalqa via Users list for the GNU Emacs text editor Currently in elisp-mode comments, words within single quotes get highlighted. It would be beneficial if arbitrary text is also highlighted within single quotes (e.g. text with spaces). ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Words with spaces highlighted in elisp-mode comments 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 0 siblings, 1 reply; 15+ messages in thread From: Emanuel Berg @ 2023-07-16 23:08 UTC (permalink / raw) To: help-gnu-emacs uzibalqa wrote: > Currently in elisp-mode It is `emacs-lisp-mode', but I agree there should be an "elisp-mode" alias. Here: (defalias 'elisp-mode #'emacs-lisp-mode) https://dataswamp.org/~incal/emacs-init/ide/elisp.el > comments, words within single quotes get highlighted. > It would be beneficial if arbitrary text is also highlighted > within single quotes (e.g. text with spaces). I don't understand what 'ooh' and 'ooh aah' means in Elisp, do you? But it is clear the oohs and the aahs are treated differently by Emacs as 'ooh' gets the `font-lock-constant-face' and with the whitespace, as you say, it doesn't. You can evaluate 'ooh' (into ooh) but not use it in code, 'ooh aah' cannot be evaluated. -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Words with spaces highlighted in elisp-mode comments 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 0 siblings, 2 replies; 15+ messages in thread From: uzibalqa @ 2023-07-17 12:56 UTC (permalink / raw) To: Emanuel Berg; +Cc: help-gnu-emacs ------- Original Message ------- On Monday, July 17th, 2023 at 11:08 AM, Emanuel Berg <incal@dataswamp.org> wrote: > uzibalqa wrote: > > > Currently in elisp-mode > > > It is `emacs-lisp-mode', but I agree there should be an > "elisp-mode" alias. Here: > > (defalias 'elisp-mode #'emacs-lisp-mode) > > https://dataswamp.org/~incal/emacs-init/ide/elisp.el > > > comments, words within single quotes get highlighted. > > It would be beneficial if arbitrary text is also highlighted > > within single quotes (e.g. text with spaces). > > > I don't understand what 'ooh' and 'ooh aah' means in Elisp, > do you? > > But it is clear the oohs and the aahs are treated differently > by Emacs as 'ooh' gets the `font-lock-constant-face' and with > the whitespace, as you say, it doesn't. > > You can evaluate 'ooh' (into ooh) but not use it in code, > 'ooh aah' cannot be evaluated. Highlighting some text in comments would be beneficial. Consider a line showing usage of a function with a description beneath it. Highlighting the usage code part would help readability. ^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: [External] : Re: Words with spaces highlighted in elisp-mode comments 2023-07-17 12:56 ` uzibalqa @ 2023-07-17 15:13 ` Drew Adams 2023-07-19 1:02 ` Emanuel Berg 1 sibling, 0 replies; 15+ messages in thread From: Drew Adams @ 2023-07-17 15:13 UTC (permalink / raw) To: uzibalqa, Emanuel Berg; +Cc: help-gnu-emacs@gnu.org > Consider a line showing usage of a function with a description > beneath it. Highlighting the usage code part would help readability. `M-x report-emacs-bug' to request an enhancement. This is a help list. The bug list is the best place to suggest improvements. (Nothing wrong with communicating suggestions here, but the bug list is a better place, in general.) ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Words with spaces highlighted in elisp-mode comments 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 1 sibling, 1 reply; 15+ messages in thread From: Emanuel Berg @ 2023-07-19 1:02 UTC (permalink / raw) To: help-gnu-emacs uzibalqa wrote: >>> comments, words within single quotes get highlighted. >>> It would be beneficial if arbitrary text is also >>> highlighted within single quotes (e.g. text with spaces). >> >> I don't understand what 'ooh' and 'ooh aah' means in Elisp, >> do you? >> >> But it is clear the oohs and the aahs are treated >> differently by Emacs as 'ooh' gets the >> `font-lock-constant-face' and with the whitespace, as you >> say, it doesn't. >> >> You can evaluate 'ooh' (into ooh) but not use it in code, >> 'ooh aah' cannot be evaluated. > > Highlighting some text in comments would be beneficial. But comments are already font locked into `font-lock-comment-face' (there is also a `font-lock-comment-delimiter-face', IMO it is overkill to have that in another color than `font-lock-comment-face'). I don't see why 'ooh' within a comment should be colorized any other way than the comment, since that syntax don't denote anything in Elisp. If you intend to use it as labels, and to put them aside as a special color, I'd say there are better ways to do that, namely stack semi-colons in different numbers denoting different things, so that, for example ;; this is a general comment <-- one face (setq one 1) ; don't do that <-- comment that refers to one line ;;; this is a LABEL, as seen in Lisp packages <-- one face for that (code (code ...) (code (code ...) This would also be safe to implement because if someone didn't like it, it could be default be set so that all those Lisp levels of comments initially were set to the same color. -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Words with spaces highlighted in elisp-mode comments 2023-07-19 1:02 ` Emanuel Berg @ 2023-07-20 11:47 ` uzibalqa 2023-07-22 6:00 ` Emanuel Berg 0 siblings, 1 reply; 15+ messages in thread From: uzibalqa @ 2023-07-20 11:47 UTC (permalink / raw) To: Emanuel Berg; +Cc: help-gnu-emacs ------- Original Message ------- On Wednesday, July 19th, 2023 at 1:02 PM, Emanuel Berg <incal@dataswamp.org> wrote: > uzibalqa wrote: > > > > > comments, words within single quotes get highlighted. > > > > It would be beneficial if arbitrary text is also > > > > highlighted within single quotes (e.g. text with spaces). > > > > > > I don't understand what 'ooh' and 'ooh aah' means in Elisp, > > > do you? > > > > > > But it is clear the oohs and the aahs are treated > > > differently by Emacs as 'ooh' gets the > > > `font-lock-constant-face' and with the whitespace, as you > > > say, it doesn't. > > > > > > You can evaluate 'ooh' (into ooh) but not use it in code, > > > 'ooh aah' cannot be evaluated. > > > > Highlighting some text in comments would be beneficial. > > > But comments are already font locked into > `font-lock-comment-face' (there is also a` font-lock-comment-delimiter-face', IMO it is overkill to > have that in another color than `font-lock-comment-face'). I do not see the usefulness of colouring the comment delimiter separately (because that affects all comments in the same way, no distinguishing feature whatsoever ). We can keep highlighting with a back-quote for things that can be evaluated (e.g. `something') and use single-quote for more general case that allows spaces (e.g. 'this and that'). We should not use multiple comment characters (e.g. ;;; Something) because those are for outlines - something of a completely different orthogonal purpose. > I don't see why 'ooh' within a comment should be colorized any > other way than the comment, since that syntax don't denote > anything in Elisp. If you intend to use it as labels, and to > put them aside as a special color, I'd say there are better > ways to do that, namely stack semi-colons in different numbers > denoting different things, so that, for example > > ;; this is a general comment <-- one face > > (setq one 1) ; don't do that <-- comment that refers to one line > > ;;; this is a LABEL, as seen in Lisp packages <-- one face for that > (code (code ...) > (code (code ...) > > This would also be safe to implement because if someone didn't > like it, it could be default be set so that all those Lisp > levels of comments initially were set to the same color. > > -- > underground experts united > https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Words with spaces highlighted in elisp-mode comments 2023-07-20 11:47 ` uzibalqa @ 2023-07-22 6:00 ` Emanuel Berg 2023-07-22 12:02 ` Eli Zaretskii 2023-07-22 13:21 ` uzibalqa 0 siblings, 2 replies; 15+ messages in thread From: Emanuel Berg @ 2023-07-22 6:00 UTC (permalink / raw) To: help-gnu-emacs uzibalqa wrote: >> But comments are already font locked into >> `font-lock-comment-face' (there is also a` >> font-lock-comment-delimiter-face', IMO it is overkill to >> have that in another color than `font-lock-comment-face'). > > I do not see the usefulness of coloring the comment > delimiter separately (because that affects all comments in > the same way, no distinguishing feature whatsoever ). Indeed, I think all comments should be of the same color, including the delimiters. > We can keep highlighting with a back-quote for things that > can be evaluated (e.g. `something') Agreed, that is the exception that proves the rule. I could also think of hyperlinking them to the help, as has been suggested not that long ago. In ERC it is already like that BTW, and here is some more work on that: https://dataswamp.org/~incal/emacs-init/erc/erc-man.el https://dataswamp.org/~incal/emacs-init/erc/erc-show-modes.el But putting point at the beginning of `something' and doing `C-h f' isn't that much of a deal, which is the reason I think no one has cared about it enough to do it. But I like all integration things, big and small, so why not. Here it should be noted that they already get `font-lock-constant-face', if it sounds here like nothing at all happens to the poor things. > and use single-quote for more general case that allows > spaces (e.g. 'this and that'). But what do that express? What's the intended usage? Can you provide a piece of Elisp, where you use that proposed syntax for us to see? > We should not use multiple comment characters (e.g. ;;; > Something) because those are for outlines - something of > a completely different orthogonal purpose. As long as it has a purpose, it can be font locked in a distinguished way. If it should, in this case, is another thing, but it could, and it wouldn't be wrong to do. But if it should, I don't know, especially since comments in a uniform color simply looks much better. -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Words with spaces highlighted in elisp-mode comments 2023-07-22 6:00 ` Emanuel Berg @ 2023-07-22 12:02 ` Eli Zaretskii 2023-07-22 13:49 ` Christopher Dimech 2023-07-22 13:21 ` uzibalqa 1 sibling, 1 reply; 15+ messages in thread From: Eli Zaretskii @ 2023-07-22 12:02 UTC (permalink / raw) To: help-gnu-emacs > From: Emanuel Berg <incal@dataswamp.org> > Date: Sat, 22 Jul 2023 08:00:30 +0200 > > uzibalqa wrote: > > >> But comments are already font locked into > >> `font-lock-comment-face' (there is also a` > >> font-lock-comment-delimiter-face', IMO it is overkill to > >> have that in another color than `font-lock-comment-face'). > > > > I do not see the usefulness of coloring the comment > > delimiter separately (because that affects all comments in > > the same way, no distinguishing feature whatsoever ). > > Indeed, I think all comments should be of the same color, > including the delimiters. Font-lock is not just about colors, so this feature is still useful. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Words with spaces highlighted in elisp-mode comments 2023-07-22 12:02 ` Eli Zaretskii @ 2023-07-22 13:49 ` Christopher Dimech 2023-07-22 14:16 ` Eli Zaretskii 2023-07-24 12:18 ` Emanuel Berg 0 siblings, 2 replies; 15+ messages in thread From: Christopher Dimech @ 2023-07-22 13:49 UTC (permalink / raw) To: Eli Zaretskii; +Cc: help-gnu-emacs > Sent: Sunday, July 23, 2023 at 12:02 AM > From: "Eli Zaretskii" <eliz@gnu.org> > To: help-gnu-emacs@gnu.org > Subject: Re: Words with spaces highlighted in elisp-mode comments > > > From: Emanuel Berg <incal@dataswamp.org> > > Date: Sat, 22 Jul 2023 08:00:30 +0200 > > > > uzibalqa wrote: > > > > >> But comments are already font locked into > > >> `font-lock-comment-face' (there is also a` > > >> font-lock-comment-delimiter-face', IMO it is overkill to > > >> have that in another color than `font-lock-comment-face'). > > > > > > I do not see the usefulness of coloring the comment > > > delimiter separately (because that affects all comments in > > > the same way, no distinguishing feature whatsoever ). > > > > Indeed, I think all comments should be of the same color, > > including the delimiters. > > Font-lock is not just about colors, so this feature is still useful. What feature is useful ? Highlighting comment-delimiter with a different colour ? I agree with Emanuel, Why would one use another color than `font-lock-comment-face' for `comment-delimiter' ? ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Words with spaces highlighted in elisp-mode comments 2023-07-22 13:49 ` Christopher Dimech @ 2023-07-22 14:16 ` Eli Zaretskii 2023-07-22 14:22 ` Heime 2023-07-24 12:18 ` Emanuel Berg 1 sibling, 1 reply; 15+ messages in thread From: Eli Zaretskii @ 2023-07-22 14:16 UTC (permalink / raw) To: help-gnu-emacs > From: Christopher Dimech <dimech@gmx.com> > Cc: help-gnu-emacs@gnu.org > Date: Sat, 22 Jul 2023 15:49:46 +0200 > > > > > I do not see the usefulness of coloring the comment > > > > delimiter separately (because that affects all comments in > > > > the same way, no distinguishing feature whatsoever ). > > > > > > Indeed, I think all comments should be of the same color, > > > including the delimiters. > > > > Font-lock is not just about colors, so this feature is still useful. > > What feature is useful ? The fact that font-lock-delimiter-face is a separate face. > Highlighting comment-delimiter with a different colour ? > I agree with Emanuel, Why would one use another color than `font-lock-comment-face' > for `comment-delimiter' ? Like I said: faces are not just about colors. There are other attributes, and users can decide to customize font-lock-comment-delimiter-face to look differently even though it uses the same colors. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Words with spaces highlighted in elisp-mode comments 2023-07-22 14:16 ` Eli Zaretskii @ 2023-07-22 14:22 ` Heime 2023-07-22 14:33 ` Eli Zaretskii 0 siblings, 1 reply; 15+ messages in thread From: Heime @ 2023-07-22 14:22 UTC (permalink / raw) To: Eli Zaretskii; +Cc: help-gnu-emacs ------- Original Message ------- On Sunday, July 23rd, 2023 at 2:16 AM, Eli Zaretskii <eliz@gnu.org> wrote: > > From: Christopher Dimech dimech@gmx.com > > Cc: help-gnu-emacs@gnu.org > > Date: Sat, 22 Jul 2023 15:49:46 +0200 > > > > > > > I do not see the usefulness of coloring the comment > > > > > delimiter separately (because that affects all comments in > > > > > the same way, no distinguishing feature whatsoever ). > > > > > > > > Indeed, I think all comments should be of the same color, > > > > including the delimiters. > > > > > > Font-lock is not just about colors, so this feature is still useful. > > > > What feature is useful ? > > > The fact that font-lock-delimiter-face is a separate face. > > > Highlighting comment-delimiter with a different colour ? > > I agree with Emanuel, Why would one use another color than `font-lock-comment-face' for` comment-delimiter' ? > > > Like I said: faces are not just about colors. There are other > attributes, and users can decide to customize > font-lock-comment-delimiter-face to look differently even though it > uses the same colors. Interesting. Any knowledge of a good use excluding colouring purposes ? ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Words with spaces highlighted in elisp-mode comments 2023-07-22 14:22 ` Heime @ 2023-07-22 14:33 ` Eli Zaretskii 0 siblings, 0 replies; 15+ messages in thread From: Eli Zaretskii @ 2023-07-22 14:33 UTC (permalink / raw) To: help-gnu-emacs > Date: Sat, 22 Jul 2023 14:22:21 +0000 > From: Heime <heimeborgia@protonmail.com> > Cc: help-gnu-emacs@gnu.org > > > Like I said: faces are not just about colors. There are other > > attributes, and users can decide to customize > > font-lock-comment-delimiter-face to look differently even though it > > uses the same colors. > > Interesting. Any knowledge of a good use excluding colouring purposes ? No, sorry. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Words with spaces highlighted in elisp-mode comments 2023-07-22 13:49 ` Christopher Dimech 2023-07-22 14:16 ` Eli Zaretskii @ 2023-07-24 12:18 ` Emanuel Berg 1 sibling, 0 replies; 15+ messages in thread From: Emanuel Berg @ 2023-07-24 12:18 UTC (permalink / raw) To: help-gnu-emacs Christopher Dimech wrote: > I agree with Emanuel, Why would one use another color than > `font-lock-comment-face' for `comment-delimiter' ? The only thing I can think of is so that you can find them faster in languages that support multiline comments /* Master Yoda yada yada etc */ -- underground experts united https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Words with spaces highlighted in elisp-mode comments 2023-07-22 6:00 ` Emanuel Berg 2023-07-22 12:02 ` Eli Zaretskii @ 2023-07-22 13:21 ` uzibalqa 2023-07-24 12:13 ` Emanuel Berg 1 sibling, 1 reply; 15+ messages in thread From: uzibalqa @ 2023-07-22 13:21 UTC (permalink / raw) To: Emanuel Berg; +Cc: help-gnu-emacs ------- Original Message ------- On Saturday, July 22nd, 2023 at 6:00 PM, Emanuel Berg <incal@dataswamp.org> wrote: > uzibalqa wrote: > > > > But comments are already font locked into > > > `font-lock-comment-face' (there is also a` > > > font-lock-comment-delimiter-face', IMO it is overkill to > > > have that in another color than `font-lock-comment-face'). > > > > I do not see the usefulness of coloring the comment > > delimiter separately (because that affects all comments in > > the same way, no distinguishing feature whatsoever ). > > > Indeed, I think all comments should be of the same color, > including the delimiters. > > > We can keep highlighting with a back-quote for things that > > can be evaluated (e.g. `something') > > > Agreed, that is the exception that proves the rule. I could > also think of hyperlinking them to the help, as has been > suggested not that long ago. In ERC it is already like that > BTW, and here is some more work on that: > > https://dataswamp.org/~incal/emacs-init/erc/erc-man.el > > https://dataswamp.org/~incal/emacs-init/erc/erc-show-modes.el > > But putting point at the beginning of `something' and doing` C-h f' isn't that much of a deal, which is the reason I think > no one has cared about it enough to do it. > > But I like all integration things, big and small, so why not. It is a very good strategy, and also of that school. > Here it should be noted that they already get > `font-lock-constant-face', if it sounds here like nothing at > all happens to the poor things. > > > and use single-quote for more general case that allows > > spaces (e.g. 'this and that'). > > > But what do that express? What's the intended usage? Can you > provide a piece of Elisp, where you use that proposed syntax > for us to see? 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 This is an example for elisp but my intention is to have this for any language (C, C++, Fortran). For these types of tasks, colouring will enhance the visibility of these phrases and make them stand out, immediately close to the section of code of relevanece. It is not the routine thing for everybody, but colouring within comments has benefits for things besides general description. > > We should not use multiple comment characters (e.g. ;;; > > Something) because those are for outlines - something of > > a completely different orthogonal purpose. > > > As long as it has a purpose, it can be font locked in > a distinguished way. If it should, in this case, is another > thing, but it could, and it wouldn't be wrong to do. But if it > should, I don't know, especially since comments in a uniform > color simply looks much better. Comments in uniform colour has the advantage that one can change the intensity of the text in some situations. So perhaps use font lock on the comments as you say. One just need to be careful because some modes might reset whatever I try to do. > -- > underground experts united > https://dataswamp.org/~incal ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: Words with spaces highlighted in elisp-mode comments 2023-07-22 13:21 ` uzibalqa @ 2023-07-24 12:13 ` Emanuel Berg 0 siblings, 0 replies; 15+ messages in thread From: Emanuel Berg @ 2023-07-24 12:13 UTC (permalink / raw) To: help-gnu-emacs 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 ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2023-07-24 12:18 UTC | newest] Thread overview: 15+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 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).