Hello,

The problem is that the advices work only if the functions are called
interactively.

Please, replace the advices in senator.el by the following ones. They
should work with `narrow-to-defun' now.

(defadvice beginning-of-defun (around senator activate)
  "If semantic tokens are available, use them to navigate."
  (if senator-minor-mode
      (let ((senator-highlight-found nil)
            (senator-step-at-start-end-token-ids nil)
            (senator-step-at-token-ids '(function)))
        (senator-previous-token))
    ad-do-it))

(defadvice end-of-defun (around senator activate)
  "If semantic tokens are available, use them to navigate."
  (if senator-minor-mode
      (let* ((senator-highlight-found nil)
             (senator-step-at-start-end-token-ids '(function))
             (senator-step-at-token-ids '(function))
             (token (senator-next-token)))
        (when (and token
                   (= (point) (semantic-token-start token)))
          (goto-char (semantic-token-end token))
          (senator-message "%S: %s (end)"
                           (semantic-token-token token)
                           (semantic-token-name  token))))
    ad-do-it))

If there is no other problems I will include them in senator.

Thank you for your feedback.
Sincerely,
David

[EMAIL PROTECTED] wrote:
>
> Even though beginning-of-defun and end-of-defun have been advised by
> senator, the narrow-to-defun and widen functions do not seem to work,
as
> they seem to be using the unadvised functions. Do they need to be
advised as
> well?
>
> --
> knut
>

Reply via email to