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

Wrong beginning-of-defun-function implementation #503

Closed
sergeyklay opened this issue Apr 15, 2019 · 0 comments · Fixed by #504
Closed

Wrong beginning-of-defun-function implementation #503

sergeyklay opened this issue Apr 15, 2019 · 0 comments · Fixed by #504

Comments

@sergeyklay
Copy link
Contributor

sergeyklay commented Apr 15, 2019

From the documentation:

The function takes the same argument as `beginning-of-defun' and should behave similarly, returning non-nil if it found the beginning of a defun.

So this code will always fail:

(defsubst in-function-p (&optional pos)
  "Determine whether POS is inside a function."
  (let (bof (pos (or pos (point))))
    (save-excursion
      (when (beginning-of-defun)
        (setq bof (point))
        (end-of-defun)
        (and (> pos bof)
             (< pos (point)))))))

because (beginning-of-defun) always return nil in php-mode.

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

Successfully merging a pull request may close this issue.

1 participant