unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@gmail.com>
To: Oscar Blanco <orblancog@gmail.com>
Cc: 31289@debbugs.gnu.org
Subject: bug#31289: madx mode for emacs
Date: Wed, 24 Oct 2018 18:30:56 -0400	[thread overview]
Message-ID: <875zxrm0yn.fsf@gmail.com> (raw)
In-Reply-To: <CAEUbmsoEAjh5DJA2A7yk0m-Ljyu-P18f3Er1Ka8sbXeHvw810Q@mail.gmail.com> (Oscar Blanco's message of "Fri, 5 Oct 2018 08:52:22 +0200")

Oscar Blanco <orblancog@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.





  reply	other threads:[~2018-10-24 22:30 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-27 11:00 bug#31289: madx mode for emacs Oscar Blanco
2018-06-22  0:50 ` Noam Postavsky
2018-10-05  6:52   ` Oscar Blanco
2018-10-24 22:30     ` Noam Postavsky [this message]
2018-10-25 22:56 ` Noam Postavsky
2018-10-25 23:18   ` Noam Postavsky
2018-10-26  6:42     ` Eli Zaretskii
2018-10-27  3:27       ` Richard Stallman
2018-10-26 10:41 ` Noam Postavsky
2018-10-26 10:53   ` Noam Postavsky
2018-10-27 10:53 ` Noam Postavsky
2019-09-28 18:13 ` Stefan Kangas
2019-09-28 18:46   ` Noam Postavsky
2019-09-28 18:55     ` Stefan Kangas
2020-01-15 20:26       ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875zxrm0yn.fsf@gmail.com \
    --to=npostavs@gmail.com \
    --cc=31289@debbugs.gnu.org \
    --cc=orblancog@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).