Today I Learned

Short posts on small things I learn every day

Alchemist tests in other frame

I recently switched to a multi-monitor setup, but I couldn’t get my specemacs properly set-up to work with multiple frames.

Finally a solution using popwin, and a random hack found on internet worked.

  (push '("*alchemist test report*" :position bottom :stick t :noselect t)
  (setq display-buffer-alist
        '((popwin:display-buffer-condition (display-buffer-reuse-window
                                           (reusable-frames . visible))))

This will open the buffer as popwin popup if it’s not opened, but use the current window, if it already is - even if on a different frame.

Deeper stacktrace in Elixir

Have you ever found yourself with incomplete stacktrace in elixir?

You can easily increase the depth with a simple configuration:

:erlang.system_flag(:backtrace_depth, 20)

If you are using phoenix, it’s even simplier:

# config/env.exs
config :phoenix, :stacktrace_depth, 20

You should carefully consider this feature, though and avoid setting it to a high value in production - building the stacktrace is an expensive process.