Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch-to-buffer broken when its argument is nil #79

Closed
ilupin opened this issue Feb 17, 2016 · 4 comments
Closed

switch-to-buffer broken when its argument is nil #79

ilupin opened this issue Feb 17, 2016 · 4 comments
Labels
Milestone

Comments

@ilupin
Copy link

ilupin commented Feb 17, 2016

In the document string of switch-to-buffer:

If BUFFER-OR-NAME is nil, switch to the buffer returned by `other-buffer'.

However, it fails when purpose mode is turned on.

@bmag
Copy link
Owner

bmag commented Feb 17, 2016

Thanks for the report, I will look into it. Can you describe how it fails?

@ilupin
Copy link
Author

ilupin commented Feb 17, 2016

(eval (switch-to-buffer nil)) just produces an error "Wrong type argument: stringp, nil".
Normally it should switch to previous buffer.

@bmag
Copy link
Owner

bmag commented Feb 17, 2016

I've found the problem and I'll push a fix later today or tomorrow. In the meantime you can use this advice:

(advice-add 'purpose-select-buffer :filter-args
            (lambda (args)
              (cons (window-normalize-buffer-to-switch-to (car args))
                    (cdr args))))

@bmag bmag added the bug label Feb 17, 2016
@bmag bmag added this to the 1.6 milestone Feb 17, 2016
@bmag
Copy link
Owner

bmag commented Feb 17, 2016

Fixed in 3820ff8

@bmag bmag closed this as completed Feb 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants