help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Colourising tex keywords


From: Emanuel Berg
Subject: Re: Colourising tex keywords
Date: Thu, 13 Jan 2022 00:30:23 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Jean Louis wrote:

> (defun rcd-highlight-list (list)
>   "Uses LIST to highlight strings in buffer."
>   (hi-lock-mode)
>   (let* ((list (delete "" list))
>       (highlights hi-lock-face-defaults))
>     (while list
>       (highlight-regexp (regexp-quote (pop list)) (pop highlights)))))

Probably "Uses" should be imperative "Use".

There's no need for `let*' what I can see? It gets even more
confusing with your use of "list" ... is it the argument, the
let-binding, or the `list' function?

Better to call the argument "lst" and use `let' unless `let*'
is ... called for!

Also the `while' test should be

  (and list highlights)

since the highlights list is `pop'ped as well.

Last

  Warning: reference to free variable ‘hi-lock-face-defaults’

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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