Skip to content

Commit

Permalink
Rename eval-in-other-ns to follow convention
Browse files Browse the repository at this point in the history
  • Loading branch information
motform committed Apr 23, 2021
1 parent 21cf73e commit cdc94ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@
Doing this should populate the view's list with the now evaluated treemap, ready to inspect!

** Configuration
reveal-remote-mode exposes two meaningful variables: the interrelated ~reveal-remote-mode-eval-in-other-ns~ and ~reveal-remote-other-ns~. By default Reveal evaluates the received form (and thus all sub forms) in the ~vlaaad.reveal.ext~ namespace, causing any unknown symbols to result in compile errors (as per regular Clojure semantics). We can configure this behavior using the ~:ns~ key, which reveal-remote-mode defaults to whatever is in ~*ns*~. Setting ~reveal-remote-mode-eval-in-other-ns~ allows you to toggle this behaviour (default ~t~), ~reveal-remote-other-ns~ allows you to specify the value of ~:ns~.
reveal-remote-mode exposes two meaningful variables: the interrelated ~reveal-remote-eval-in-other-ns~ and ~reveal-remote-other-ns~. By default Reveal evaluates the received form (and thus all sub forms) in the ~vlaaad.reveal.ext~ namespace, causing any unknown symbols to result in compile errors (as per regular Clojure semantics). We can configure this behavior using the ~:ns~ key, which reveal-remote-mode defaults to whatever is in ~*ns*~. Setting ~reveal-remote-eval-in-other-ns~ allows you to toggle this behaviour (default ~t~), ~reveal-remote-other-ns~ allows you to specify the value of ~:ns~.

In addition to these, there is also a list called ~reveal-remote-views~ that enumerates the possible Reveal views. This is the place where you would add custom views.

| Variables | Values |
|-------------------------------------+------------------------------------------------------|
| ~reveal-remote-mode-eval-in-other-ns~ | ~t~ (default), ~nil~ |
| ~reveal-remote-eval-in-other-ns~ | ~t~ (default), ~nil~ |
| ~reveal-remote-other-ns~ | ~*ns*~ (default), any valid Clojure namespace (string) |
| ~reveal-remote-env~ | any valid Clojure form (string), nil (default) |
| ~reveal-remote-views~ | Alist of Reveal views |
Expand Down
6 changes: 3 additions & 3 deletions reveal-remote-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
:group 'reveal-remote
:type 'string)

(defcustom reveal-remote-mode-eval-in-other-ns t
(defcustom reveal-remote-eval-in-other-ns t
"If non-nil (default), evaluates forms in the current buffer's namespace.
By default, Reveal evaluates any forms it encounters in vlaaad.reveal.ext,
Expand All @@ -62,7 +62,7 @@ which means that any unknown symbols will result in compile errors."
:type 'boolean)

(defcustom reveal-remote-other-ns "*ns*" ; not sure how robust it is to rely on *ns*
"The namespace used when `reveal-remote-mode-eval-in-other-ns' is non-nil."
"The namespace used when `reveal-remote-eval-in-other-ns' is non-nil."
:group 'reveal-remote
:type 'string)

Expand Down Expand Up @@ -99,7 +99,7 @@ which means that any unknown symbols will result in compile errors."
(format "{:vlaaad.reveal/command '((requiring-resolve 'vlaaad.reveal.ext/%s) %s) %s %s}"
command
(or arg "")
(or (when reveal-remote-mode-eval-in-other-ns
(or (when reveal-remote-eval-in-other-ns
(format ":ns %s" reveal-remote-other-ns)) "")
(or (when reveal-remote-env
(format ":env %s" reveal-remote-env)) "")))
Expand Down

0 comments on commit cdc94ba

Please sign in to comment.