From 8ae3c3938c2c72458470e64ca413e24f2b149ac5 Mon Sep 17 00:00:00 2001 From: Oleh Krehel Date: Mon, 12 Jan 2015 20:19:56 +0100 Subject: [PATCH] [Fix #269] Check for bobp in `clojure-in-docstring-p' * clojure-mode.el (clojure-in-docstring-p): Don't call `(get-text-property 0)`, since it will throw. --- CHANGELOG.md | 5 +++++ clojure-mode.el | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80780394..fbf7e730 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## master (unreleased) +### Bugs fixed + +* Prevent error when calling `indent-for-tab-command` at the start of + the buffer at end of line. + ## 4.0.1 (19/12/2014) ### Bugs fixed diff --git a/clojure-mode.el b/clojure-mode.el index 652e1d30..2bdd044a 100644 --- a/clojure-mode.el +++ b/clojure-mode.el @@ -280,8 +280,9 @@ ENDP and DELIMITER." (defsubst clojure-in-docstring-p () "Check whether point is in a docstring." - (eq (get-text-property (1- (point-at-eol)) 'face) - 'font-lock-doc-face)) + (unless (bobp) + (eq (get-text-property (1- (point-at-eol)) 'face) + 'font-lock-doc-face))) (defsubst clojure-docstring-fill-prefix () "The prefix string used by `clojure-fill-paragraph'.