emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Gustavo Barros <gusbrs.2016@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [FR] Don't hardcode checker functions prefix in org-lint
Date: Tue, 10 Nov 2020 17:22:34 -0300	[thread overview]
Message-ID: <87k0ut7yid.fsf@gmail.com> (raw)

Hi All,

This is a small feature request for `org-lint' not to hardcode the 
checker functions' prefix, as it currently does.

`org-lint' is a small gem in Org, specially to those fat-fingered folks 
such as myself, to the point that it's been some time since I've been 
fancying using it to check some of my own personal conventions and 
structures, beyond Org syntax.  It is not difficult to do so, and it is 
enough to define some appropriate checker functions and a personal 
`my-org-lints' let binding `org-lint--checkers' to my own set of 
checkers.  It's pretty neat.

However, `org-lint' hardcodes the prefix of the checker functions to its 
own prefix, so that to define my own personal checker functions I have 
to step on `org-lint's namespace, and use "org-lint-" as a prefix, to 
get things working.  The hardcoding occurs in 
`org-lint--generate-reports', when each checker is called with:

#+begin_src emacs-lisp
(funcall
 (intern (format "org-lint-%s"
		 (org-lint-checker-name c)))
 ast)
#+end_src

It would be really useful, and simple enough, if a variable was defined, 
such as:

#+begin_src emacs-lisp
(defvar org-lint-checker-prefix "org-lint")
#+end_src

and the call used this variable instead of hardcoding its value:
#+begin_src emacs-lisp
(funcall
 (intern (format "%s-%s"
                 org-lint-checker-prefix
		 (org-lint-checker-name c)))
 ast)
#+end_src

This would allow to define the mentioned `my-org-lints' function let 
binding `org-lint--checkers' and `org-lint-checker-prefix' to 
appropriate values.  So that an user's checker functions could have 
names with other prefixes.

As far as my grasp of `org-lint' goes (still learning), that would be 
enough for users to enjoy its infrastructure for personal lints without 
having to invade org-lint's namespace.  If you think it's a good idea, 
I'd certainly appreciate it to be included.  Thank you.

Best regards,
Gustavo.


             reply	other threads:[~2020-11-10 20:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-10 20:22 Gustavo Barros [this message]
2020-11-13  1:08 ` Gustavo Barros

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.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k0ut7yid.fsf@gmail.com \
    --to=gusbrs.2016@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: [FR] Don'\''t hardcode checker functions prefix in org-lint' \
    /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

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.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).