macros.m4 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. divert(-1)
  2. #------------------------------------------------------------------------------
  3. # Miscellaneous
  4. # Allows using the '<', '>' characters in names and also permits using the dot
  5. # notation (e.g name.operation). This is an experimental functionality which
  6. # will eventually be changed by m4.
  7. #------------------------------------------------------------------------------
  8. changeword(`[_a-zA-Z<][_a-zA-Z0-9>.]*')
  9. #------------------------------------------------------------------------------
  10. # Macro for todo classes
  11. # Usage:
  12. # <todo>
  13. # It's replaced by '<p class=todo>'. Meant to be placed in the line preceding
  14. # the respective TODO text.
  15. #------------------------------------------------------------------------------
  16. # Quotes the empty string to impede inifinite recursion
  17. define(`<todo>', `<p class=t`'odo>')
  18. #------------------------------------------------------------------------------
  19. # Macro for paragraphs that look like lists
  20. # Usage:
  21. # <pl>
  22. # It's replaced by '<p class=list-style>'. Its usage is just like the normal
  23. # '<p>' element
  24. #------------------------------------------------------------------------------
  25. define(`<pl>', `<p class=list-style>')
  26. #------------------------------------------------------------------------------
  27. # A link dictionary
  28. # Usage:
  29. # links.push(`Key', `Value')
  30. # links.fetch(`Key')
  31. # Defines an associative array to store links and a way to access them. Quotes
  32. # can be omitted when calling (e.g 'links.fetch(link_name)')
  33. #------------------------------------------------------------------------------
  34. define(`links.push', `define(format(``array[%s]'', `$1'), `$2')')
  35. define(`links.fetch', `defn(format(``array[%s]'', `$1'))')
  36. #------------------------------------------------------------------------------
  37. divert`'dnl # Removes trailing newline and space