I am using Emacs 26.0.50. In the cases that I tried, when there is no comment in the portion of the buffer between the search limit and point, `comment-search-backward' does not move point to the search limit before raising an error. This behaviour contradicts its docstring. My message to emacs-devel about this is at http://lists.gnu.org/archive/html/emacs-devel/2017-09/msg00193.html Attached are a patch that seems to fix the problem, and a file containing a test. Running the test without the change in the patch fails, and passes with the change: $ git checkout master $ emacs -Q -batch -l lisp/newcomment.el -l /tmp/test.el \ -f ert-run-tests-batch-and-exit ---------------------------------------------------------------------- (ert-test-failed ((should (= (point) limit)) :form (= 70 41) :value nil)) FAILED 1/1 test-comment-search-backward-absent ---------------------------------------------------------------------- $ git checkout test-comment-search-forward-absent $ emacs -Q -batch -l lisp/newcomment.el -l /tmp/test.el \ -f ert-run-tests-batch-and-exit ---------------------------------------------------------------------- Running 1 tests (2017-09-12 03:31:48+0530) passed 1/1 test-comment-search-backward-absent ---------------------------------------------------------------------- Raghu. -- N. Raghavendra , http://www.retrotexts.net/ Harish-Chandra Research Institute, http://www.hri.res.in/