-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
csound-score-align-block #26
Comments
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?
after the score-align
|
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
The text was updated successfully, but these errors were encountered: