[gedit-list] use-case: gedit with cscope



Hi there,

I'd like to send in this use case to highlight a couple of issues for me
with the (otherwise excellent) gedit editor. It's possible that these
have been attended to in the recent couple of releases -- the version
I'm using is on FC4, it's version 2.10.2. I haven't been able to upgrade
without basically going into Fedora's 'experimental' releases, which I
don't want to do just now.

Anyway, the use-case I have here is gedit with 'cscope' and similar
tools. cscope can be run from a terminal window, and one can set it to
edit files with gedit by setting 'export EDITOR=gedit'. Then when a file
is opened from cscope, the gedit window pops up and displays the file.

The first issue is that if gedit hasn't already been launched at the
time when cscope launches it, then cscope *waits* for gedit to exit
again before it becomes responsive again. If on the other hand there is
already a gedit window open, then cscope will immediately become
responsive again, allowing one to examine multiple files from a single
cscope sessions.

The next issue is that each time I select a file to be opened, cscope
opens that file in a new tab, even if the file is already open. This
means that if there have been any edits it quickly becomes quite
confusing as to which file one should save. Gedit should (a) not allow
multiple copies of a file to be opened, and (b) should warn you before
you start editing a file that has a more recent 'last modified' date
than the date when the open file was originally opened. The Kate editor
provides this functionality, as do a number of other editors. I believe
that both of these issues were already described in Gedit bugs and on
the mailing list, but I wanted to just mention them again in the context
of a real use case.

When using cscope like this, one is often searching for instances of a
particular token in a C-file. You'll often see the same token several
times in one file, and if you want to quickly see the context in the
C-code, gedit doesn't flip you around the different spots but instead
opens the file multiple times at different lines.

To summarise, here is my desired usage of gedit with cscope:

1. open terminal window, 'cd' to directory containing code, 'cscope -qR'.
2. enter search terms, view a list of files and lines within them that
contain my search term
3. hit 'enter' to open the first match
4. gedit opens and shows the line in question. I make some minor changes
but don't yet save, and don't close gedit.
5. return to cscope window and select the next match (in the same file),
hit 'enter' to open.
6. gedit window raises and scrolls the already-open document to the new
matching line. I make no changes at this stage, and hit 'save'.
7. return to cscope window and select the next match (a different file),
hit enter to open.
8. again the gedit window pops up and shows the new file in a different
tab. I close gedit without making and changes.
9. and so on.

I appreciate the 'cscope' is an old tool and there are probably more
modern ones out there. I know there is the 'ctags' tool for newer gedit
versions. But this use case represents a fairly standard one; I am sure
other would like to use gedit in this way.

Cheers
JP

-- 
John Pye
School of Mechanical and Manufacturing Engineering
The University of New South Wales
Sydney  NSW 2052  Australia
t +61 2 9385 5127
f +61 2 9663 1222
mailto:john.pye_AT_student_DOT_unsw.edu.au
http://pye.dyndns.org/




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