GNU bug report logs - #31289
madx mode for emacs

Previous Next

Package: emacs;

Reported by: Oscar Blanco <orblancog <at> gmail.com>

Date: Fri, 27 Apr 2018 15:20:01 UTC

Severity: wishlist

Tags: patch

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 31289 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: 31289 <at> debbugs.gnu.org
Cc: Oscar Blanco <orblancog <at> gmail.com>
Subject: Re: bug#31289: madx mode for emacs
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))




This bug report was last modified 5 years and 186 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.