unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Imenu for cobol-mode
@ 2017-03-03 18:24 Joakim Jalap
  2017-03-05 20:13 ` Edward Hart
  0 siblings, 1 reply; 11+ messages in thread
From: Joakim Jalap @ 2017-03-03 18:24 UTC (permalink / raw)
  To: emacs-devel; +Cc: Edward Hart

[-- Attachment #1: Type: text/plain, Size: 1258 bytes --]

Hello Emacs Devs and Edward!

Here is my attempt at adding imenu functionality to cobol-mode.

I have tried it on a bunch of programs from the gnu cobol contrib repo, and IMHO
it seems to work pretty well :)

I've noticed one false positive; in the case of a procedure division header
which looks like this:

procedure division chaining input-file-name output-file-name
    change.

"change" will wrongly be recognized as a paragraph (is that what it is called?),
ie a function. I guess that could be worked around by making the regexp I use to
search for the procedure division match everything including the ending "."...
Well, that's for another day. I've also only tried this on complete programs, so
I'm not exactly sure how it reacts to a half finished buffer, but I think it
should be allright.

I would be glad if somebody who is a cobol programmer could give it a try and
provide some feedback (I know only of one cobol programmer who uses Emacs so I
cc:d him :))

To try it, eval the attached file (you must load cobol-mode first), visit a
buffer in cobol mode and eval:
(progn
 (setq-local imenu-create-index-function 'cobol--imenu-create-index)
 (imenu-add-to-menubar "Imenu"))

then browse away.

Looking forward to your feedback :)

-- Joakim


[-- Attachment #2: cobol-mode-imenu --]
[-- Type: application/emacs-lisp, Size: 6082 bytes --]

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

end of thread, other threads:[~2017-03-26 17:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-03 18:24 Imenu for cobol-mode Joakim Jalap
2017-03-05 20:13 ` Edward Hart
2017-03-06  8:58   ` Joakim Jalap
2017-03-06 23:27     ` Edward Hart
2017-03-07 20:18   ` Joakim Jalap
2017-03-15 19:35     ` Joakim Jalap
2017-03-15 21:14       ` Edward Hart
2017-03-16  7:56         ` Joakim Jalap
2017-03-16 12:28           ` Noam Postavsky
2017-03-17 22:47         ` Joakim Jalap
2017-03-26 17:27           ` Joakim Jalap

Code repositories for project(s) associated with this public inbox

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

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).