@ -268,6 +268,13 @@ The currently supported symbols are:
( symbol ) ) )
( symbol ) ) )
:group 'org-roam )
:group 'org-roam )
( defcustom org-roam-file-completion-tag-position 'prepend
" Prepend, append, or omit tags from the file titles during completion. "
:type ' ( choice ( const :tag " Prepend " prepend )
( const :tag " Append " append )
( const :tag " Omit " omit ) )
:group 'org-roam )
( defcustom org-roam-enable-headline-linking t
( defcustom org-roam-enable-headline-linking t
" Enable linking to headlines, which includes automatic :ID: creation and scanning of :ID:s for org-roam database. "
" Enable linking to headlines, which includes automatic :ID: creation and scanning of :ID:s for org-roam database. "
:type 'boolean
:type 'boolean
@ -844,13 +851,22 @@ file."
( format org-roam-link-title-format description ) ) )
( format org-roam-link-title-format description ) ) )
( org-link-make-string ( concat type " : " target ) description ) )
( org-link-make-string ( concat type " : " target ) description ) )
( defun org-roam--prepend-tag-string ( str tags )
( defun org-roam--add-tag-string ( str tags )
" Prepend TAGS to STR. "
" Add TAGS to STR.
( concat
( when tags
Depending on the value of ` org-roam-file-completion-tag-position ', this function
( propertize ( format " (%s) " ( s-join org-roam-tag-separator tags ) )
prepends TAGS to STR, appends TAGS to STR or omits TAGS from STR. "
'face 'org-roam-tag ) )
( pcase org-roam-file-completion-tag-position
str ) )
( 'prepend ( concat
( when tags ( propertize ( format " (%s) " ( s-join org-roam-tag-separator tags ) )
'face 'org-roam-tag ) )
str ) )
( 'append ( concat
str
( when tags ( propertize ( format " (%s) " ( s-join org-roam-tag-separator tags ) )
'face 'org-roam-tag ) ) ) )
( 'omit str ) ) )
( defun org-roam--get-title-path-completions ( )
( defun org-roam--get-title-path-completions ( )
" Return an alist for completion.
" Return an alist for completion.
@ -868,7 +884,7 @@ plist containing the path and title for the file."
rows ) )
rows ) )
( dolist ( row rows completions )
( dolist ( row rows completions )
( pcase-let ( ( ` ( , file-path , title , tags ) row ) )
( pcase-let ( ( ` ( , file-path , title , tags ) row ) )
( let ( ( k ( org-roam--prepen d-tag-string title tags ) )
( let ( ( k ( org-roam--ad d-tag-string title tags ) )
( v ( list :path file-path :title title ) ) )
( v ( list :path file-path :title title ) ) )
( push ( cons k v ) completions ) ) ) ) ) )
( push ( cons k v ) completions ) ) ) ) ) )
@ -951,8 +967,8 @@ FILTER can either be a string or a function:
( concat
( concat
( when org-roam-include-type-in-ref-path-completions
( when org-roam-include-type-in-ref-path-completions
( format " {%s} " type ) )
( format " {%s} " type ) )
( org-roam--prepen d-tag-string ( format " %s (%s) " title ref )
( org-roam--ad d-tag-string ( format " %s (%s) " title ref )
tags ) )
tags ) )
ref ) )
ref ) )
( v ( list :path file-path :type type :ref ref ) ) )
( v ( list :path file-path :type type :ref ref ) ) )
( push ( cons k v ) completions ) ) ) ) ) ) )
( push ( cons k v ) completions ) ) ) ) ) ) )