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

(scan-error "Containing expression ends prematurely" 2 2) #54

Closed
DamienCassou opened this issue Nov 13, 2017 · 2 comments
Closed

(scan-error "Containing expression ends prematurely" 2 2) #54

DamienCassou opened this issue Nov 13, 2017 · 2 comments

Comments

@DamienCassou
Copy link
Contributor

  1. M-: (helpful-variable 'magit-branch-popup)
Debugger entered--Lisp error: (scan-error "Containing expression ends prematurely" 2 2)
  scan-sexps(4 -1)
  forward-sexp(-1)
  calculate-lisp-indent((1 2 13 nil nil nil 0 nil nil (2) nil))
  lisp-indent-line()
  cl--do-prettyprint()
  cl-prettyprint((:variable magit-branch-arguments :man-page "git-branch" :variables #f(compiled-function () #<bytecode 0x1b1dbe1>) :actions ((98 "Checkout" magit-branch-or-checkout) nil (67 "Configure..." magit-branch-config-popup) (108 "Checkout local branch" magit-branch-checkout) (115 "Create new spin-off" magit-branch-spinoff) (109 "Rename" magit-branch-rename) (99 "Checkout new branch" magit-branch-and-checkout) (110 "Create new branch" magit-branch) (120 "Reset" magit-branch-reset) (119 "Checkout new worktree" magit-worktree-checkout) (87 "Create new worktree" magit-worktree-branch) (107 "Delete" magit-branch-delete) (106 "Create branch from jira" magit-create-branch-from-jira-issue)) :default-action magit-checkout :max-action-columns 3 :setup-function magit-branch-popup-setup))
  helpful--pretty-print((:variable magit-branch-arguments :man-page "git-branch" :variables #f(compiled-function () #<bytecode 0x1b1dbe1>) :actions ((98 "Checkout" magit-branch-or-checkout) nil (67 "Configure..." magit-branch-config-popup) (108 "Checkout local branch" magit-branch-checkout) (115 "Create new spin-off" magit-branch-spinoff) (109 "Rename" magit-branch-rename) (99 "Checkout new branch" magit-branch-and-checkout) (110 "Create new branch" magit-branch) (120 "Reset" magit-branch-reset) (119 "Checkout new worktree" magit-worktree-checkout) (87 "Create new worktree" magit-worktree-branch) (107 "Delete" magit-branch-delete) (106 "Create branch from jira" magit-create-branch-from-jira-issue)) :default-action magit-checkout :max-action-columns 3 :setup-function magit-branch-popup-setup))
  helpful-update()
  helpful-variable(magit-branch-popup)
  eval((helpful-variable 'magit-branch-popup) nil)
  eval-expression((helpful-variable 'magit-branch-popup) nil nil 127)
  funcall-interactively(eval-expression (helpful-variable 'magit-branch-popup) nil nil 127)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)

@Wilfred
Copy link
Owner

Wilfred commented Dec 16, 2017

This is a bug with calculate-lisp-indent, which helpful--pretty-print calls via cl-prettyprint. If you have a sufficiently large list literal, e.g.

(:variable magit-branch-arguments :man-page "git-branch" :actions
           ((98 "Checkout" magit-checkout)
            (110 "Create new branch" magit-branch)
            (67 "Configure..." magit-branch-config-popup)
            (99 "Checkout new branch" magit-branch-and-checkout)
            (115 "Create new spin-off" magit-branch-spinoff)
            (109 "Rename" magit-branch-rename)
            (119 "Checkout new worktree" magit-worktree-checkout)
            (87 "Create new worktree" magit-worktree-branch)
            (120 "Reset" magit-branch-reset)
            nil nil
            (107 "Delete" magit-branch-delete)
            (102 "new branch From current" wh/magit-branch-from-current-and-checkout))
           :default-action magit-checkout :max-action-columns 3 :setup-function magit-branch-popup-setup)
;; or
(:foo foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo :bar bar)

Then cl-prettyprint adds newlines, splitting the list over multiple lines. It looks like lisp-indent-line can't handle code of the form:

(:foo foo
 :bar bar)

If you put point on the second line and call calculate-lisp-indent. you get the same error.

@Wilfred
Copy link
Owner

Wilfred commented Dec 16, 2017

Turns out it was a bug with helpful.el not using the right major mode. This should work now.

Wilfred added a commit that referenced this issue Dec 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants