How do you pass arguments to a function using lambda? I have looked through:
https://www.gnu.org/software/emacs/manual/html_node/elisp/Argument-List.html#Argument-List
and
https://www.emacswiki.org/emacs/download/highlight-chars.el
The only examples I found in the 2nd link were for tabs and whitespaces which use functions requiring no arguments.
Here's what I have tried so far:
1.
(require 'highlight-chars)
(defun my:add-semi-colon-highlighting ()
(add-hook 'font-lock-mode-hook
(lambda () (hc-highlight-chars ";" "highlight"))))
(add-hook 'c-mode-common-hook 'my:add-semi-colon-highlighting)
2.
(require 'highlight-chars)
(defun my:add-semi-colon-highlighting ()
(add-hook 'font-lock-mode-hook
(lambda () (hc-highlight-chars (";","highlight")))))
(add-hook 'c-mode-common-hook 'my:add-semi-colon-highlighting)
3.
(require 'highlight-chars)
(defun my:add-semi-colon-highlighting ()
(add-hook 'font-lock-mode-hook
(lambda () (hc-highlight-chars ";" highlight))))
(add-hook 'c-mode-common-hook 'my:add-semi-colon-highlighting)
Not sure if this should go into another question or not, but if wanted to customize the face for ";" (E.g red foreground and current background), how would I do that in the my:add-semi-colon-highlighting function?