\version "2.15.30"

#(define adjust-for-note-head
  (lambda (grob)
    (let* ((refp (ly:grob-system grob))
           (bar-coord (ly:grob-relative-coordinate grob refp X))
           (all (ly:grob-array->list (ly:grob-object refp 'all-elements)))
           (note-heads
             (filter
               (lambda (n)
                 (eq? (assq-ref (ly:grob-property n 'meta) 'name)
                      'NoteColumn))
               all))
           (note-head-coords
             (map
               (lambda (heads)
                 (interval-center (ly:grob-extent heads refp X)))
               note-heads))
           (closest-coord
             (apply min
                   (map (lambda (coord) (abs (- coord bar-coord)))
                        note-head-coords))))
          
      (set! (ly:grob-property grob 'extra-offset) (cons closest-coord 0)))))
      
centerBarToNote = \once \override Staff.BarLine #'after-line-breaking = #adjust-for-note-head

{
  \time 2/4
  \override Stem #'stencil = #point-stencil
  d' d'
  \centerBarToNote
  dis'' d'
  \centerBarToNote
  <cis' e' g'> d'
  \centerBarToNote
  \bar "||"
  dis' d''
}

\layout {
  \context {
    \Score
    \override SpacingSpanner #'strict-note-spacing = ##t
    proportionalNotationDuration = #(ly:make-moment 1 16)
  }
  \context {
    \Staff
    \remove "Time_signature_engraver"
  }
}
