unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* f90.el matching END statements
@ 2019-11-28 11:39 Salvatore Filippone
  2019-11-29 11:46 ` Stefan Kangas
  0 siblings, 1 reply; 2+ messages in thread
From: Salvatore Filippone @ 2019-11-28 11:39 UTC (permalink / raw)
  To: help-gnu-emacs

Dear All,
I have recently run into an issue with f90.el, version 26.2
distributed with fedora 30.
The issue is with the autocompletion feature; Fortran 2008 has
introduced submodules; among the changes entailed by this, it is now
possible to have a piece of code like the following:
--------------------
  interface
    module subroutine foo(bar)
      integer  :: bar
    end subroutine foo
  end interface
---------------------
Now, if I hit TAB on the first "end" the autocompletion feature tries to insert
   end module subroutine
which is wrong, whereas I would like to insert
   end subroutine foo

I have found a fix for this. I changed file f90.el:1385-1386  from
-------------
   ((and (not (looking-at "module[ \t]*procedure\\_>"))
         (looking-at "\\(module\\)[ \t]+\\(\\(?:\\sw\\|\\s_\\)+\\)\\_>"))
--------------
to
--------------
   ((and (not (or
           (looking-at "module[ \t]*procedure\\_>")
           (looking-at "module[ \t]*subroutine\\_>")))
         (looking-at "\\(module\\)[ \t]+\\(\\(?:\\sw\\|\\s_\\)+\\)\\_>"))
---------------
and I got the desired behaviour.
It is quite possible that somebody on this list will have a better
solution, but this does the job.

Hope this helps
Salvatore Filippone



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

* Re: f90.el matching END statements
  2019-11-28 11:39 f90.el matching END statements Salvatore Filippone
@ 2019-11-29 11:46 ` Stefan Kangas
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Kangas @ 2019-11-29 11:46 UTC (permalink / raw)
  To: Salvatore Filippone; +Cc: help-gnu-emacs

Salvatore Filippone <filippone.salvatore@gmail.com> writes:

> I have recently run into an issue with f90.el, version 26.2
> distributed with fedora 30.
> The issue is with the autocompletion feature; Fortran 2008 has
> introduced submodules; among the changes entailed by this, it is now
> possible to have a piece of code like the following:

I suggest that you file a bug report for this, to ensure that it
eventually gets followed up.  You can use M-x report-emacs-bug or send
an e-mail to bug-gnu-emacs@gnu.org with the same contents as your
message to this list.

> I have found a fix for this. I changed file f90.el:1385-1386  from
> -------------
>    ((and (not (looking-at "module[ \t]*procedure\\_>"))
>          (looking-at "\\(module\\)[ \t]+\\(\\(?:\\sw\\|\\s_\\)+\\)\\_>"))
> --------------
> to
> --------------
>    ((and (not (or
>            (looking-at "module[ \t]*procedure\\_>")
>            (looking-at "module[ \t]*subroutine\\_>")))
>          (looking-at "\\(module\\)[ \t]+\\(\\(?:\\sw\\|\\s_\\)+\\)\\_>"))
> ---------------

If you could include this as a patch file attached to your e-mail,
that would be helpful.  If you don't know how to do that, the above
code fragment is also fine.

Best regards,
Stefan Kangas



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

end of thread, other threads:[~2019-11-29 11:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-28 11:39 f90.el matching END statements Salvatore Filippone
2019-11-29 11:46 ` Stefan Kangas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).