Currently, my `lang/reader.rkt` file uses #lang s-exp syntax/module-reader: #lang s-exp syntax/module-reader hypothetical-lang #:read read #:read-syntax read-syntax #:info make-info (define (make-info key default use-default) (case key [(drracket:toolbar-buttons) (list (dynamic-require 'hypothetical-lang/button 'button))] [else (use-default key default)]))
Is the `get-info` function you described the same as the `make-info` that is currently in my code? I'm pretty confused on how to write a `get-info` function and where it would go. How can I go about setting this up? If you have any other style suggestions about how to change this button, I would appreciate them. On Tuesday, June 25, 2019 at 10:05:02 PM UTC-4, Matthew Butterick wrote: > > In your `get-info` function for your #lang, if `ip` is the input port > passed as the first argument to `get-info`, then you can get the current > document filename like so: > > (send (object-name ip) get-filename) > > And pass it as an argument to your button function. > > > On Jun 25, 2019, at 1:10 PM, Kshitij Sachan <kshitij...@gmail.com > <javascript:>> wrote: > > I'm trying to make a language-specific toolbar button that when clicked > prints the path of the file the button is clicked from. I've been able to > set up the button, but how I don't know how to access the path of the > current file. > > > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/54ebf24b-57da-4568-9a41-d2be6e8f0bf3%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.