ada-mode-users
[Top][All Lists]
Advanced

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

[Ada-mode-users] [patch] ada-gnat-xref-common-args: Wrong type argument:


From: Ludovic Brenta
Subject: [Ada-mode-users] [patch] ada-gnat-xref-common-args: Wrong type argument: number-or-marker-p, nil
Date: Wed, 01 Feb 2017 18:45:10 +0100
User-agent: Roundcube Webmail/0.5.3

Hello,

ada-gnat-xref-adj-col calls (char-after (point)) in the wrong buffer.
This occasionally triggers a bug when point was on an operator decl.
To reproduce:

- open an Ada source file and an (possibly automatically) Ada-mode
  project file.
- Move point to the operator name in a declaration such as:

function "+" (Left : in Day; Right : in Integer) return Day;

  (if your source file contains no such declaration, make one first).

- C-x b SPACE SPACE to show the list of all buffers, even hidden ones.
- Go to the hidden buffer ' *gnat-run-.....*', which should contain the
output of "gnat list -v" with source, object and project search paths.
- C-x > to go to the end of that buffer.
- Go back to the Ada source buffer.
- C-c C-d.
ada-gnat-xref-common-args: Wrong type argument: number-or-marker-p, nil

This is because, point being at the end of the gnat-run-buffer,
(char-after (point)) bail out.  We discovered this bug accidentally;
it can be triggered also if gnatfind returns no references (which is
another bug) and leaves point at the end of the gnat-run-buffer.

I'm not too sure how to fix that, though.  Essentially, ada-gnat-xref-
adj-col should not make any assumption about which buffer is current
but it still needs information about the location where C-c C-d was
called.

--
Ludovic Brenta.




reply via email to

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