abmclin
2017-8-17 15:11:30

A DrRacket question is there a way to mark certain positions in an open file so I can jump back to them from anywhere else in the file? For example, when working on a large file, I often need to navigate to a different part to read code there while I’m actively working on a different part. It would be nice to be able to mark the active site and jump back to it after rather than tediously scrolling back and searching around for a few moments to reorient myself.

I looked around and didn’t see such a feature. It probably doesn’t exist but thought I’d ask and hope I’m lucky.


greg
2017-8-17 18:17:12

@abmclin If you have Emacs-style keybindings enabled in DrRacket, does C-x C-x work (like exchange-point-and-mark in Emacs)?


abmclin
2017-8-17 18:49:46

@greg that keybinding doesn’t seem to work, I also looked at the list of active keybindings but don’t see it listed on there either.


abmclin
2017-8-17 18:50:20

I might switch back to Emacs, I hadn’t realized there was such a thing as exchange-point-and-mark


greg
2017-8-17 19:24:56

I just upgraded Racket for something, jumping from 6.7 to 6.10. Suddenly the logger is quite noisy with e.g.:

[warning] building projection of contract #<flat-contract: xexpr/c> for
  (build-context . #(struct:srcloc #<path:/Applications/Racket_v6.10/collects/racket/contract/private/prop.rkt> 319 0 10714 195))
  (get/build-projection . #(struct:srcloc #<path:/Applications/Racket_v6.10/collects/racket/contract/private/guts.rkt> 812 0 28280 301))
  (.../more-scheme.rkt:261:28 . #f)
  (mk-call . #(struct:srcloc #<path:/Applications/Racket_v6.10/collects/racket/contract/private/arrow-val-first.rkt> 400 5 17828 2114))
  (#f . #(struct:srcloc #<path:/Applications/Racket_v6.10/collects/racket/contract/private/arrow-val-first.rkt> 397 3 17564 3019))
  (#f . #(struct:srcloc #<path:/Applications/Racket_v6.10/collects/racket/contract/private/arrow-higher-order.rkt> 342 33 18779 125))
  (#f . #(struct:srcloc #<path:/Applications/Racket_v6.10/collects/racket/contract/private/arrow-higher-order.rkt> 342 33 18779 125))
  (#f . #(struct:srcloc #<path:/Applications/Racket_v6.10/collects/racket/contract/private/arrow-higher-order.rkt> 342 33 18779 125))
  (#f . #(struct:srcloc #<path:/Users/greg/src/deals/web/main.rkt> 725 0 28187 355))
  (#f . #(struct:srcloc #<path:/Applications/Racket_v6.10/collects/racket/contract/private/arrow-higher-order.rkt> 346 33 19012 147))
  (#f . #(struct:srcloc #<path:/Applications/Racket_v6.10/collects/racket/contract/private/arrow-higher-order.rkt> 342 33 18779 125))
  (#f . #(struct:srcloc #<path:/Applications/Racket_v6.10/collects/racket/contract/private/arrow-higher-order.rkt> 342 33 18779 125))
  (#f . #(struct:srcloc #<path:/Applications/Racket_v6.10/share/pkgs/web-server-lib/web-server/dispatchers/dispatch-servlets.rkt> 63 2 2495 1974))
  (#f . #(struct:srcloc #<path:/Applications/Racket_v6.10/collects/racket/contract/private/arrow-higher-order.rkt> 342 33 18779 125))
  (#f . #(struct:srcloc #<path:/Applications/Racket_v6.10/collects/racket/contract/private/arrow-higher-order.rkt> 342 33 18779 125))
  (select-handler/no-breaks . #(struct:srcloc #<path:/Applications/Racket_v6.10/collects/racket/private/more-scheme.rkt> 163 2 5402 511))
  (#f . #(struct:srcloc #<path:/Applications/Racket_v6.10/collects/racket/contract/private/arrow-higher-order.rkt> 342 33 18779 125))
  (#f . #(struct:srcloc #<path:/Applications/Racket_v6.10/share/pkgs/web-server-lib/web-server/private/dispatch-server-with-connect-unit.rkt> 131 8 5179 445))
  1. What is the warning trying to tell me, and how can I fix it?

  2. Note: This seems to be using log-warning. It would be nicer if it defined its own logger e.g. contract and used log-contract-warning? (That way, it could be silenced without silencing all other log-warnings?)


stamourv
2017-8-17 19:33:36

lights the @robby signal.


robby
2017-8-17 19:37:05

that was my passive-aggressive attempt to get people to update their contract combinators to use the more recent interface


robby
2017-8-17 19:37:21

I should move it over to log-contract-warning


robby
2017-8-17 19:39:55

oh, wait: it seems to already be that way?


robby
2017-8-17 19:41:20
      (log-racket/contract-info
       "no late-neg-projection passed to ~s~a"
       proc-name
       (build-context))

robby
2017-8-17 19:41:35

in racket/contract/private/prop, line 298?


robby
2017-8-17 19:41:38

(in 6.10)


greg
2017-8-17 20:01:37

@robby Just to confirm, the xexpr/c contract would need to change (not something in my code using it)?


robby
2017-8-17 20:02:01

Right


robby
2017-8-17 20:02:24

(well, the logger isn’t using log-warning as far as I can tell, so maybe something needs to change elsewhere too?)


greg
2017-8-17 20:02:49

I’ll see if I can figure out part of it.


greg
2017-8-17 20:03:59

(I recently added a *Racket Logger* mode/window to racket-mode, and want to make sure it’s not some issue on that end (although atm I don’t see how it could be; just make sure); and will share whatever I learn)


robby
2017-8-17 20:10:34

Thanks!!


robby
2017-8-17 20:11:30

oh, and I see that was the wrong log call. This is the right one, I think?


robby
2017-8-17 20:11:32
     (log-racket/contract-warning
      "building projection of contract ~s for~a"
      ctc
      (build-context))

robby
2017-8-17 20:11:44

line 816 of racket/contract/private/gut


robby
2017-8-17 20:11:44

s


greg
2017-8-17 20:20:31

I think what’s confusing me is that (define-logger foo) normally prepends the text foo: — the logger name — to the message.


greg
2017-8-17 20:20:40

But I don’t see "racket/contract:" starting the message.


greg
2017-8-17 20:20:48

So I assumed it was the generic logger.


greg
2017-8-17 20:23:33

It’s not some silly bug wrt the / in the logger name. This works: #lang racket/base (define-logger foo) (define-logger foo/bar) (log-foo-fatal "hi I'm foo") (log-foo/bar-fatal "hi I'm foo/bar") ;; Logger output ;; [ fatal] foo: hi I'm foo ;; [ fatal] foo/bar: hi I'm foo/bar


greg
2017-8-17 20:23:53

Huh.


greg
2017-8-17 20:23:56

mulls….


greg
2017-8-17 20:40:18

OK so 1. I’m totally stumped why "racket/contract:" doesn’t start the log output and identify the logger. It would be good to figure that out. 2. Meanwhile, knowing that the logger name is racket/contract, I can crank the log receiver up from warning to fatal for that logger, to silence that output (in situations where that information isn’t relevant).


greg
2017-8-17 20:40:54

@robby thanks!


robby
2017-8-17 20:41:56

Should the topic be relevant here?


greg
2017-8-17 20:58:11

Sorry, what? Do you mean should the logger topic (a.k.a. logger name) be relevant in some situations, or, do you mean our discussion here on Slack :slightly_smiling_face:, or something else?



leif
2017-8-17 21:18:55

@samth Oh cool, thanks.


zenspider
2017-8-17 21:19:27

@abmclin if you do switch back to emacs, what you want is jump registers… there’s also bookmarks (temporary or permanent). There’s also C-x C-SPC to jump to your last edit… um. lots. :slightly_smiling_face:


robby
2017-8-17 21:58:10

@greg I mean that I would have thought you could filter based on the topic and not based on the characters that appear before the : in the logged message.


lexi.lambda
2017-8-17 23:57:11

@mflatt Based on my experimentation, it doesn’t seem like make-evaluator from racket/sandbox requires a configure-runtime submodule of the language provided to the evaluator. Is this behavior intentional, or would it be useful to add that?


mflatt
2017-8-18 00:53:29

@lexi.lambda I think it would be useful to add that. I’m not certain of the compatibility implications (and there wouldn’t be any if we had thought to add that when submodules like configure-runtime were introduced), but it may be ok.


leif
2017-8-18 03:53:46

Would it make sense to have a test-deps field in #lang info, like build-deps, but for testing.


leif
2017-8-18 03:54:07

Since there are some packages I want to instll, but they’re only really needed for testing.


notjack
2017-8-18 04:39:33

@leif Test only packages are already build deps, or did you mean you want something to not be a build dep?