bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20761: 25.0.50.1, beginning-of-defun matches inside string


From: npostavs
Subject: bug#20761: 25.0.50.1, beginning-of-defun matches inside string
Date: Sun, 02 Apr 2017 01:18:06 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

retitle 20761 beginning-of-defun matches column 0 paren inside string literal
forcemerge 20761 20284
tags 20761 wontfix
quit

Andreas Röhler <andreas.roehler@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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]