0

Is there a more compact way to make use of the rx macro in cases where we want to inline a list of strings from a variable? Such as

(defconst c++20-new-keywords-list
  (list
   "char8_t"
   "import"
   "module"
   "concept"
   "consteval"
   "requires"

   "co_yield"
   "co_await"
   "co_return"

   "synchronized"
   "atomic_cancel"
   "atomic_commit"
   "atomic_noexcept"
   )
  "C++20 language extra keywords.")

 (font-lock-add-keywords
  'c++-mode
  `((,(eval `(rx (group (|
                         "static_assert"      ;C++11
                         ,@c++20-new-keywords-list
                         )))) . 'font-lock-keyword-face)))
Nordlöw
  • 487
  • 3
  • 12

1 Answers1

0

Solution found in duplicate question How do I create a dynamic regexp with rx?.

Closing this for now.

Nordlöw
  • 487
  • 3
  • 12