all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Tagging Fortran variables
@ 2024-08-05 22:25 Christopher Howard
  2024-08-06  6:26 ` Marcus Harnisch
  2024-08-07  2:38 ` Joel Reicher
  0 siblings, 2 replies; 8+ messages in thread
From: Christopher Howard @ 2024-08-05 22:25 UTC (permalink / raw)
  To: Help Gnu Emacs Mailing List

Hi, part of my work is researches/troubleshooting in a big collection of old Fortran code files. I want to be able to use the xref tools to help me. However, it seems that etags does not tag Fortran variables, which 99% of the time is what I am interested in. It looks like there is a way to tag anything you want using regexps, so I was looking at the fortran.el code to see if maybe I could find the magic regexp for this. But there is a lot going on here in fortran.el that I don't understand yet and I am wondering if somebody might be able to help me figure this out.

-- 
📛 Christopher Howard
🚀 gemini://gem.librehacker.com
🌐 http://gem.librehacker.com

בראשית ברא אלהים את השמים ואת הארץ



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Tagging Fortran variables
  2024-08-05 22:25 Tagging Fortran variables Christopher Howard
@ 2024-08-06  6:26 ` Marcus Harnisch
  2024-08-07  2:38 ` Joel Reicher
  1 sibling, 0 replies; 8+ messages in thread
From: Marcus Harnisch @ 2024-08-06  6:26 UTC (permalink / raw)
  To: help-gnu-emacs

On 06/08/2024 00.25, Christopher Howard wrote:
> Hi, part of my work is researches/troubleshooting in a big collection of old Fortran code files. I want to be able to use the xref tools to help me. However, it seems that etags does not tag Fortran variables, which 99% of the time is what I am interested in. It looks like there is a way to tag anything you want using regexps, so I was looking at the fortran.el code to see if maybe I could find the magic regexp for this. But there is a lot going on here in fortran.el that I don't understand yet and I am wondering if somebody might be able to help me figure this out.

You may want to try Global (https://www.gnu.org/software/global/)
This in turn depends on Universal Ctags (https://ctags.io/),
and Pygments (https://pygments.org/)

On the Emacs side, I am using ggtags 
(http://elpa.gnu.org/packages/ggtags.html)

This combination served me well in many projects.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Tagging Fortran variables
@ 2024-08-06 16:31 Christopher Howard
  2024-08-06 20:19 ` Marcus Harnisch
  0 siblings, 1 reply; 8+ messages in thread
From: Christopher Howard @ 2024-08-06 16:31 UTC (permalink / raw)
  To: Marcus Harnisch; +Cc: help-gnu-emacs

Do you know if Gnu Global tags variables as well? In the online documentation I'm only seeing functions, macros, structs, and classes mentioned, though I suppose it varies from language to language.

-- 
Christopher Howard



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Tagging Fortran variables
  2024-08-06 16:31 Christopher Howard
@ 2024-08-06 20:19 ` Marcus Harnisch
  0 siblings, 0 replies; 8+ messages in thread
From: Marcus Harnisch @ 2024-08-06 20:19 UTC (permalink / raw)
  To: help-gnu-emacs

On 06/08/2024 18.31, Christopher Howard wrote:
> Do you know if Gnu Global tags variables as well? In the online documentation I'm only seeing functions, macros, structs, and classes mentioned, though I suppose it varies from language to language.
> 

Global comes with a few built-in parsers (no Fortran it seems). In any 
case I'd recommend to take advantage of delegating to ctags/Pygments, 
whose parsers are most likely more up-to-date. It looks like ctags' 
Fortran parser defines a tag type for variables. Give it a try.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Tagging Fortran variables
  2024-08-05 22:25 Tagging Fortran variables Christopher Howard
  2024-08-06  6:26 ` Marcus Harnisch
@ 2024-08-07  2:38 ` Joel Reicher
  1 sibling, 0 replies; 8+ messages in thread
From: Joel Reicher @ 2024-08-07  2:38 UTC (permalink / raw)
  To: Christopher Howard; +Cc: Help Gnu Emacs Mailing List

Christopher Howard <christopher@librehacker.com> writes:

> Hi, part of my work is researches/troubleshooting in a big 
> collection of old Fortran code files. I want to be able to use 
> the xref tools to help me. However, it seems that etags does not 
> tag Fortran variables, which 99% of the time is what I am 
> interested in. It looks like there is a way to tag anything you 
> want using regexps, so I was looking at the fortran.el code to 
> see if maybe I could find the magic regexp for this. But there 
> is a lot going on here in fortran.el that I don't understand yet 
> and I am wondering if somebody might be able to help me figure 
> this out.

Have you tried using xref in eglot? It will attempt to use the 
fortls fortran language server.

(I haven't tried this myself, but I've had good experiences with 
eglot and language servers in general.)

Cheers,

        - Joel



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Tagging Fortran variables
@ 2024-08-07 17:31 Christopher Howard
  0 siblings, 0 replies; 8+ messages in thread
From: Christopher Howard @ 2024-08-07 17:31 UTC (permalink / raw)
  To: Joel Reicher; +Cc: Help Gnu Emacs Mailing List

> Have you tried using xref in eglot? It will attempt to use the fortls
> fortran language server.

I'm not familiar with eglot, but I see there is a package for it in Guix, so I could look into that. It does not appear that there is yet a package for fortls, but presumably I can get it installed through pip, which I see is already installed on my system.

-- 
Christopher Howard



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Tagging Fortran variables
@ 2024-08-07 17:41 Christopher Howard
  2024-08-08  7:05 ` Joel Reicher
  0 siblings, 1 reply; 8+ messages in thread
From: Christopher Howard @ 2024-08-07 17:41 UTC (permalink / raw)
  To: Joel Reicher; +Cc: Help Gnu Emacs Mailing List

Eglot already part of Emacs, it appears...? I see an info manual already installed so I will read through that.

-- 
Christopher Howard



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Tagging Fortran variables
  2024-08-07 17:41 Christopher Howard
@ 2024-08-08  7:05 ` Joel Reicher
  0 siblings, 0 replies; 8+ messages in thread
From: Joel Reicher @ 2024-08-08  7:05 UTC (permalink / raw)
  To: Christopher Howard; +Cc: Help Gnu Emacs Mailing List

Christopher Howard <christopher@librehacker.com> writes:

> Eglot already part of Emacs, it appears...? I see an info manual 
> already installed so I will read through that.

I strongly recommend it. If fortls is good, the results in Emacs 
will be outstanding, because eglot - roughly speaking - provides a 
new backend to existing Emacs frontends, and so it's a switch with 
a seamlessness I haven't seen very often in any software.

One gotcha though (in my opinion!) is the 
":documentOnTypeFormattingProvider" server capability; you may 
want to disable that (by adding it to 
"eglot-ignored-server-capabilities") if you have a non-LSP based 
solution you prefer (such as treesitter).

Cheers,

        - Joel



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-08-08  7:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-05 22:25 Tagging Fortran variables Christopher Howard
2024-08-06  6:26 ` Marcus Harnisch
2024-08-07  2:38 ` Joel Reicher
  -- strict thread matches above, loose matches on Subject: below --
2024-08-06 16:31 Christopher Howard
2024-08-06 20:19 ` Marcus Harnisch
2024-08-07 17:31 Christopher Howard
2024-08-07 17:41 Christopher Howard
2024-08-08  7:05 ` Joel Reicher

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.