Subject: Re: bug#58790: Eglot URI parsing bug when using clojure-lsp server

From: João Távora <[email-masked]>
Date: Fri, 11 Nov 2022 09:45:06 +0000

Eli Zaretskii <[email-masked]> writes:

> It is quite possible that you personally don't need these additional
> comments because you are very familiar with the code and with LSP
> servers in general.  

Oh you're mistaken.  I do need this information at hand, I forget things
on a weekly basis.  Whether in comments or in commit messages, that's a
different decision.

>But future Emacs developers and maintainers might
> not have such insight, and I'm trying to represent them.  This is part
> of my job and my responsibility.  And since comments can never
> adversely affect code, I see no reason for you to object.

Comments are not a 0-cost thing, obviously They can hamper readability,
they contribute e.g. to a small function no longer fitting in one
screen.  They present a maintenance burden too and a source of
duplication.  These are their drawbacks, but they have many many
advantages too, of course.  You'll see me using comments very often.

I do this on a case-by-case basis.  I thought you were suggesting that
those big blocks of text about Clojure jar URI be moved to comments.
IMO they are out-of-place in source code, especially in such a short
function, but they are quite acceptable in commit messages.  It would
seem you weren't proposing that, so this was a misunderstanding.

Anyway, the comments Danny inserted:

  "Only attempt to parse URIs with the file scheme.".

and 
  
  "Leave non-file type URIs untouched, `file-name-handler-alist'
   handlers can be used to dispatch them properly."

Are quite fine.  I've condensed them and tweaked them to include a
reference to this bug#58790

Now if someone could fix 

  ;; bug-reference-bug-regexp: "\\(github#\\([0-9]+\\)\\)"
  ;; bug-reference-url-format: "https://github.com/joaotavora/eglot/issues/%s"

To work for both GitHub bugs and Emacs bug references in that file, it
would be just peachy.

João