Skip to content
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

DrRacket Quickscript of the day #53

Closed
spdegabrielle opened this issue Jun 6, 2021 · 5 comments
Closed

DrRacket Quickscript of the day #53

spdegabrielle opened this issue Jun 6, 2021 · 5 comments
Milestone

Comments

@spdegabrielle
Copy link
Contributor

spdegabrielle commented Jun 6, 2021

DrRacket Quickscript of the day

Quickscript (featured project of issue 38) provides an easy way to extend DrRacket with small Racket scripts to automate some actions in the editor, while avoiding the need to restart DrRacket. In this new section, contributed by Stephen De Gabrielle, we will be highlighting some of the most interesting scripts out there. Do you have a favourite script? Share it with us!

I'd like to thank Thorsten Blum for this weeks quickscript 'Remove trailing whitespace' that removes trailing spaces from the selected text:

#lang racket/base
(require quickscript racket/string)
(define-script whitespace
  #:label "Remove trailing whitespace"
  (λ (selection)
    (let ([linebreak (string #\newline)])
      (string-join
       (map (λ (line)
              (string-trim line #px"\\s+" #:left? #f))
            (string-split selection linebreak))
       linebreak))))

published at https://github.com/toblux/quickscript-user-scripts

Installation: you can paste this into a new script via the menu: Scripts > Manage > New

Get started at the Racket Wiki: Quickscript Scripts for DrRacket

Full documentation at https://docs.racket-lang.org/quickscript/.

@spdegabrielle
Copy link
Contributor Author

spdegabrielle commented Jun 6, 2021

EMBARGO removed on approval from Thorsten Blum via slack

@Metaxal
Copy link

Metaxal commented Jun 6, 2021

May be worth saying that it removes the trailing spaces in the selected text. (Otherwise one may try it without selecting anything and wonder why it 'fails'.)

@toblux
Copy link

toblux commented Jun 7, 2021

I've just published the script at https://github.com/toblux/quickscript-user-scripts if that helps.

@pmatos pmatos added this to the Issue 51 milestone Jun 10, 2021
@spdegabrielle
Copy link
Contributor Author

@pmatos this is PRESS READY now 😀

@pmatos
Copy link
Owner

pmatos commented Jun 10, 2021 via email

@pmatos pmatos closed this as completed Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants