GNU bug report logs - #10546
completion-at-point bug

Previous Next

Package: emacs;

Reported by: Andreas Röhler <andreas.roehler <at> online.de>

Date: Wed, 18 Jan 2012 18:53:02 UTC

Severity: normal

Tags: notabug

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


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

From: Andreas Röhler <andreas.roehler <at> online.de>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 10546 <at> debbugs.gnu.org
Subject: Re: bug#10546: completion-at-point bug
Date: Sun, 22 Jan 2012 15:10:18 +0100
Am 18.01.2012 22:22, schrieb Stefan Monnier:
>> get wrong error messages like
>
>> let*: Wrong type argument: listp, 16
>
>> from `completion-at-point' in cases `tab-to-tab-stop'
>> sends back a number - the column reached.
>
> Can you give us the context: what did you do in order for
> completion-at-point to call tab-to-tab-stop?
>
>
>          Stefan
>

Hi Stefan,

bug seen from forms in python-mode.el
http://launchpad.net/python-mode

when `py-completion-at-point' doesn't see a completion,
the feature is to insert a TAB then.

In result a number is returned by `tab-to-tab-stop',
which seems to confuse `completion-at-point', sending
the wrong error message.

(defun py-completion-at-point ()
  (interactive "*")
  (let* ((start (when (skip-chars-backward "[[:alnum:]_]")(point)))
         (end (progn (skip-chars-forward "[[:alnum:]_]")(point)))
         (completion (when start
                       (python-symbol-completions 
(buffer-substring-no-properties start end)))))
    (if completion
        (progn
          (delete-region start end)
          (insert (car completion)))
      (tab-to-tab-stop))))

;;;;;;;;;

`py-completion-at-point' is called by a var `py-complete-function', 
whilst `python-mode' runs

  (add-hook 'completion-at-point-functions
            py-complete-function nil 'local)

So far,

thanks developing our tool-of-pleasure :)

Andreas

--
http://launchpad.net/python-mode
http://launchpad.net/s-x-emacs-werkstatt/





This bug report was last modified 13 years and 186 days ago.

Previous Next


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