Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"It takes all sorts of in & out-door schooling to get adapted to my kind of fooling" -- R. Frost


computers / gnu.emacs.help / Re: Package critique: modeline for air quality information

SubjectAuthor
o Re: Package critique: modeline for air quality informationtpeplt

1
Re: Package critique: modeline for air quality information

<87y1hq7wrz.fsf@gmail.com>

  copy mid

https://novabbs.com/computers/article-flat.php?id=12&group=gnu.emacs.help#12

  copy link   Newsgroups: gnu.emacs.help
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tpe...@gmail.com (tpeplt)
Newsgroups: gnu.emacs.help
Subject: Re: Package critique: modeline for air quality information
Date: Fri, 01 Sep 2023 11:12:16 -0400
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <87y1hq7wrz.fsf@gmail.com>
References: <m1jztaejth.fsf@johnhaman.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="2ff57952447aae673dbaa2a9eda5f233";
logging-data="4018483"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+RD1gXN2hn8PTZ1G1aszR32MHKGw/6IKM="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)
Cancel-Lock: sha1:bwjQKYyyf0QYGas23qtSAlfMn9Q=
sha1:qpxQjCxE3UA87wDMpfufabtRlfE=
 by: tpeplt - Fri, 1 Sep 2023 15:12 UTC

John Haman <mail@johnhaman.org> writes:

> I wrote a package that adds local air quality statistics to the
> mode-line. Here it is:
>
> https://github.com/jthaman/air-quality/blob/main/air-quality.el
>
> If you are so inclined, I'd like some thoughts on the code. It's
> short, but I'm trying to get better at Emacs Lisp (at least this week,
> while I'm on vacation...)
>
> --

Some good practices to follow:

1. Byte-compile the source to locate and resolve many types of problems.
Byte compilation is available as a command (‘emacs-lisp-byte-compile’)
or via the Emacs-Lisp menu when editing a .el file. With your
‘air-quality.el’ (version 0.1 from the git repository), it yields the
following message:

> In air-quality--get-update:
> air-quality.el:125:17: Warning: reference to free variable
> ‘url-http-end-of-headers’

2. Emacs Lisp also has a ‘lint’ available via the Emacs-Lisp menu. This
can be helpful, but it can also find spurious (non-existent) problems
that are due to its limitations. For ‘air-quality.el’, it yields:

> In function air-quality--get-update:
> air-quality.el:118:Warning: Reference to unbound symbol:
> url-http-end-of-headers
>
> Linting finished.

3. ‘Checkdoc’ can help identify good practices, such as doc-string
standards, so that you (and others) will have usable descriptions of
procedures and data structures. It looks as though you have run it on
air-quality.el because it gives no warnings or errors.

4. Consider adding the code as an ELPA package that can be installed via
the Emacs menu Options/Manage Emacs Packages (or the command
‘list-packages’) once it has reached a level of maturity that you
consider acceptable.

--

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor