Closed izahn closed 8 years ago
@izahn if you put this in user-config
, does C-c C-c
generate an image as expected? (this isn't a work-around, just a test)
(defun return-t (&rest _args) t)
(advice-add 'spacemacs/useful-buffer-p :override #'return-t)
Also, please check if there's anything relevant in the *Messages*
buffer (C-h e
).
I have a similar issue with notmuch. When I open some buffers in notmuch and then close it with q
, I'm redirected to *scratch*
buffer instead of going to the previous one.
Snippet from @bmag helped.
@vashirov I don't think it's a similar issue. In your case, it's probably that Spacemacs considers the earlier buffer as "useless" (spacemacs/useless-buffer-p
returns true). Can you open a new issue, with details about what buffer you expected to see instead of *scratch*
? We probably need to refine the value of spacemacs-useless-buffers-regexp
.
It's similar in a way that this commit broke notmuch, sorry for the confusion. Sure, I'll open a new issue.
@izahn I noticed that current implementation of spacemacs/useless-buffer-p
has a side effect of changing the match data (it uses string-match
instead of string-match-p
). Please replace in your local installation the code for spacemacs/useless-buffer-p
and spacemacs/useful-buffer-p
in layers/+distributions/spacemacs-base/funcs.el
with this one:
(defun spacemacs/useful-buffer-p (buffer)
"Determines if a buffer is useful."
(let ((buf-name (buffer-name buffer)))
(or (with-current-buffer buffer
(derived-mode-p 'comint-mode))
(cl-loop for useful-regexp in spacemacs-useful-buffers-regexp
thereis (string-match-p useful-regexp buf-name))
(cl-loop for useless-regexp in spacemacs-useless-buffers-regexp
never (string-match-p useless-regexp buf-name)))))
(defun spacemacs/useless-buffer-p (buffer)
"Determines if a buffer is useless."
(not (spacemacs/useful-buffer-p buffer)))
Does this fix the problem? If it doesn't, I'd like you to perform the earlier test I asked for and report back.
@bmag Replacing spacemacs/useless-buffer-p
and spacemacs/useful-buffer-p
with the definitions in your previous comment solves the problem!
@izahn nice :smile: I opened a PR with the change: #6685
Fix merged.
Description :octocat:
Commit fe60d0f breaks org-babel
Reproduction guide :beetle:
(require 'ob-R)
to enable R code blocks in orgmode.org
file and insertC-c C-c
to evaluate the blockObserved behaviour: :eyes: :broken_heart:
Emacs says "Code block produced no output" and no figure is created
Expected behaviour: :heart: :smile: R should start and generate the figure.
Details I bisected this to
Before that it works as expected. After that commit, kaboom. I don't see what that commit has to do with orgmode or babel, but is clear that this is where things were broken. Hopefully @bmag or @TheBB have some idea about how to fix it.
System Info :computer:
Backtrace :paw_prints: