GNU bug report logs - #20761
beginning-of-defun matches column 0 paren inside string literal

Previous Next

Package: emacs;

Reported by: Andreas Röhler <andreas.roehler <at> easy-emacs.de>

Date: Sun, 7 Jun 2015 17:22:02 UTC

Severity: wishlist

Tags: fixed

Merged with 20284, 26642

Found in versions 25.0.50, 25.0.50.1, 25.1, 25.2

Fixed in version 27.1

Done: Noam Postavsky <npostavs <at> users.sourceforge.net>

Bug is archived. No further changes may be made.

Full log


Message #27 received at 20761 <at> debbugs.gnu.org (full text, mbox):

From: npostavs <at> users.sourceforge.net
To: Andreas Röhler <andreas.roehler <at> easy-emacs.de>
Cc: 20761 <at> debbugs.gnu.org
Subject: Re: bug#20761: 25.0.50.1, beginning-of-defun matches inside string
Date: Sun, 02 Apr 2017 01:18:06 -0400
retitle 20761 beginning-of-defun matches column 0 paren inside string literal
forcemerge 20761 20284
tags 20761 wontfix
quit

Andreas Röhler <andreas.roehler <at> easy-emacs.de> writes:

> This should fix it:
>
> (defun ar-beginning-of-defun (&optional arg)
>   "Move to the beginning of a function definition.
>
> Returns position, if successful, nil otherwise
>
> Calls `beginning-of-defun-function', when set "
>   (interactive "P")
>   (unless (bobp)
>     (skip-chars-backward " \t\r\n\f")
>     (forward-char -1)
>     (let ((pos (car-safe (nth 9 (parse-partial-sexp (point-min) (point))))))
>       (if beginning-of-defun-function
>       (funcall beginning-of-defun-function arg)
>     (and pos
>          (goto-char pos))))))

M-x find-library org RET
M->
(benchmark 1 '(ar-beginning-of-defun)) ; Elapsed time: 0.414771s, also it puts point in the wrong place
(benchmark 1 '(beginning-of-defun))    ; Elapsed time: 0.000126s
M-: (setq open-paren-in-column-0-is-defun-start nil)
(benchmark 1 '(beginning-of-defun))    ; Elapsed time: 0.002505s




This bug report was last modified 7 years and 104 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.