<?xml version="1.0"?>
<Denemo>
  <merge>
    <title>A Denemo Keymap</title>
    <author>AT, JRR, RTS</author>
    <map>
      <row>
        <action>DeleteBarline</action>
        <scheme>;;;DeleteBarline actually it merges two measures
(d-PushClipboard)
(let  ((type (d-GetType)) )
;get to appending of previous bar
 (if (not (or (equal? type "Appending" ) (equal? type "None" ) ))
 	(begin
	(while (d-PrevObjectInMeasure))
	(d-MoveCursorLeft)))
(set! type (d-GetType))

  (if (or (equal? type "Appending" ) (equal? type "None" ) )
    (begin (d-SetMark)
	(if (d-MoveToMeasureRight) ;;we don't want to delete next bar if there isn't one!
	(begin (d-MeasureLeft) ;; Now we're at the beginning of that measure
		
		(d-Cut)
		(d-DeleteMeasure)
		(d-Paste) )
	(d-UnsetMark) ;this is to clear the mark if we set it, but were at end of staff
		 ))
		 	(d-WarningDialog "Could not find measure before cursor to merge with")
		 	)
)
(d-PopClipboard)
</scheme>
        <label>Merge with Previous Measure</label>
        <tooltip>Joins two measures together</tooltip>
      </row>
    </map>
  </merge>
</Denemo>
