emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FR] Don't hardcode checker functions prefix in org-lint


From: Gustavo Barros
Subject: [FR] Don't hardcode checker functions prefix in org-lint
Date: Tue, 10 Nov 2020 17:22:34 -0300
User-agent: mu4e 1.4.13; emacs 27.1

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 via email to

[Prev in Thread] Current Thread [Next in Thread]