unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mattias Engdegård" <mattiase@acm.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: Emacs Development <Emacs-devel@gnu.org>
Subject: Re: regexp linting run in Emacs tree
Date: Mon, 5 Aug 2019 13:33:10 +0200	[thread overview]
Message-ID: <1C885731-EC94-47DB-88D6-14C505C1BDF0@acm.org> (raw)
In-Reply-To: <2dcc229d-75ce-51df-0224-f484eec622e3@cs.ucla.edu>

[-- Attachment #1: Type: text/plain, Size: 1073 bytes --]

5 aug. 2019 kl. 00.57 skrev Paul Eggert <eggert@cs.ucla.edu>:
> 
>> relint blindly assumes default values of global variables. What about adding a `delete-dups' to make it shut up?
> 
> That would slow down and complicate the source a bit. Maybe just add the glitch to the delinter's exception list, if any.

There isn't one and I had hoped not having to add such a mechanism. Partly because it is a cop-out, and partly because it, too, would litter the source with alien comments like

  ;; relint: skip-set-duplicate

the kind of which, in my experience, tend to linger far beyond their usefulness and mystify innocent readers of the code.
(Sticking the suppressions in a separate .relint-exceptions file is not a better solution.)

What about the fairly lightweight attached patch? It's about as cheap as can be, while keeping it readable.

> Oh, thanks, I see the point now. I installed the attached.

Good, thank you. I especially like how you removed the "FIXME: replace it with something shorter" comment, since you did, in effect, do just that!


[-- Attachment #2: 0001-Shut-up-regexp-linter.patch --]
[-- Type: application/octet-stream, Size: 1283 bytes --]

From 2c648f73207813787175776e76fba426d67cb9f0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= <mattiase@acm.org>
Date: Mon, 5 Aug 2019 12:59:53 +0200
Subject: [PATCH] Shut up regexp linter

* lisp/progmodes/fortran.el (fortran-indent-to-column):
Prevent relint from complaining about a duplicated character in the
argument to skip-chars-{forward,backward}.
---
 lisp/progmodes/fortran.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el
index f01e866f55..8f58c501e4 100644
--- a/lisp/progmodes/fortran.el
+++ b/lisp/progmodes/fortran.el
@@ -1818,7 +1818,9 @@ fortran-indent-to-column
             (let* ((char (if (stringp fortran-comment-indent-char)
                              (aref fortran-comment-indent-char 0)
                            fortran-comment-indent-char))
-                   (chars (string ?\s ?\t char)))
+                   (chars (if (memq char '(?\s ?\t))
+                              " \t"
+                            (string ?\s ?\t char))))
               (goto-char (match-end 0))
               (skip-chars-backward chars)
               (delete-region (point) (progn (skip-chars-forward chars)
-- 
2.20.1 (Apple Git-117)


  reply	other threads:[~2019-08-05 11:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-04 17:49 regexp linting run in Emacs tree Mattias Engdegård
2019-08-04 18:46 ` Paul Eggert
2019-08-04 19:07   ` Mattias Engdegård
2019-08-04 22:57     ` Paul Eggert
2019-08-05 11:33       ` Mattias Engdegård [this message]
2019-08-05 17:17         ` Paul Eggert
2019-08-05 21:18           ` Mattias Engdegård
2019-08-08 11:01       ` Mattias Engdegård

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=1C885731-EC94-47DB-88D6-14C505C1BDF0@acm.org \
    --to=mattiase@acm.org \
    --cc=Emacs-devel@gnu.org \
    --cc=eggert@cs.ucla.edu \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).