Skip to content

Instantly share code, notes, and snippets.

View greghendershott's full-sized avatar

Greg Hendershott greghendershott

View GitHub Profile
@greghendershott
greghendershott / issue-632-read-data.el
Created July 18, 2022 14:07
Example of check-syntax response data to be `read` by emacs; see https://github.com/greghendershott/racket-mode/issues/632
(check-syntax-ok
(completions "#%app" "#%datum" "#%declare" "#%expression" "#%module-begin" "#%plain-app" "#%plain-lambda" "#%plain-module-begin" "#%printing-module-begin" "#%provide" "#%require" "#%stratified-body" "#%top" "#%top-interaction" "#%variable-reference" "*" "*config-paths*" "*list/c" "+" "-" "->" "->*" "->*m" "->d" "->dm" "->i" "->m" "..." "/" ":do-in" "<" "</c" "<=" "<=/c" "=" "=/c" "==" "=>" ">" ">/c" ">=" ">=/c" "N" "_" "a" "abort-current-continuation" "abs" "absent" "absolute-path?" "abstract" "acos" "add-between" "add-color<%>" "add-editor-keymap-functions" "add-pasteboard-keymap-functions" "add-text-keymap-functions" "add1" "alarm-evt" "all-defined-out" "all-from-out" "always-evt" "and" "and/c" "andmap" "angle" "any" "any-control+alt-is-altgr" "any/c" "append" "append*" "append-editor-font-menu-items" "append-editor-operation-menu-items" "append-map" "application-about-handler" "application-file-handler" "application-preferences-handler" "application-quit-handler" "application-start-empty-
@greghendershott
greghendershott / check-pkg.rkt
Last active July 22, 2022 18:59
Sketch of checking catalog server for package problems
#lang racket/base
(require (only-in net/url string->url call/input-url get-pure-port)
(only-in racket/date date-display-format date->string)
(only-in racket/match match)
(only-in racket/pretty pretty-print))
(provide packages
packages-by-author
package
#lang at-exp racket/base
(require drracket/check-syntax
openssl/sha1
racket/async-channel
racket/class
racket/file
racket/format
racket/list
racket/match
;; provide.rkt
#lang racket/base
(module outer racket/base
(module inner racket/base
(define (foo x) x)
(define (bar x) x)
(provide foo bar))
#lang racket/base
(require racket/match
racket/path
racket/pretty
syntax/modread)
(define (expanded-module+symbol->identifier path-str exp-mod-stx sym)
;; (-> path-string? syntax? symbol? identifier?)
;;

I am seeing a problem where drracket/check-syntax show-content returns bad pathnames in syncheck:add-jump-to-definition items. It seems to happen only requires of relative path names.

Given a.rkt and b.rkt in the same dir:

#lang racket/base
(require "b.rkt")
provided-by-b
#lang racket/base
(require racket/require
(multi-in racket (contract function)))
(define executor (make-will-executor))
(void (thread (λ () (let loop () (will-execute executor) (loop)))))
(define frame? any/c)
;; <base-name> is used both (1) to define a parameter named
;; current-<base-name> and (2) to get an environment variable named
;; "WEB_<BASE_NAME>" (note conversion of kebab-case to SNAKE_CASE).
(define-syntax-parser dp
[(_ base-name:id
default:expr
contract:expr
(~optional (~seq #:coerce coerce:expr) #:defaults ([coerce #'values]))
(~optional (~seq #:secret? secret?:boolean) #:defaults ([secret? #'#f])))
(with-syntax ([id-name (format-id #'base-name
#lang racket/base
(require openssl
racket/contract)
(provide ports->tls-ports/accept
ports->tls-ports/connect)
(define pem (build-path (collection-path "openssl") "test.pem"))
(define server-ctx (ssl-make-server-context 'tls12))

Let's say you want to run Emacs for Linux under Windows Subsystem for Linux. The following is what I have been trying, for about 48 hours as I write this. So, take this with a grain of salt. It is not meant to be a polished or comprehensive tutorial.

Do a vanilla WSL install

  • Install Windows Subsystem for Linux itself.

  • Install a distro from the Microsoft store, e.g. Ubuntu.