Open ghost opened 1 year ago
Weird, I can say off the bat that this isn't happening for me. But is it happening as you are typing or when you are saving?
ahh you are calling the function align-block, gotcha! Let me try agian!
yes I can reproduce, thanks, I'll fix it now
so, i'm using this till the fix (sorry i don't understand much about Emacs to fix myself your code);
(defun aling (BEG END)
(interactive "r")
(align-regexp BEG END "\\(\\s-*\\)\\s-+" 1 1 t))
(defun csound-score-aling ()
(interactive)
(just-one-space) ; (tab-to-tab-stop)
(point-to-register 0)
(mark-paragraph)
(call-interactively 'aling)
(jump-to-register 0))
(define-key csound-mode-map (kbd "SPC") 'csound-score-aling)
(define-key csound-mode-map (kbd "S-SPC") 'just-one-space)
beware that it aligns everything at cursor's paragraph... ((undo)) can do its job in case you screw! and Shift + SPC for the normal behaviour
by the way, can the score-align tool quantify the + or ^ sings? e.g.
i1 0 3
i. + .
after the score-align
i1 0 3
i. 3 .
A bit more sophisticated version of Iuqtas's aling. Original csound-score--align-cols in csound-score.el can be replaced with it.
(defun csound-score--align-cols (start end)
(save-excursion
(save-restriction
(narrow-to-region (point-min) end)
(while (progn (goto-char start)
(re-search-forward "^\\s-*\\([^;\n]*?[^;\n\0]\\)\\(\\s-+\\|$\\)" nil t))
(replace-match "\\1\0"))
(align-regexp start (point-max) "\\(\\)\0" 1 1 t)
(while (re-search-forward "\0\\| +\0$" nil t)
(replace-match ""))
(align-regexp start (point-max) "^[^;]*\\( +\\);" 1 1 t))))
hi! i am having problems with it when using characters like ^ or > e.g.
will output;
Emacs 27.1 csound-mode 0.2.9