[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Ada-mode-users] [patch] Allow C-u C-c C-r to retain the previous cr
From: |
WAROQUIERS Philippe |
Subject: |
Re: [Ada-mode-users] [patch] Allow C-u C-c C-r to retain the previous cross references in the compilation buffer |
Date: |
Fri, 30 Sep 2016 17:26:12 +0000 |
C-u C-c C-r is the way to add/append new references to the existing gnat find
buffer in the 4.0 ada mode.
This is a pattern which I (and many others here) often use, as e.g. it allows
to do the following:
C-c C-r on an entity (typically a generic)
jump to an instantiation.
Then do C-u C-c C-r on the instantiation (to visit the callers)
For such use cases, all the references will be visited just by doing
'next-error'.
Having each time a new gnatfind buffer would be (IMO) a lot less usable
(even if the gnatfind buffer would be created automatically, it would mean a
lot more buffer,
and a need to switch buffers to visit next errors (or previous errors).
So, really, we like the C-u C-c C-r :).
Fully agree with you that the convention " C-u to append to the existing list
of references " should be available
for all commands that are producing references.
Note that I also often use 'list local reference' from the ada-mode 4.0, which
I do not retrieve
in ada-mode 5.2 (but maybe I did not search long enough ?).
In ada-mode 4.0, there is a huge performance difference between C-c C-r and C-c
l (binding for local references).
Unclear if with ada-mode 5.2, the perf aspect is still critical.
But sometimes, I really only want to find the local references.
So, would be nice to also have 'list local references' in new ada mode.
(BTW, gps behaviour for references is by default to add to the reference list.
gps also provides a list local reference command).
Thanks
Philippe
> -----Original Message-----
> From: Ada-mode-users [mailto:ada-mode-users-
> address@hidden On Behalf Of
> Stephen Leake
> Sent: 30 September 2016 18:32
> To: Ludovic Brenta
> Cc: Ada mode users
> Subject: Re: [Ada-mode-users] [patch] Allow C-u C-c C-r to retain the
> previous cross references in the compilation buffer
>
> Ludovic Brenta <address@hidden> writes:
>
> > C-c C-r always deletes the contents of the buffer containing
> > cross-references before launching gnat find. With this patch,
> > it is possible to retain the old information with a prefix argument:
> > C-u C-c C-r.
>
> I'd rather have this feature available uniformly on all xref commands.
>
> > +(require 'cl)
>
> We should use cl-lib, to keep the global namespace clean.
>
> > (dirs (when (ada-prj-get 'obj_dir)
> > (concat "-aO" (mapconcat 'identity (ada-prj-get 'obj_dir)
> ":"))))
> > - (project-file (when (ada-prj-current-file)
> > - (concat "-p" (ada-prj-current-file))))
>
> This code is not in 5.2; you apparently have a local patch?
>
> > + (if append
> > + (flet ((erase-buffer nil (goto-char (point-max))))
>
> 'flet' should be 'cl-flet'.
>
> This seems like a horrible hack.
>
> I gather the purpose of this is to save a list of references, while
> generating a new list. Another way to do that is to rename the
> *gnat-run* buffer after running the first search; did you try that?
>
> --
> -- Stephe
____
This message and any files transmitted with it are legally privileged and
intended for the sole use of the individual(s) or entity to whom they are
addressed. If you are not the intended recipient, please notify the sender by
reply and delete the message and any attachments from your system. Any
unauthorised use or disclosure of the content of this message is strictly
prohibited and may be unlawful.
Nothing in this e-mail message amounts to a contractual or legal commitment on
the part of EUROCONTROL, unless it is confirmed by appropriately signed hard
copy.
Any views expressed in this message are those of the sender.