]> git.donarmstrong.com Git - lilypond.git/blob - ly/guile-debugger.ly
Run grand-replace (issue 3765)
[lilypond.git] / ly / guile-debugger.ly
1 %%%% This file is part of LilyPond, the GNU music typesetter.
2 %%%%
3 %%%% Copyright (C) 2009--2014 by Ian Hulin <ian@hulin.org.uk>
4 %%%%
5 %%%% LilyPond is free software: you can redistribute it and/or modify
6 %%%% it under the terms of the GNU General Public License as published by
7 %%%% the Free Software Foundation, either version 3 of the License, or
8 %%%% (at your option) any later version.
9 %%%%
10 %%%% LilyPond is distributed in the hope that it will be useful,
11 %%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
12 %%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 %%%% GNU General Public License for more details.
14 %%%%
15 %%%% You should have received a copy of the GNU General Public License
16 %%%% along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
17
18
19
20 %%  \include this file to enable the setting of breakpoints in guile.
21 %%  Once loaded, this file will open a guile prompt.  Type
22 %%  (debug-help)
23 %%  at the guile prompt to get a list of possible commands.
24 %%  For more information, see the Contributor's Guide.
25
26
27 \version "2.16.0"
28
29 % define lilypond-module as a variable in the guile-user module and set
30 % to the current Scheme module (which will be the lilypond top-level
31 % module)
32
33 #(module-define! (resolve-module '(guile-user))
34                  'lilypond-module
35                  (current-module))
36 %
37 % Ensure we have command-line recall available at the guile prompt
38 %
39 #(use-modules (ice-9 readline))
40 #(activate-readline)
41 #(display "\n Guile debugger for Lilypond")
42 #(display "\n For help enter (debug-help)\n")
43 %
44 % Ensure debugger definitions are available in lilypond-module and guile-user
45 %
46 #(use-modules (scm guile-debugger))
47 #(ly:module-copy (resolve-module '(guile-user))
48                  (resolve-module '(scm guile-debugger)))
49 #(top-repl)
50 %
51 % top-repl has re-set the module to guile-user,
52 %  so we need to set it back to lilypond-module
53 %
54 #(ly:module-copy (current-module) (resolve-module '(lilypond-module)))
55 #(set-current-module lilypond-module)