Subject: Re: bug#31289: madx mode for emacs

From: Noam Postavsky <[email-masked]>
Date: Thu, 25 Oct 2018 19:18:18 -0400

> the copyright assignment that I signed in February.

Hmm, something has gone wrong then, I don't see it listed.  Eli, what's
the procedure for resolving this?

> ;;;###autoload
> (define-derived-mode madx-mode fundamental-mode "madx"
>   "Major mode for editing Methodical Accelerator Design X script files."
>   (make-local-variable 'font-lock-defaults)
>   (setq font-lock-defaults '(madx-font-lock-keywords nil t))

The make-local-variable isn't needed since font-lock-defaults
"Automatically becomes buffer-local when set".

> ;; Enable syntax highlighting
> ;;;###autoload
> (global-font-lock-mode t)
> ;;;###autoload
> (setq font-lock-maximum-decoration t)

These shouldn't go in a library file, they're user preferences (and
already the default anyway).

> ;; Highlighting .madx and .seq buffers
> ;;;###autoload
> (setq auto-mode-alist (append '(("\\.\\(\\(madx\\)\\|\\(seq\\)\\)$" . madx-mode))			      
> 			      auto-mode-alist))

It's better to use add-to-list here, so that loading the file multiple
times won't keep adding entries to auto-mode-alist.  Also, the regex has
some redundant grouping and you should use \\' (end of string) rather
than $ (end of line).

    (add-to-list 'auto-mode-alist '("\\.\\(madx\\|seq\\)\\'" . madx-mode))