Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

File mode specification error: (invalid-regexp "Invalid regular expression")

95 views
Skip to first unread message

Roberto Bernetti

unread,
Jul 26, 2008, 10:42:30 AM7/26/08
to help-gn...@gnu.org
Hi
I'm using opensuse 10.2 with GNU Emacs 21.3.1
emacs the following line working in in my gnu-emacs-custom file:
--------------------------
;; Modifying alist
(setq auto-mode-alist
(cons '("\\.max" . maxima-mode) auto-mode-alist) )
(setq auto-mode-alist
(cons '("\\.m$" . octave-mode) auto-mode-alist))
(setq auto-mode-alist
(cons '("\\_dbg$" . makefile-mode) auto-mode-alist))
(setq auto-mode-alist
(cons '("\\.fi$" . fortran-mode) auto-mode-alist))
(setq auto-mode-alist
(cons '(".gnu-emacs-custom$" . lisp-mode) auto-mode-alist))
(setq auto-mode-alist
(cons '("smb\\.conf$" . smb-mode) auto-mode-alist))
(setq auto-mode-alist
(cons '("\\.mc$" . maxima-mode) auto-mode-alist))
(setq auto-mode-alist
(cons '("\\.mx$" . maxima-mode) auto-mode-alist))

no more work in opensuse 11.0 with GNU Emacs 22.2.1.
I get the following error loading any file i the previous list:

File mode specification error: (invalid-regexp "Invalid regular expression")

browsing the mailing list I changed to

(add-to-list 'auto-mode-alist '("\\.fi$" . fortran-mode))

but for the string:
(add-to-list 'auto-mode-alist '("\\_dbg$" . makefile-mode))
I still get the previous error.

P.S. I'm not in the list.
--
Saluti
Roberto


Pascal J. Bourguignon

unread,
Jul 26, 2008, 12:50:03 PM7/26/08
to
Roberto Bernetti <roberto....@poste.it> writes:
> I get the following error loading any file i the previous list:
>
> File mode specification error: (invalid-regexp "Invalid regular expression")
> [...] for the string:

> (add-to-list 'auto-mode-alist '("\\_dbg$" . makefile-mode))

_ is no special character for regular expressions. You don't need to escape it.

(add-to-list 'auto-mode-alist '("_dbg$" . makefile-mode))

--
__Pascal Bourguignon__ http://www.informatimago.com/

This is a signature virus. Add me to your signature and help me to live.

Cor Gest

unread,
Jul 26, 2008, 12:55:11 PM7/26/08
to
The entity, AKA Roberto Bernetti <roberto....@poste.it> wrote :
(selectively-snipped-or-not-P)

> Hi
> I'm using opensuse 10.2 with GNU Emacs 21.3.1
> emacs the following line working in in my gnu-emacs-custom file:
> --------------------------
> ;; Modifying alist
> (setq auto-mode-alist
> (cons '("\\.max" . maxima-mode) auto-mode-alist) )

.......................^ "$" is lacking here ..;-)

;;;;(setq auto-mode-alist
;;;; (cons '("\\.max$" . maxima-mode) auto-mode-alist) )

This should solve that.

Cor

--
Mijn Tools zijn zo modern dat ze allemaal eindigen op 'saurus'
(defvar My-Computer '((OS . "GNU/Emacs") (IPL . "GNU/Linux")))
SPAM DELENDA EST http://www.clsnet.nl/mail.php
Ik ontwerp schpellvauden, ergo innoveer taal

Peter Dyballa

unread,
Jul 26, 2008, 2:36:41 PM7/26/08
to roberto....@poste.it, help-gn...@gnu.org

Am 26.07.2008 um 16:42 schrieb Roberto Bernetti:

> (setq auto-mode-alist
> (cons '("\\.mc$" . maxima-mode) auto-mode-alist))
> (setq auto-mode-alist
> (cons '("\\.mx$" . maxima-mode) auto-mode-alist))


``$´´ stands for end of line, ``'´´ means end of word or string. This
can make a difference with:

emacs <file1.mc> <file2.mx>


You could simplify (really?) these lines to:

(setq auto-mode-alist
(cons '("\\.m\\(c\\|x\\)\\'" . maxima-mode) auto-mode-alist))

--
Greetings

Pete
~ o
~_\\_/\
~ O O


0 new messages