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 #11 received at 31289 <at> debbugs.gnu.org (full text, mbox):

From: Oscar Blanco <orblancog <at> gmail.com>
To: npostavs <at> gmail.com
Cc: 31289 <at> debbugs.gnu.org
Subject: Re: bug#31289: madx mode for emacs
Date: Fri, 5 Oct 2018 08:52:22 +0200
[Message part 1 (text/plain, inline)]
Hello,

I attached again the script with the corresponding modifications. I
understand that an additional script called madx-autoloads.el is required.

Best regards,

o

Il giorno ven 22 giu 2018 alle ore 02:50 Noam Postavsky <npostavs <at> gmail.com>
ha scritto:

> Oscar Blanco <orblancog <at> gmail.com> writes:
>
> > Dear emacs group,
> >
> > I attach a script that I would like you to consider for the ELPA
> > repository.
> > This script defines the mad-x mode that highlights buffers with the
> > "Methodical Accelerator Design" syntax, by default loaded if the file
> name
> > ends it ".madx".
>
> > ;;; madx.el --- Major mode for editing MAD-X files in Emacs
> >
> > ;; Copyright (C) 2013, 2016 Oscar BLANCO
> > ;;               2017, 2018 Oscar BLANCO, Istituto Nazionale di Fisica
> Nucleare
>
> > ;; Licensed under the EUPL, Version 1.1
>
> This would have to be changed.  I believe GNU ELPA packages must have
> copyright assigned to the FSF and be under GPLv3+.
>
> > ;(add-to-list 'auto-mode-alist '("\\.madx\\'" . madx-mode))
>
> This should be uncommented and ;;;###autoloaded I guess.
>
> > (defconst madx-font-lock-warning-face-all
> >   ;; madx-font-lock-keywords-errordef
> >   (list
> >    '("\\<\\(E\\(?:ALIGN\\|FCOMP\\|RROR\\)\\|SETERR\\)\\>"
> >      . font-lock-warning-face))
> >   "Highlighting expressions for MAD-X mode (warning-all).")
>
> It looks like this regexp and several others are the result of
> regexp-opt; it's better to have the original expression in the source,
> e.g.,
>
> `((,(regexp-opt '("EALIGN" "EFCOMP" "ERROR" "SETERR") 'words) .
> font-lock-builtin-face))
>
>
> > ;;;###autoload
> > (defun madx-mode ()
> >   "Major mode for editing MAD-X script files."
> >   (interactive)
> >   (kill-all-local-variables)
> >   (setq mode-name "MAD-X")
> >   (setq major-mode 'madx-mode)
>
> I think if you use `define-derived-mode', it would reduce the need for
> some of the boilerplate.
>
> >   ;; Set up search
> >   (add-hook 'madx-mode-hook
> >      (lambda ()  (setq case-fold-search t)))
> >   (run-hooks 'madx-mode-hook))
>
> Why not just plain (setq case-fold-search t) here?
>


-- 
Oscar BLANCO
[Message part 2 (text/html, inline)]
[madx.el (text/x-emacs-lisp, attachment)]
[madx-autoloads.el (text/x-emacs-lisp, attachment)]

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

Previous Next


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