#24 always accept relative tags specs

closed-duplicate
nobody
None
5
2001-08-25
2001-08-16
No

Pre-Note:
This patch is an adaption to the current CVS version
of a patch I sent originally to nedit-develop a short
time before the 5.1.0 release came out. (When nedit
wasn't yet hosted on SF)
The patch seems to be forgotten, so that's a retry.

Additional functionality:

For every new loaded file (in the same NEdit session):
Check if a relative tags file is specified and exists
according to the opened files path. If so, it's load.
(By now all tag specs are only evaluated once
on session start, relative tag specs are evaluated
only according to the first load file's path (or cwd)).

Fixed bug:
simple cutting of "../" and "//" (sic! - this
distorts the filename) in tags file path removed.

Using of NormalizePathname and CompressPathname
found in util/fileUtils.c and have been made global
for that reason. These function really work as probably
intended by the former cutting of "../" and "//".

A more verbose description is appended below (from
original patch descr.)

Is there a chance to get this into 5.2??

Regards,

Markus Schwarzenberg

-------------------------------------------------

Changed Behavior Description (taken from original
patch description)

By now tags files, which are specified with a relative
path in the X-Ressource `nedit.tagFile:' were evaluated
and loaded only once when NEdit was startet, according
to the absolute startup path.

The modified version of tags.c checks for every new
loaded file (in the same NEdit session) if a relative
tags file exists according to the opened files path.
If so, it's loaded.

Here an example:
- Value of nedit.tagFile: ./tags
- The following files exist:
$HOME/project1/main.c
$HOME/project1/tags
$HOME/project2/main.c
$HOME/project2/tags

In the original version the following happenes:
- NEdit startet whith PWD=$HOME
--> No tags file is loaded

- opening $HOME/project1/main.c
--> $HOME/project1/tags is NOT loaded

- opening $HOME/project2/main.c
--> $HOME/project2/tags is NOT loaded

- NEdit startet whith PWD=$HOME/project1
--> $HOME/project1/tags IS loaded

- opening $HOME/project1/main.c
... have tag definitions from $HOME/project1/tags

- opening $HOME/project2/main.c
--> $HOME/project2/tags is NOT loaded
... have tag definitions from $HOME/project1/tags

With the modification it works like this:
- NEdit startet whith PWD=$HOME
--> No tags file is loaded

- opening $HOME/project1/main.c
--> $HOME/project1/tags IS loaded
... have tag definitions from $HOME/project1/tags

- opening $HOME/project2/main.c
--> $HOME/project2/tags IS loaded
... have tag definitions from $HOME/project1/tags
and $HOME/project2/tags

- NEdit startet whith PWD=$HOME/project1
--> $HOME/project1/tags IS loaded

- opening $HOME/project1/main.c
... have tag definitions from $HOME/project1/tags

- opening $HOME/project2/main.c
--> $HOME/project2/tags IS loaded
... have tag definitions from $HOME/project1/tags
and $HOME/project2/tags

Discussion

  •  
    Attachments
  • Alexander Mai
    Alexander Mai
    2001-08-25

    • status: open --> closed-duplicate
     
  • Alexander Mai
    Alexander Mai
    2001-08-25

    Logged In: YES
    user_id=15180

    To keep things simple, I'll close this and
    we discuss this issue only on
    SF [ #451997 ] bugs in
    tags.c/normalizePathname