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

clojure-in-docstring-p #295

Closed
phillord opened this issue May 24, 2015 · 2 comments
Closed

clojure-in-docstring-p #295

phillord opened this issue May 24, 2015 · 2 comments

Comments

@phillord
Copy link
Contributor

There is an off-by-one error in clojure-in-docstring-p.

It happens when the first line is zero width!

Debugger entered--Lisp error: (args-out-of-range 0 0)
get-text-property(0 face)
clojure-in-docstring-p()
(if (clojure-in-docstring-p) (save-excursion (beginning-of-line) (if (looking-at "^\s-*") (progn (replace-match (clojure-docstring-fill-prefix))))) (lisp-indent-line))
clojure-indent-line()
indent-according-to-mode()
electric-indent-post-self-insert-function()
self-insert-command(1)
newline(nil 1)
call-interactively(newline nil nil)
command-execute(newline)

@bbatsov
Copy link
Member

bbatsov commented May 25, 2015

It happens when the first line is zero width!

Can you elaborate on that? A repro case would be helpful.

@phillord
Copy link
Contributor Author

Sorry for the terse report! I had a four year old jump on my half-way through.

Reproducible case: Open an empty file in Clojure mode, hit tab. It breaks.

My diagnosis is:

(get-text-property (1- (point-at-eol) 'face)

is illegal since with a empty first line (1- (point-at-eol)) returns 0.

bbatsov added a commit that referenced this issue Jun 11, 2015
[Fix #295] clojure-in-docstring-p not using point
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