6

How to see *Messages* buffer as advised in this answer - https://emacs.stackexchange.com/a/32069/23367?


Why do I need this?

I am new to Spacemacs and I am trying to understand how it can help me writing Ansible roles and testing them. I found Ansible layer, added ansible to dotspacemacs-configuration-layers and restarted Spacemacs. Still I have no idea how to use that. SPC m h a doesn't work - resulting in SPC m is undefined. Spacemacs shows /YAML\ at the bottom near the filename. I don't see that Spacemacs detected YAML file as an Ansible playbook - I don't get any hints or errors displayed on the screen. Perhaps I need to change mode from YAML to Ansible somehow, but first I need to check if there are any errors why loading the layer for Ansible.

Anatoli Babenia
  • 165
  • 1
  • 7

2 Answers2

7

It's just a buffer, so any of the numerous methods of switching to a buffer can be used.

For example, using standard Emacs key sequences:

  • C-xb *Messages* RET
  • C-xC-b and select *Messages*
  • M-x ibuffer RET and select *Messages*
  • <C-down-mouse-1> and select *Messages*
  • Click on the Buffers menu, and select *Messages*
  • C-x<right> until you reach *Messages*

As it happens, there are also two key bindings specifically for this purpose:

  • C-he runs the command view-echo-area-messages
  • Click mouse-1 in the echo area (same space as the minibuffer).

So you would probably use one of those by preference; but I wanted to make it clear that there's nothing special about this buffer when it comes to viewing it -- you can reach it in the same ways you use to get to any other buffer.

phils
  • 48,657
  • 3
  • 76
  • 115
  • 2
    I am always a bit wary when they add a tag like `[spacemacs]` or `[ergomacs]`. Sometimes they rebind stuff in those configs. (That is the reason why I did not write an answer for this one.) Have you tested whether it works in `spacemacs`? – Tobias May 02 '19 at 11:56
  • 2
    No; I always leave it up to the user to translate from the standard keys to their own custom key bindings. They can always run `emacs -Q` and check which command a standard key sequence is bound to, and then look up the equivalent in their own config. I've edited the answer to clarify that I'm showing default Emacs bindings. – phils May 02 '19 at 12:11
  • No doubt someone who uses spacemacs will provide a more targeted answer, if the suggestions I've made don't work. – phils May 02 '19 at 12:14
  • This is a good answer, but I wonder if we shouldn't either (1) change the question to be about any buffer, not `*Messages*` or (2) delete it as a duplicate, and change the other question to be specifically about `*Messages*` (not Spacemacs log). I added a mention of how to get to `*Messages*` to the answer of the other question this one duplicates. – Drew May 02 '19 at 13:59
  • I added `mouse-1` click in echo area. – Drew May 02 '19 at 14:02
  • Thanks for that addition, @Drew. I think there are sufficient other answers about "how to switch buffers" generally, and I don't think this answer is any more helpful in that regard, so I would keep this one about `*Messages*`. I also found https://emacs.stackexchange.com/q/29826 when looking for duplicates, but concluded that the two questions were slightly different, and warranted slightly different answers. I think the same applies to the question the OP linked to -- similar as they are, it still feels ok to me for them to remain separate, as the motivations aren't quite the same. – phils May 02 '19 at 22:14
  • C-x b then selecting worked. New window opens instead of current, but when I quit the window with `:q` the editor quits and previous window is not restored. With C-x C-b selection doesn't work. I guess focus is wrong. M-x `ibuffer` works, but also kills previous window. C-x Right didn't work for *Messages*. C-h e works! Still have to click to change the focus and scroll/close the window, – Anatoli Babenia May 03 '19 at 13:17
6

This is possible in Spacemacs with SPC w p m key sequence (mentioned here).

For more general way, in Spacemacs you can open buffer list with SPC b b. Then you can use your arrow key to find the desired buffer.

default buffer list

If you don't find the desired one, probably it's hidden. Spacemacs use Helm and Helm hide 'unuseful' buffer by default. You can use C-c a to show hidden buffers

Anatoli Babenia
  • 165
  • 1
  • 7
moanrisy
  • 100
  • 6
  • 1
    Well, I can see messages, but when I try to close the window with `:q`, Spacemacs exits. But I found that `SPC w p m` works. https://github.com/syl20bnr/spacemacs/issues/4259 – Anatoli Babenia May 03 '19 at 13:20