mirror of
https://github.com/librephoenix/nixos-config
synced 2025-07-02 04:54:35 +05:30
Org inline macros
This commit is contained in:
parent
eb43b570a1
commit
49606f5f0a
|
@ -489,6 +489,24 @@ same directory as the org-buffer and insert a link to this file."
|
||||||
; :desc "Simple print region in web browser"
|
; :desc "Simple print region in web browser"
|
||||||
; "r" 'org-simple-print-region)
|
; "r" 'org-simple-print-region)
|
||||||
|
|
||||||
|
;; Display macros inline in buffers
|
||||||
|
(add-to-list 'font-lock-extra-managed-props 'display)
|
||||||
|
|
||||||
|
(font-lock-add-keywords
|
||||||
|
'org-mode
|
||||||
|
'(("\\({{{[a-zA-Z#%)(_-+0-9]+}}}\\)" 0
|
||||||
|
`(face nil display
|
||||||
|
,(format "%s"
|
||||||
|
(let* ((input-str (match-string 0))
|
||||||
|
(el (with-temp-buffer
|
||||||
|
(insert input-str)
|
||||||
|
(goto-char (point-min))
|
||||||
|
(org-element-context)))
|
||||||
|
(text (org-macro-expand el org-macro-templates)))
|
||||||
|
(if text
|
||||||
|
text
|
||||||
|
input-str)))))))
|
||||||
|
|
||||||
;;;------ Org roam configuration ------;;;
|
;;;------ Org roam configuration ------;;;
|
||||||
(require 'org-roam)
|
(require 'org-roam)
|
||||||
(require 'org-roam-dailies)
|
(require 'org-roam-dailies)
|
||||||
|
|
|
@ -583,6 +583,27 @@ exit
|
||||||
; :desc "Simple print region in web browser"
|
; :desc "Simple print region in web browser"
|
||||||
; "r" 'org-simple-print-region)
|
; "r" 'org-simple-print-region)
|
||||||
|
|
||||||
|
#+END_SRC
|
||||||
|
*** Org Inline Macros
|
||||||
|
#+BEGIN_SRC emacs-lisp :tangle config.el
|
||||||
|
;; Display macros inline in buffers
|
||||||
|
(add-to-list 'font-lock-extra-managed-props 'display)
|
||||||
|
|
||||||
|
(font-lock-add-keywords
|
||||||
|
'org-mode
|
||||||
|
'(("\\({{{[a-zA-Z#%)(_-+0-9]+}}}\\)" 0
|
||||||
|
`(face nil display
|
||||||
|
,(format "%s"
|
||||||
|
(let* ((input-str (match-string 0))
|
||||||
|
(el (with-temp-buffer
|
||||||
|
(insert input-str)
|
||||||
|
(goto-char (point-min))
|
||||||
|
(org-element-context)))
|
||||||
|
(text (org-macro-expand el org-macro-templates)))
|
||||||
|
(if text
|
||||||
|
text
|
||||||
|
input-str)))))))
|
||||||
|
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
** Org Roam Configuration
|
** Org Roam Configuration
|
||||||
*** Standard Org Roam Configuration
|
*** Standard Org Roam Configuration
|
||||||
|
|
Loading…
Reference in a new issue