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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31289 in the body.
You can then email your comments to 31289 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#31289; Package emacs. (Fri, 27 Apr 2018 15:20:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Oscar Blanco <orblancog <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 27 Apr 2018 15:20:02 GMT) Full text and rfc822 format available.

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

From: Oscar Blanco <orblancog <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: madx mode for emacs
Date: Fri, 27 Apr 2018 13:00:11 +0200
[Message part 1 (text/plain, inline)]
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".

Best regards,

o

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

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31289; Package emacs. (Fri, 22 Jun 2018 00:52:02 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> gmail.com>
To: Oscar Blanco <orblancog <at> gmail.com>
Cc: 31289 <at> debbugs.gnu.org
Subject: Re: bug#31289: madx mode for emacs
Date: Thu, 21 Jun 2018 20:50:52 -0400
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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31289; Package emacs. (Fri, 05 Oct 2018 06:53:02 GMT) Full text and rfc822 format available.

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

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31289; Package emacs. (Wed, 24 Oct 2018 22:32:02 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> gmail.com>
To: Oscar Blanco <orblancog <at> gmail.com>
Cc: 31289 <at> debbugs.gnu.org
Subject: Re: bug#31289: madx mode for emacs
Date: Wed, 24 Oct 2018 18:30:56 -0400
Oscar Blanco <orblancog <at> gmail.com> writes:

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

The madx-autoloads.el will be generated when installing the package from
forms that are prefix with

    ;;;###autoload

See `(elisp) Autoload'.  You can test it out using M-x package-install-file. 

> ;;; madx.el --- Major mode for editing MAD-X files in Emacs

> ;; Copyright (C) 2013, 2016 Oscar BLANCO
> ;;               2017, 2018 FSF

You don't seem to be listed in copyright assignment file; to officially
assign copyright to the FSF you need to sign some legal papers.
Instructions to begin the process are at
https://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/Copyright/request-assign.future

> (defconst madx-font-lock-keywords-face-all
>   ;; madx-font-lock-keywords-programflow
>   `((,(regexp-opt '(;; font-lock-keyword-face
> 		    ;; madx-font-lock-keywords-programflow
> 		   "IF"
> 		   "ELSEIF"
> 		   "ELSE"
> 		   "WHILE"
> 		   "MACRO"
> 		   ) 'words)

I would prefer the close paren grouped with the sexp it closes, as in

    `((,(regexp-opt '(;; font-lock-keyword-face
                      ;; madx-font-lock-keywords-programflow
                      "IF"
                      "ELSEIF"
                      "ELSE"
                      "WHILE"
                      "MACRO")
                    'words)
       .  font-lock-keyword-face))

> 	      ;; some variables already optimized
> 	      "\\|RE[1-6][1-6]"
> 	      "\\|T[1-6][1-6][1-6]"
> 	      "\\|TM[1-6][1-6][1-6]"

These two could be written as just "\\|TM?[1-6][1-6][1-6]"

> 	      "\\||BETA[1-3][1-3]"
> 	      "\\|BETA[1-3][1-3]P"

I guess that extra "|" is a typo; again you could coalesce these into
"\\|BETA[1-3][1-3]P?", similar for the following ones.

> 	      "\\|ALFA[1-3][1-3]"
> 	      "\\|ALFA[1-3][1-3]P"
> 	      "\\|GAMA[1-3][1-3]"
> 	      "\\|GAMA[1-3][1-3]P"
> 	      "\\|GAMA[1-3][1-3]"
> 	      "\\|DISP[1-4]P[1-3]"
> 	      "\\|EIGN[1-6][1-6]"
> 	      "\\|R[1-6][1-6]"
> 	      "\\|RM[1-6][1-6]")
>      . font-lock-variable-name-face))
>   "Highlighting expressions for MAD-X mode (variable-name-all).")

> (define-derived-mode madx-mode fundamental-mode "madx"
>   "Major mode for editing Methodical Accelerator Design X script files."
>   (kill-all-local-variables)
>   ;;  (use-local-map madx-mode-map)
>   (set-syntax-table madx-mode-syntax-table)

define-derived-mode already does kill-all-local-variables,
use-local-map, and set-syntax-table, so you don't need to put them here.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31289; Package emacs. (Thu, 25 Oct 2018 22:57:01 GMT) Full text and rfc822 format available.

Message #17 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 18:56:14 -0400
[Message part 1 (text/plain, inline)]
[forwarding to list, minus copyright assignment; no need to publish that]

[Message part 2 (message/rfc822, inline)]
From: Oscar Blanco <orblancog <at> gmail.com>
To: Noam Postavsky <npostavs <at> gmail.com>
Subject: Re: bug#31289: madx mode for emacs
Date: Thu, 25 Oct 2018 17:35:14 +0200
[Message part 3 (text/plain, inline)]
Hello,

I have made the modifications to madx.el, and I am attaching the copyright
assignment that I signed in February.

o

Il giorno gio 25 ott 2018 alle ore 00:30 Noam Postavsky <npostavs <at> gmail.com>
ha scritto:

> Oscar Blanco <orblancog <at> gmail.com> writes:
>
> > I attached again the script with the corresponding modifications. I
> > understand that an additional script called madx-autoloads.el is
> required.
>
> The madx-autoloads.el will be generated when installing the package from
> forms that are prefix with
>
>     ;;;###autoload
>
> See `(elisp) Autoload'.  You can test it out using M-x
> package-install-file.
>
> > ;;; madx.el --- Major mode for editing MAD-X files in Emacs
>
> > ;; Copyright (C) 2013, 2016 Oscar BLANCO
> > ;;               2017, 2018 FSF
>
> You don't seem to be listed in copyright assignment file; to officially
> assign copyright to the FSF you need to sign some legal papers.
> Instructions to begin the process are at
>
> https://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/Copyright/request-assign.future
>
> > (defconst madx-font-lock-keywords-face-all
> >   ;; madx-font-lock-keywords-programflow
> >   `((,(regexp-opt '(;; font-lock-keyword-face
> >                   ;; madx-font-lock-keywords-programflow
> >                  "IF"
> >                  "ELSEIF"
> >                  "ELSE"
> >                  "WHILE"
> >                  "MACRO"
> >                  ) 'words)
>
> I would prefer the close paren grouped with the sexp it closes, as in
>
>     `((,(regexp-opt '(;; font-lock-keyword-face
>                       ;; madx-font-lock-keywords-programflow
>                       "IF"
>                       "ELSEIF"
>                       "ELSE"
>                       "WHILE"
>                       "MACRO")
>                     'words)
>        .  font-lock-keyword-face))
>
> >             ;; some variables already optimized
> >             "\\|RE[1-6][1-6]"
> >             "\\|T[1-6][1-6][1-6]"
> >             "\\|TM[1-6][1-6][1-6]"
>
> These two could be written as just "\\|TM?[1-6][1-6][1-6]"
>
> >             "\\||BETA[1-3][1-3]"
> >             "\\|BETA[1-3][1-3]P"
>
> I guess that extra "|" is a typo; again you could coalesce these into
> "\\|BETA[1-3][1-3]P?", similar for the following ones.
>
> >             "\\|ALFA[1-3][1-3]"
> >             "\\|ALFA[1-3][1-3]P"
> >             "\\|GAMA[1-3][1-3]"
> >             "\\|GAMA[1-3][1-3]P"
> >             "\\|GAMA[1-3][1-3]"
> >             "\\|DISP[1-4]P[1-3]"
> >             "\\|EIGN[1-6][1-6]"
> >             "\\|R[1-6][1-6]"
> >             "\\|RM[1-6][1-6]")
> >      . font-lock-variable-name-face))
> >   "Highlighting expressions for MAD-X mode (variable-name-all).")
>
> > (define-derived-mode madx-mode fundamental-mode "madx"
> >   "Major mode for editing Methodical Accelerator Design X script files."
> >   (kill-all-local-variables)
> >   ;;  (use-local-map madx-mode-map)
> >   (set-syntax-table madx-mode-syntax-table)
>
> define-derived-mode already does kill-all-local-variables,
> use-local-map, and set-syntax-table, so you don't need to put them here.
>


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

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31289; Package emacs. (Thu, 25 Oct 2018 23:19:02 GMT) Full text and rfc822 format available.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31289; Package emacs. (Fri, 26 Oct 2018 06:43:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 31289 <at> debbugs.gnu.org, orblancog <at> gmail.com
Subject: Re: bug#31289: madx mode for emacs
Date: Fri, 26 Oct 2018 09:42:04 +0300
> From: Noam Postavsky <npostavs <at> gmail.com>
> Date: Thu, 25 Oct 2018 19:18:18 -0400
> Cc: Oscar Blanco <orblancog <at> gmail.com>
> 
> > the copyright assignment that I signed in February.
> 
> Hmm, something has gone wrong then, I don't see it listed.

Indeed.

> Eli, what's the procedure for resolving this?

Ping the FSF clerk.

However, Oscar's assignment process isn't complete yet: the last email
I have on that (from Feb 14) just says he was given the PDF form of
the assignment, which he needed to sign and send back to the FSF.  I
didn't see an announcement that the process is complete, which might
explain why his assignment is not yet on file.

Pinging the clerk is TRT anyway, since Feb 14 is too long ago to be
reasonable.  I'm guessing this fell through the cracks when the-then
copyright clerk stepped down.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31289; Package emacs. (Fri, 26 Oct 2018 10:42:01 GMT) Full text and rfc822 format available.

Message #26 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: Fri, 26 Oct 2018 06:41:24 -0400
[Message part 1 (text/plain, inline)]
[forwarding to list, please use "Reply All" to keep 31289 <at> debbugs.gnu.org on Cc]

[Message part 2 (message/rfc822, inline)]
From: Oscar Blanco <orblancog <at> gmail.com>
To: Noam Postavsky <npostavs <at> gmail.com>
Subject: Re: bug#31289: madx mode for emacs
Date: Fri, 26 Oct 2018 08:58:06 +0200
--=====-=-=
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=====-=-="

--======-=-=
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline

Dear Noam, I attached again the file madx.el.
With respect to the licence, I have to look back on my mails to check if I
have any other document apart from the one I sent yesterday.

Il giorno ven 26 ott 2018 alle ore 01:18 Noam Postavsky <npostavs <at> gmail.com>
ha scritto:

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


-- 
Oscar BLANCO

--======-=-=
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Dear Noam, I attached again the file madx.el.<div>With res=
pect to the licence, I have to look back on my mails to check if I have any=
 other document apart from the one I sent yesterday.</div></div><br><div cl=
ass=3D"gmail_quote"><div dir=3D"ltr">Il giorno ven 26 ott 2018 alle ore 01:=
18 Noam Postavsky &lt;<a href=3D"mailto:npostavs <at> gmail.com">npostavs <at> gmail.=
com</a>&gt; ha scritto:<br></div><blockquote class=3D"gmail_quote" style=3D=
"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">&gt; the co=
pyright assignment that I signed in February.<br>
<br>
Hmm, something has gone wrong then, I don&#39;t see it listed.=C2=A0 Eli, w=
hat&#39;s<br>
the procedure for resolving this?<br>
<br>
&gt; ;;;###autoload<br>
&gt; (define-derived-mode madx-mode fundamental-mode &quot;madx&quot;<br>
&gt;=C2=A0 =C2=A0&quot;Major mode for editing Methodical Accelerator Design=
 X script files.&quot;<br>
&gt;=C2=A0 =C2=A0(make-local-variable &#39;font-lock-defaults)<br>
&gt;=C2=A0 =C2=A0(setq font-lock-defaults &#39;(madx-font-lock-keywords nil=
 t))<br>
<br>
The make-local-variable isn&#39;t needed since font-lock-defaults<br>
&quot;Automatically becomes buffer-local when set&quot;.<br>
<br>
&gt; ;; Enable syntax highlighting<br>
&gt; ;;;###autoload<br>
&gt; (global-font-lock-mode t)<br>
&gt; ;;;###autoload<br>
&gt; (setq font-lock-maximum-decoration t)<br>
<br>
These shouldn&#39;t go in a library file, they&#39;re user preferences (and=
<br>
already the default anyway).<br>
<br>
&gt; ;; Highlighting .madx and .seq buffers<br>
&gt; ;;;###autoload<br>
&gt; (setq auto-mode-alist (append &#39;((&quot;\\.\\(\\(madx\\)\\|\\(seq\\=
)\\)$&quot; . madx-mode))=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<br>
&gt;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0auto-mode-alist))<br>
<br>
It&#39;s better to use add-to-list here, so that loading the file multiple<=
br>
times won&#39;t keep adding entries to auto-mode-alist.=C2=A0 Also, the reg=
ex has<br>
some redundant grouping and you should use \\&#39; (end of string) rather<b=
r>
than $ (end of line).<br>
<br>
=C2=A0 =C2=A0 (add-to-list &#39;auto-mode-alist &#39;(&quot;\\.\\(madx\\|se=
q\\)\\&#39;&quot; . madx-mode))<br>
</blockquote></div><br clear=3D"all"><div><br></div>-- <br><div dir=3D"ltr"=
 class=3D"gmail_signature" data-smartmail=3D"gmail_signature"><div dir=3D"l=
tr">Oscar BLANCO<div><br><br></div></div></div>

--======-=-=--

--=====-=-=
Content-Type: text/x-emacs-lisp; name=madx.el
Content-ID: <f_jnpnxkn50>
Content-Disposition: attachment; filename=madx.el

;;; madx.el --- Major mode for editing MAD-X files in Emacs

;; Copyright (C) 2013, 2016 Oscar BLANCO
;;               2017, 2018 FSF

;; Author     : orblancog <orblancog <at> gmail.com>
;; Maintainer : orblancog
;; Created    : 18 Nov 2017
;; Keywords   : languages
;; Homepage   : https://github.com/orblancog/mad-x_syntax
;; Version    : 1.8

;; This file is not part of GNU Emacs

;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program.  If not, see <https://www.gnu.org/licenses/>.

;;; Commentary:
;; FEATURES in version 1.8
;; * Highlights commands, parameters and special operators in MAD-X 5
;; * If the file extension is '.madx' or '.seq' then the buffer is automatically
;;   highlighted, but any buffer can be highlighted by doing :
;;       `M+X madx-mode` RET
;;   where `M` is the **META** character in Emacs (`M` seems to be **ALT** in Linux)
;;   and RET means press RETURN key
;; * If the limit of 80 characters is desired, they could be highlighted differently
;;   by uncomment the line
;;       ;(require 'whitespace)
;;       ;(setq whitespace-line-column 80) ;; limit line length
;;       ;(setq whitespace-style '(face lines-tail))
;;       ;(add-hook 'madx-mode-hook 'whitespace-mode)
;;   in this (madx.el) file.
;; HOW TO INSTALL IT
;; a) Open this file in emacs and execute
;;      `M+X package-install-file` RET `madx.el` RET
;; b)
;; 1. Copy this file (madx.el) to the highlighting definition folder, e.g.
;;      a)  ~/.emacs.d/lisp/  ---> (Emacs v24.5.X or v25)
;;      b)  ~/.emacs.d/       ---> (Emacs v23.X.X)
;;      c)  ~/                ---> (Emacs v21.X.X)
;;    i.e.
;;      $ cp madx.el ~/.emacs.d/lisp/
;; 2. Edit or create your .emacs file, typically in ~/
;;      adding the following block where the load-path must match point 1.
;;      ;;;; START OF BLOCK TO COPY AND UNCOMMENT
;;      (global-font-lock-mode t);; Enable syntax highlighting
;;      (setq font-lock-maximum-decoration t)
;;      (add-to-list 'load-path "~/.emacs.d");; <--- edit according to 1.
;;      (autoload 'madx-mode "madx" "MADX-mode" t)
;;      (setq auto-mode-alist (append '(("\\.\\(\\(madx\\)\\|\\(seq\\)\\)$" . madx-mode))
;;        auto-mode-alist))
;;      ;;;; END OF BLOCK TO COPY AND UNCOMMENT
;; You should now restart EMACS in order to reload the environment variables.
;; INFO
;; * For mad instructions, visit
;;   mad.web.cern.ch/mad/
;; * Other syntax highlightings could be found inside the
;;   mad sources.  Check the 'syntax' folder in the madx dir !
;;   Write me to the email address above about any bug including an example.

;;; History:
;; v 1.0 First release at CERN. File is also available in the
;;       MAD-X sources "syntax" folder.
;; v 1.1 Adding comments and changing some verbosed names
;; v 1.2 email update oscar.roberto.blanco.garcia <at> cern.ch deprecated
;;       Adding some variables from MAD-X 5.02.10 manual
;;       Cleaning up faces 8D
;;       when exceeding 80 chars->extra chars in red
;; v 1.3 adding color to numbers and ;
;; v 1.4 Changes to put this file in the emacs elpa repository
;;       Changing email address to orblancog <at> gmail.com
;; v 1.5 Changing licence
;; v 1.6 Adding automatic syntax highlighting for ".seq"
;; v 1.7 Chaging licence to gpl3 and code-checking following GNU ELPA suggestions
;; v 1.8 Code changes following GNU suggestions
;;       Adding comments about package-install-file

;;; Code:
(defgroup madx nil
  "Major mode to edit MAD-X files in emacs."
  :group 'languages)

(defvar madx-mode-hook nil
  "Hook for madx-model initialize nil.")

;;;; add  80 characters line
;;;; (global-whitespace-mode +1)
;(require 'whitespace)
;(setq whitespace-line-column 80) ;; limit line length
;(setq whitespace-style '(face lines-tail))
;(add-hook 'madx-mode-hook 'whitespace-mode)

(defconst madx-font-lock-keywords-face-all
  ;; madx-font-lock-keywords-programflow
  `((,(regexp-opt '(;; font-lock-keyword-face
		    ;; madx-font-lock-keywords-programflow
		   "IF"
		   "ELSEIF"
		   "ELSE"
		   "WHILE"
		   "MACRO"
		   )
		  'words)
     .  font-lock-keyword-face))
  "Highlighting expressions for MAD-X mode (keywords-all).")

(defconst madx-font-lock-builtin-face-all
  ;; madx-font-lock-keywords-tableaccs
  ;; madx-font-lock-keywords-simul
  ;; madx-font-lock-keywords-controlstm
  ;; madx-font-lock-keywords-filehandstm
  ;; madx-font-lock-keywords-tablehandstm
  ;; madx-font-lock-keywords-beamhandstm
  ;; madx-font-lock-keywords-seqediting
  ;; madx-font-lock-keywords-othrcmds
  ;; madx-font-lock-keywords-matchingmet
  ;; madx-font-lock-keywords-orbit_corr
  ;; madx-font-lock-keywords-plot
  ;; madx-font-lock-keywords-stringatt
  `((,(regexp-opt '(;; font-lock-builtin-face
		   ;;  madx-font-lock-keywords-tableaccs
		   "TABLE"
		   "TABINDEX"
		   "TABSTRING"
		   ;; madx-font-lock-keywords-simul
		   "TWISS"
		   "IBS"
		   "LINE"
		   "MAKETHIN"
		   "APERTURE"
		   "SIXTRACK"
		   "DYNAP"
		   "EMIT"
		   "MATCH"
		   "ENDMATCH"
		   "VARY"
		   "CONSTRAINT"
		   "WEIGHT"
		   "GLOBAL"
		   "GWEIGHT"
		   "PTC_TWISS"
		   "PTC_PRINTPARAMETRIC"
		   "PTC_NORMAL"
		   "SELECT_PTC_NORMAL"
		   "PTC_TRACK"
		   "PTC_TRACK_LINE"
		   "PTC_CREATE_UNIVERSE"
		   "PTC_CREATE_LAYOUT"
		   "PTC_READ_ERRORS"
		   "PTC_MOVE_TO_LAYOUT"
		   "PTC_ALIGN"
		   "PTC_END"
		   "PTC_TRACK_END"
		   "START"
		   "RUN"
		   "PTC_OBSERVE"
		   "OBSERVE"
		   "PTC_START"
		   "PTC_SETSWITCH"
		   "PTC_KNOB"
		   "PTC_SETKNOBVALUE"
		   "MATCH WITHPTCKNOBS"
		   "PTC_PRINTFRAMES"
		   "PTC_SELECT"
		   "PTC_SELECT_MOMENT"
		   "PTC_DUMPMAPS"
		   "PTC_EPLACEMENT"
		   "PTC_VARYKNOB"
		   "END_MATCH"
		   "PTC_MOMENTS"
		   "PTC_SETCAVITIES"
		   "PTC_SETDEBUGLEVEL"
		   "PTC_SETACCEL_METHOD"
		   "PTC_SETEXACTMIS"
		   "PTC_SETRADIATION"
		   "PTC_SETTOTALPATH"
		   "PTC_SETTIME"
		   "PTC_SETFRINGE"
		   ;; madx-font-lock-keywords-controlstm              
		   "EXIT"
		   "QUIT"
		   "STOP"
		   "HELP"
		   "SHOW"
		   "VALUE"
		   "OPTION"
		   "EXEC"
		   "SET"
		   "SYSTEM"
		   "TITLE"
		   "USE"
		   "SELECT"
		   ;;  madx-font-lock-keywords-filehandstm
		   "ASSIGN"
		   "CALL"
		   "RETURN"
		   "PRINT"
		   "PRINTF"
		   "RENAMEFILE"
		   "COPYFILE"
		   "REMOVEFILE"
		   ;;  madx-font-lock-keywords-tablehandstm
		   "CREATE"
		   "DELETE"
		   "READTABLE"
		   "READMYTABLE"
		   "WRITE"
		   "SETVARS"
		   "SETVARS_LIN"
		   "FILL"
		   "SHRINK"
		   ;;  madx-font-lock-keywords-beamhandstm
		   "BEAM"
		   "RESBEAM"
		   ;; madx-font-lock-keywords-seqediting
		   "SEQEDIT"
		   "FLATTEN"
		   "CYCLE"
		   "REFLECT"
		   "INSTALL"
		   "MOVE"
		   "REMOVE"
		   "REPLACE"
		   "EXTRACT"
		   "ENDEDIT"
		   "SAVE"        
		   "DUMPSEQU"
		   ;; madx-font-lock-keywords-othrcmds
		   "SAVEBETA"
		   "COGUESS"
		   "CONST"
		   "EOPTION"
		   "ESAVE"
		   "REAL"
		   ;; madx-font-lock-keywords-matchingmet
		   "LMDIF"
		   "MIGRAD"
		   "SIMPLEX"
		   "JACOBIAN"
		   "USE_MACRO"
		   ;; madx-font-lock-keywords-orbit_corr
		   "CORRECT"
		   "USEMONITOR"
		   "USEKICK"
		   "CSAVE"
		   "SETCORR"
		   "COPTION"
		   "SODD"
		   "SURVEY"
		   "SXFREAD"
		   "SXFWRITE"
		   "TOUSCHEK"
		   "TRACK"
		   "ENDTRACK"
		   ;; madx-font-lock-keywords-plot
		   "PLOT"
		   "RPLOT"
		   "RVIEWER"
		   "RTRACKSTORE"
		   "RESPLOT"
		   "SETPLOT"
		   "EPRINT"
		   ;; madx-font-lock-keywords-stringatt
		   "TITLE"
		   "system"
		   )
		  'words)
     . font-lock-builtin-face))
  "Highlighting expressions for MAD-X mode (builtin-all).")

(defconst madx-font-lock-type-face-all
  ;; madx-font-lock-keywords-elements
  `((,(regexp-opt '(; font-lock-type-face
		   ;; madx-font-lock-keywords-elements
		   "DRIFT"
		   "QUADRUPOLE"
		   "SEXTUPOLE"
		   "OCTUPOLE"
		   "SOLENOID"
		   "CRABCAVITY"
		   "RFCAVITY"
		   "DIPEDGE"
		   "MULTIPOLE"
		   "COLLIMATOR"
		   "ECOLLIMATOR"
		   "RCOLLIMATOR"
		   "YROTATION"
		   "SROTATION"
		   "TRANSLATION"
		   "CHANGEREF"
		   "MARKER"
		   "RBEND"
		   "SBEND"
		   "DIPEDGE"
		   "HKICKER"
		   "VKICKER"
		   "KICKER"
		   "TKICKER"
		   "ELSEPARATOR"
		   "HMONITOR"
		   "VMONITOR"
		   "MONITOR"
		   "INSTRUMENT"
		   "PLACEHOLDER"
		   "BEAMBEAM"
		   "MATRIX"
		   "NLLENS"
		   "RFMULTIPOLE"
		   "ELSEPARATOR"
		   )
		  'words)
     . font-lock-type-face))
  "Highlighting expressions for MAD-X mode (type-all).")

(defconst madx-font-lock-warning-face-all
  ;; madx-font-lock-keywords-errordef
  `((,(regexp-opt '(; font-lock-warning-face
		   ;; madx-font-lock-keywords-errordef
		   "ERROR"
		   "EALIGN"
		   "EFCOMP"
		   "SETERR"
		   )
		  'words)
     . font-lock-warning-face))
  "Highlighting expressions for MAD-X mode (warning-all).")

(defconst madx-font-lock-special_operators
  ;; madx-font-lock-special_operators
  `((,(regexp-opt '(; font-lock-warning-face
		   ;; madx-font-lock-special_operators
		   ":="
		   "->"
		   )
		  t)
     . font-lock-warning-face))
  "Highlighting expressions for MAD-X mode (special-operators).")

(defconst madx-font-lock-constant-face-all
  ;; madx-font-lock-keywords-constants
  `((,(regexp-opt '(; font-lock-constant-face
		   ;; madx-font-lock-keywords-constants
		   "POSITRON"
		   "ELECTRON"
		   "PROTON"
		   "ANTIPROTON"
		   "POSMUON"
		   "NEGMUON"
		   "ION"
		   "PI"
		   "TWOPI"
		   "DEGRAD"
		   "RADDEG"
		   "E"
		   "EMASS"
		   "PMASS"
		   "NMASS"
		   "MUMASS"
		   "CLIGHT"
		   "QELECT"
		   "HBAR"
		   "ERAD"
		   "PRAD"
		   "TRUE"
		   "FALSE"
		   "SIMPLE"
		   "COLLIM"
		   "TEAPOT"
		   "HYBRID"
		   "ENTRY"
		   "CENTRE"
		   "EXIT"
		   "CIRCLE"
		   "RECTANGLE"
		   "ELLIPSE"
		   "LHCSCREEN"
		   "MARGUERITE"
		   "RECTELLIPSE"
		   "RACETRACK"
		   "OCTAGON"
		   "TERMINAL"
		   )
		  'words)
     . font-lock-constant-face))
  "Highlighting expressions for MAD-X mode (constant-all).")

(defconst madx-font-lock-special_constants
  ;; madx-font-lock-special_constants
  `((,(regexp-opt '(; font-lock-constant-face
		   ;; madx-font-lock-special_constants
		   "#e"
		   "#s"
		   )
		  t)
     . font-lock-constant-face))
  "Highlighting expressions for MAD-X mode (special_constants).")

(defconst madx-font-lock-doc-face-all
  ;; madx-font-lock-keywords-parameters
  `((,(regexp-opt '(;; font-lock-doc-face
		   ;; madx-font-lock-keywords-parameters
		   "NOEXPR" ;2016.08
		   "KNLL" ;2016.08
		   "CNLL" ;2016.08
		   "ROOTMACRO"
		   "MOMENT_S"
		   "MOMENT"
		   "SURVEYALL"
		   "DELTA_DEPENDENCY"
		   "IGNORE_MAP_ORBIT"
		   "RING_PARAMETERS"
		   "CENTER_MAGNETS"
		   "SUMMARY_FILE"
		   "SUMMARY_TABLE"
		   "MAPTABLE"
		   "DELS"
		   "TXI"
		   "TYI"
		   "TLI"
		   "UPDATE"
		   "NCORR"
		   "SNGVAL"
		   "SNGCUT"
		   "CORRLIM"
		   "TWORING"
		   "UNITS"
		   "CORZERO"
		   "BEAM1TAB"
		   "BEAM2TAB"
		   "EXTERN"
		   "NAME_COL"
		   "X_COL"
		   "Y_COL"
		   "TWISSUM"
		   "LSQ"
		   "MICADO"
		   "SVD"
		   "THICK"
		   "VECTOR"
		   "expr"
		   "VLENGTH"
		   "SLOW"
		   "PATCH_ANG"
		   "PATCH_TRANS"
		   "ADD_ANGLE"
		   "ADD_PASS"
		   "NEXT_SEQU"
		   "ZERO_SUPPR"
		   "N_BESSEL"
		   "RIPKEN"
		   "NO_CAVITY_TOTALPATH"
		   "PNL"
		   "PSL"
		   "MAKEDIPEDGE"
		   "TRUNCATE"
		   "APPEND"
		   "ROW1"
		   "ROW1"
		   "PARAM"
		   "SINKICK"
		   "SINPEAK"
		   "SINTUNE"
		   "SINPHASE"
		   "L"
		   "K1"
		   "K1S"
		   "TILT"
		   "K2"
		   "K2S"
		   "K3"
		   "K3S"
		   "KS"
		   "K3S"
		   "KSI"
		   "VOLT"
		   "LAG"
		   "FREQ"
		   "HARMON"
		   "rv1"
		   "rv2"
		   "rv3"
		   "rv4"
		   "rph1"
		   "rph2"
		   "lagf"
		   "PARTICLE"
		   "MASS"
		   "CHARGE"
		   "ENERGY"
		   "PC"
		   "GAMMA"
		   "BETA"
		   "BRHO"
		   "EX"
		   "EXN"
		   "EY"
		   "EYN"
		   "ET"
		   "SIGT"
		   "SIGE"
		   "KBUNCH"
		   "NPART"
		   "PLANE"
		   "BCURRENT"
		   "CURRENT"
		   "BUNCHED"
		   "RADIATE"
		   "NORM_NO"
		   "BV"
		   "SEQUENCE"
		   "ENDSEQUENCE"
		   "REFER"
		   "MAD8"
		   "GNFU"
		   "KICK"
		   "HKICK"
		   "VKICK"
		   "ANGLE"
		   "K0"
		   "K0S"
		   "RESPLIT"
		   "DAMP"
		   "QUANTUM"
		   "RECLOSS"
		   "ELEMENT_BY_ELEMENT"
		   "NORM"
		   "NORM_OUT"
		   "RADIATION_MODEL1"
		   "RADIATION_ENERGY_LOSS"
		   "RADIATION_QUADr"
		   "BEAM_ENVELOPE"
		   "SPACE_CHARGE"
		   "FX"
		   "FY"
		   "FT"
		   "FFILE"
		   "E1"
		   "E2"
		   "FINT"
		   "FINTX"
		   "HGAP"
		   "H1"
		   "H2"
		   "FLAG"
		   "RANGE"
		   "PLACE"
		   "PARENT"
		   "KEYWORD"
		   "FROM"
		   "AT"
		   "REFPOS"
		   "LENGTH"
		   "EXACT_MIS"
		   "CLASS"
		   "PATTERN"
		   "FILE"
		   "FORMAT"
		   "RBARC"
		   "TWISS_PRINT"
		   "THREADER"
		   "THIN_FOC"
		   "NO_FATAL_STOP"
		   "TEXT"
		   "BARE"
		   "SLICE"
		   "THICK"
		   "COMMAND"
		   "TO"
		   "NEWNAME"
		   "BY"
		   "SELECTED"
		   "H"
		   "LRAD"
		   "KNL"
		   "KSL"
		   "TYPE"
		   "SIGX"
		   "SIGY"
		   "XMA"
		   "YMA"
		   "BBSHAPE"
		   "WIDTH"
		   "BBDIR"
		   "ECHO"
		   "ECHOMACRO"
		   "TRACE"
		   "VERIFY"
		   "PERIOD"
		   "SECTORMAP"
		   "SECTORFILE"
		   "KEEPORBIT"
		   "USEORBIT"
		   "COUPLE"
		   "FULL"
		   "COLUMN"
		   "MOMENTS"
		   "PARAMETRIC"
		   "CLEAR"
		   "POS"
		   "POLYNOMIAL"
		   "MONOMIAL"
		   "PARAMETRIC"
		   "QUANTITY"
		   "ROW"
		   "SEED"
		   "ADD"
		   "INFO"
		   "DEBUG"
		   "VERBOSE"
		   "TELL"
		   "RESET"
		   "WARN"
		   "LABEL"
		   "APERTYPE"
		   "HAXIS"
		   "HMIN"
		   "HMAX"
		   "VAXIS"
		   "VAXIS1"
		   "VAXIS2"
		   "VAXIS3"
		   "VAXIS4"
		   "VMIN"
		   "VMAX"
		   "BARS"
		   "SYMBOL"
		   "NOVERSION"
		   "NO_FATAL_ERROR"
		   "NO_FATAL_STOP"
		   "INTERPOLATE"
		   "NOLINE"
		   "NOTITLE"
		   "MARKER_PLOT"
		   "RANGE_PLOT"
		   "MULTIPLE"
		   "PTC"
		   "PTC_TABLE"
		   "TRACKFILE"
		   "CAVALL"
		   "MULT_AUTO_OFF"
		   "MAX_MULT_ORD"
		   "SPLIT"
		   "RADIUS"
		   "WARNING"
		   "STYLE"
		   "COLOUR"
		   "TURNS"
		   "EVERYSTEP"
		   "ONETABLE"
		   "TABLEALLSTEPS"
		   "GCS"
		   "ROOTNTUPLE"
		   "EXTENSION"
		   "FASTUNE"
		   "MAXAPER"
		   "LYAPUNOV"
		   "ORBIT"
		   "TOL"
		   "DS"
		   "DPHI"
		   "DTHETA"
		   "DPSI"
		   "MREX"
		   "MREY"
		   "MSCALX"
		   "MSCALY"
		   "AREX"
		   "AREY"
		   "ORDER"
		   "DKN"
		   "DKS"
		   "DKNR"
		   "DKSR"
		   "HYSTER"
		   "HCOEFFN"
		   "HCOEFFS"
		   "BETA0"
		   "RMATRIX"
		   "STEP"
		   "CHROM"
		   "LOWER"
		   "UPPER"
		   "SLOPE"
		   "OPT"
		   "CALLS"
		   "NO"
		   "XDISTR"
		   "YDISTR"
		   "ZDISTR"
		   "TOLERANCE"
		   "STRATEGY"
		   "REPEAT"
		   "BISEC"
		   "COOL"
		   "BALANCE"
		   "RANDOM"
		   "MODEL"
		   "TARGET"
		   "MODE"
		   "MONERROR"
		   "MONON"
		   "MONSCALE"
		   "PLANEX"
		   "COND"
		   "RESOUT"
		   "CLIST"
		   "MLIST"
		   "STATUS"
		   "POST"
		   "FONT"
		   "LWIDTH"
		   "APER_TOL"
		   "APER_OFFSET"
		   "HALOFILE"
		   "PIPEFILE"
		   "DQF"
		   "BETAQFX"
		   "DP"
		   "DPARX"
		   "DPARY"
		   "COR"
		   "BBEAT"
		   "NCO"
		   "HALO"
		   "INTERVAL"
		   "SPEC"
		   "NOTSIMPLE"
		   "TRUEPROFILE"
		   "OFFSETELEM"
		   "XSIZE"
		   "YSIZE"
		   "ASCALE"
		   "LSCALE"
		   "SSCALE"
		   "RSCALE"
		   "DETUNE"
		   "DISTORT1"
		   "DISTORT2"
		   "START_STOP"
		   "MULTIPOLE_ORDER_RANGE"
		   "NOPRINT"
		   "PRINT_ALL"
		   "PRINT_AT_END"
		   "NOSIXTRACK"
		   "X0"
		   "Y0"
		   "Z0"
		   "THETA0"
		   "PHI0"
		   "PSI0"
		   "SUMM"
		   "CENTRE"
		   "SECTOR_NMUL_MAX"
		   "SECTOR_nMUL"
		   "NTPSA"
		   "SYMPRINT"
		   "TIME"
		   "METHOD"
		   "NST"
		   "EXACT"
		   "OFFSET_DELTAP"
		   "ERRORS_OUT"
		   "ERRORS_IN"
		   "MAGNET_NAME"
		   "RESPLIT"
		   "THIN"
		   "XBEND"
		   "EVEN"
		   "OVERWRITE"
		   "INDEX"
		   "ONEPASS"
		   "DUMP"
		   "DEBUGLEVEL"
		   "LEVEL"
		   "BBORBIT"
		   "SYMPL"
		   "MAXACCELERATION"
		   "EXACT_MISS"
		   "TOTALPATH"
		   "RADIATION"
		   "FRINGE"
		   "ICASE"
		   "CLOSED_ORBIT"
		   "SLICE_MAGNETS"
		   "INITIAL_MATRIX_TABLE"
		   "MATRIX_MANUAL"
		   "INITIAL_MAP_MANUAL"
		   "INITIAL"
		   "ELEMENT"
		   "TRUSTRANGE"
		   "ANHX"
		   "ANHY"
		   "GNUF"
		   "HAML"
		   "EIGN"
		   "INITIAL_MATRIX_MANUAL"
		   "ELEMENTNAME"
		   "KN"
		   "KS"
		   "EXACTMATCH"
		   "ONLYPOSITION"
		   "ONLYORIENTATION"
		   "AUTOPLACEDOWNSTREAM"
		   "REFFRAME"
		   "USE_PTCKNOBS"
		   )
		  'words)
     . font-lock-doc-face))
  "Highlighting expressions for MAD-X mode (doc-all).")

(defconst madx-font-lock-function-name-face-all
  ;; madx-font-lock-keywords-functions
  `((,(regexp-opt '(;;  font-lock-function-name-face
		   ;; madx-font-lock-keywords-functions
		   "SQRT"
		   "LOG"
		   "LOG10"
		   "EXP"
		   "SIN"
		   "COS"
		   "TAN"
		   "ASIN"
		   "ACOS"
		   "ATAN"
		   "SINH"
		   "COSH"
		   "TANH"
		   "SINC"
		   "ABS"
		   "ERF"
		   "ERFC"
		   "FLOOR"
		   "CEIL"
		   "ROUND"
		   "RANF"
		   "GAUSS"
		   "TGAUSS"
		   "FLAT5"
		   "FLAT56"
		   )
		  'words)
     . font-lock-function-name-face))
  "Highlighting expressions for MAD-X mode (name-all)." )

(defconst madx-font-lock-variable-name-face-all
  ;; madx-font-lock-keywords-variables_madx
  `((,(concat (regexp-opt '(;; font-lock-variable-name-face
			    ;; madx-font-lock-keywords-variables_madx
			    "mvar1"
			    "mvar2"
			    "mvar3"
			    "mvar4"
			    "CIRC"
			    "FREQ0"
			    "DTBYDS"
			    "U0"
			    "QS"
			    "ARAD"
			    "PDAMP"
			    "N1MIN"
			    "Z"
			    "PHI"
			    "PSI"
			    "X"
			    "Y"
			    "BETX"
			    "BETY"
			    "NAME"
			    "S"
			    "k0l"
			    "k1l"
			    "k2l"
			    "k3l"
			    "k4l"
			    "K1"
			    "K2"
			    "K3"
			    "K4"
			    "K5"
			    "K6"
			    "K1L"
			    "K2L"
			    "K3L"
			    "K4L"
			    "K5L"
			    "K6L"       
			    "KICK1"
			    "KICK2"
			    "KICK3"
			    "KICK4"
			    "KICK5"
			    "KICK6"
			    "MU1"
			    "MU2"
			    "MU3"
			    "MUX"
			    "MUY"
			    "PX"
			    "PY"
			    "PT"
			    "DELTAP"
			    "XN"
			    "PXN"
			    "WX"
			    "PHI"
			    "THETA"
			    "PHIX"
			    "YN"
			    "PYN"
			    "WY"
			    "PHIY"
			    "TN"
			    "PTN"
			    "WT"
			    "PHIT"
			    "ALFX"
			    "DX"
			    "DPX"
			    "ALFY"
			    "DY"
			    "DPY"
			    "ENERGY"
			    "DMUX"
			    "DDX"
			    "DDPX"
			    "DMUY"
			    "DDY"
			    "DDPY"
			    "Q1"
			    "Q2"
			    "DQ1"
			    "DQ2"
			    "DDQ1"
			    "DDQ2"
			    "N1"
			    "N1X_M"
			    "N1Y_M"
			    "APER_1"
			    "APER_2"
			    "APER_3"
			    "APER_4"
			    "RTOL"
			    "XTOL"
			    "YTOL"
			    "ON_AP"
			    "ON_ELEM"
			    "LENGTH"
			    "ORBIT5"
			    "BETXMAX"
			    "DXMAX"
			    "DXRMS"
			    "XCOMAX"
			    "XRMS"
			    "BETYMAX"
			    "DYMAX"
			    "DYRMS"
			    "YCOMAX"
			    "YCORMS"
			    "SYNCH_1"
			    "SYNCH_2"
			    "SYNCH_3"
			    "SYNCH_4"
			    "SYNCH_5"
			    "DISTANCE"
			    "LYAPUNOV"
			    "LOGDIST"
			    "LOGTURNS"
			    "RE"
					;		    "RE11";REPLACE BY RE[1-6][1-6]
			    "T"
					;		    "T111";; REPLACE BY T[1-6][1-6][1-6]
					;		    "TM111";; REPLACE BY TM[1-6][1-6][1-6]
					;		    "BETA11"; REPLACE BY BETA[1-3][1-3]
					;		    "BETA11P"; REPLACE BY BETA[1-3][1-3]P
			    "ALFA"
					;		    "ALFA11"; REPLACE BY ALFA[1-3][1-3]
					;		    "ALFA11P"; REPLACE BY ALFA[1-3][1-3]P
			    "GAMMATR"
			    "GAMAX"
			    "GAMAY"
					;		    "GAMA11"; REPLACE BY GAMA[1-3][1-3]
					;		    "GAMA11P"; REPLACE BY GAMA[1-3][1-3]P
					;		    "GAMMA11"; REPLACE BY GAMA[1-3][1-3]
			    "DISP1"
			    "DISP2"
			    "DISP3"
			    "DISP4"
					;		    "DISP1P1"; REPLACE BY DISP[1-4]P[1-3]
					;		    "EIGN11"; REPLACE BY EIGN[1-6][1-6]
			    "R"
					;		    "R11";; REPLACE BY R[1-6][1-6] AFTER REGEXP-OPT
					;		    "RM11";; REPLACE BY RM[1-6][1-6] AFTER REGEXP-OPT		    
			    )
			  'words)
	      ;; some variables already optimized
	      "\\|\\<RE[1-6][1-6]\\>"
	      "\\|\\<TM?[1-6][1-6][1-6]\\>"
	      "\\|\\<BETA[1-3][1-3]P?\\>"
	      "\\|\\<ALFA[1-3][1-3]P?\\>"
	      "\\|\\<GAMA[1-3][1-3]P?\\>"
	      "\\|\\<DISP[1-4]P[1-3]\\>"
	      "\\|\\<EIGN[1-6][1-6]\\>"
	      "\\|\\<RM?[1-6][1-6]\\>")
     . font-lock-variable-name-face))
  "Highlighting expressions for MAD-X mode (variable-name-all).")

(defconst madx-font-lock-intfp-name-face-all
  ;; madx- fonts for integers and floating point numbers
  (list
   '("\\<\\(\\([0-9]+\\.?[0-9]*\\|\\.[0-9]+\\)\\([eE][+-]?\\([0-9]+\\.?[0-9]*\\|[0-9]*\\.[0-9]+\\)\\)?\\)\\>"
     . font-lock-keyword-face))
  "Highlighting expresssions for MAD-X mode (integers and floats).")

(defconst madx-font-lock-keywords-4
  (append
   madx-font-lock-special_constants
   madx-font-lock-special_operators
   madx-font-lock-keywords-face-all
   madx-font-lock-constant-face-all
   madx-font-lock-function-name-face-all
   madx-font-lock-type-face-all
   madx-font-lock-variable-name-face-all
   madx-font-lock-builtin-face-all
   madx-font-lock-warning-face-all
   madx-font-lock-doc-face-all
   madx-font-lock-intfp-name-face-all)
 "Balls-out highlighting in MAD-X mode.")

(defvar madx-font-lock-keywords madx-font-lock-keywords-4
  "Default highlighting expressions for MAD-X mode.")

(defvar madx-mode-syntax-table
  (let ((madx-mode-syntax-table (make-syntax-table)))
	
  ;; This is added so entity names with underscores and dots can be more easily parsed
  (modify-syntax-entry ?_ "w" madx-mode-syntax-table)
  (modify-syntax-entry ?. "w" madx-mode-syntax-table)
	
  ;;  Comment styles are similar to C++
  (modify-syntax-entry ?/ ". 124 b" madx-mode-syntax-table)
  (modify-syntax-entry ?* ". 23" madx-mode-syntax-table)
  (modify-syntax-entry ?\n "> b" madx-mode-syntax-table)
  (modify-syntax-entry ?! "< b" madx-mode-syntax-table)
  (modify-syntax-entry ?' "|" madx-mode-syntax-table)
     madx-mode-syntax-table)
  "Syntax table for `madx-mode'.")

;;;###autoload
(define-derived-mode madx-mode fundamental-mode "madx"
  "Major mode for editing Methodical Accelerator Design X script files."
  (setq font-lock-defaults '(madx-font-lock-keywords nil t))
  ;; Setting up Imenu
  (setq imenu-generic-expression nil)
  (setq imenu-prev-index-position-function nil)
  (setq imenu-extract-index-name-function nil)
  ;;  (imenu-create-index-function)
  ;; Set up search
  (setq case-fold-search t)
  )
;; Highlighting .madx and .seq buffers
;;;###autoload
 (add-to-list 'auto-mode-alist '("\\.\\(madx\\|seq\\)\\'" . madx-mode))
;;;###autoload
(provide 'madx-mode)
;;; madx.el ends here

--=====-=-=--

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31289; Package emacs. (Fri, 26 Oct 2018 10:54:02 GMT) Full text and rfc822 format available.

Message #29 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: Fri, 26 Oct 2018 06:53:07 -0400
Noam Postavsky <npostavs <at> gmail.com> writes:

> Dear Noam, I attached again the file madx.el.
> With respect to the licence, I have to look back on my mails to check if I
> have any other document apart from the one I sent yesterday.

I've sent a message to the copyright-clerk <at> fsf.org, so we'll see what happens.

> ;;;###autoload
> (provide 'madx-mode)
> ;;; madx.el ends here

The provide statement should specifically not be autoloaded.  Otherwise
I think this is ready to upload, as soon as the copyright issue is
resolved.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31289; Package emacs. (Sat, 27 Oct 2018 03:28:01 GMT) Full text and rfc822 format available.

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

From: Richard Stallman <rms <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 31289 <at> debbugs.gnu.org, npostavs <at> gmail.com, orblancog <at> gmail.com
Subject: Re: bug#31289: madx mode for emacs
Date: Fri, 26 Oct 2018 23:27:42 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

I asked the FSF staff to DTRT.

-- 
Dr Richard Stallman
President, Free Software Foundation (https://gnu.org, https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31289; Package emacs. (Sat, 27 Oct 2018 10:55:02 GMT) Full text and rfc822 format available.

Message #35 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: Sat, 27 Oct 2018 06:53:53 -0400
[Message part 1 (text/plain, inline)]
tags 31289 + pending
quit

[forwarding to list, please use "Reply All" to keep 31289 <at> debbugs.gnu.org on Cc]

I've nothing more to say about the code, so (assuming no one else has
any comments either) we're just waiting until you resolve the copyright
stuff.

[Message part 2 (message/rfc822, inline)]
From: Oscar Blanco <orblancog <at> gmail.com>
To: Noam Postavsky <npostavs <at> gmail.com>
Subject: Re: bug#31289: madx mode for emacs
Date: Fri, 26 Oct 2018 13:25:04 +0200
[Message part 3 (text/plain, inline)]
Thank you Noam,

I attach the madx.el file again.

o

Il giorno ven 26 ott 2018 alle ore 12:53 Noam Postavsky <npostavs <at> gmail.com>
ha scritto:

> Noam Postavsky <npostavs <at> gmail.com> writes:
>
> > Dear Noam, I attached again the file madx.el.
> > With respect to the licence, I have to look back on my mails to check if
> I
> > have any other document apart from the one I sent yesterday.
>
> I've sent a message to the copyright-clerk <at> fsf.org, so we'll see what
> happens.
>
> > ;;;###autoload
> > (provide 'madx-mode)
> > ;;; madx.el ends here
>
> The provide statement should specifically not be autoloaded.  Otherwise
> I think this is ready to upload, as soon as the copyright issue is
> resolved.
>
>

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

Added tag(s) pending. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 27 Oct 2018 10:55:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31289; Package emacs. (Sat, 28 Sep 2019 18:14:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 31289 <at> debbugs.gnu.org, Oscar Blanco <orblancog <at> gmail.com>
Subject: Re: bug#31289: madx mode for emacs
Date: Sat, 28 Sep 2019 20:13:14 +0200
Noam Postavsky <npostavs <at> gmail.com> writes:

> Noam Postavsky <npostavs <at> gmail.com> writes:
>
>> Dear Noam, I attached again the file madx.el.
>> With respect to the licence, I have to look back on my mails to check if I
>> have any other document apart from the one I sent yesterday.
>
> I've sent a message to the copyright-clerk <at> fsf.org, so we'll see what happens.

Did you ever hear back from the copyright clerk?

Best regards,
Stefan Kangas




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31289; Package emacs. (Sat, 28 Sep 2019 18:47:01 GMT) Full text and rfc822 format available.

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

From: Noam Postavsky <npostavs <at> gmail.com>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: 31289 <at> debbugs.gnu.org, Oscar Blanco <orblancog <at> gmail.com>
Subject: Re: bug#31289: madx mode for emacs
Date: Sat, 28 Sep 2019 14:46:06 -0400
Stefan Kangas <stefan <at> marxist.se> writes:

> Noam Postavsky <npostavs <at> gmail.com> writes:
>
>> I've sent a message to the copyright-clerk <at> fsf.org, so we'll see what happens.
>
> Did you ever hear back from the copyright clerk?

I did at the time, but there was some additional paperwork that Oscar
needed to get done, and it seems that it still hasn't been resolved
(since I don't see him listed in the copyright list file).





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#31289; Package emacs. (Sat, 28 Sep 2019 18:57:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Oscar Blanco <orblancog <at> gmail.com>
Cc: 31289 <at> debbugs.gnu.org, Noam Postavsky <npostavs <at> gmail.com>
Subject: Re: bug#31289: madx mode for emacs
Date: Sat, 28 Sep 2019 20:55:58 +0200
Hi Oscar,

It seems like there are still some additional paperwork to take care
of before we can accept your module madx.el into GNU ELPA.  Could you
please contact copyright-clerk <at> fsf.org to proceed with your copyright
assignment?

Thanks in advance.

Best regards,
Stefan Kangas




Reply sent to Stefan Kangas <stefan <at> marxist.se>:
You have taken responsibility. (Wed, 15 Jan 2020 20:27:03 GMT) Full text and rfc822 format available.

Notification sent to Oscar Blanco <orblancog <at> gmail.com>:
bug acknowledged by developer. (Wed, 15 Jan 2020 20:27:03 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefan <at> marxist.se>
To: Oscar Blanco <orblancog <at> gmail.com>
Cc: 31289-done <at> debbugs.gnu.org, Noam Postavsky <npostavs <at> gmail.com>
Subject: Re: bug#31289: madx mode for emacs
Date: Wed, 15 Jan 2020 21:26:30 +0100
Stefan Kangas <stefan <at> marxist.se> writes:

> Hi Oscar,
>
> It seems like there are still some additional paperwork to take care
> of before we can accept your module madx.el into GNU ELPA.  Could you
> please contact copyright-clerk <at> fsf.org to proceed with your copyright
> assignment?

Hi again,

More information was requested, but none was given within 15 weeks, so
I don't think we can make any progress here.  I'm therefore closing
this bug for now.

Oscar, if you are still interested in submitting your madx mode to GNU
ELPA, please reply to this email and we can reopen this bug report to
proceed with the inclusion.  Thank you.

Best regards,
Stefan Kangas




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 13 Feb 2020 12:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 72 days ago.

Previous Next


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