LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-13-2006, 07:08 PM   #1
aliensub
Member
 
Registered: Apr 2002
Location: Denmark
Distribution: OS X
Posts: 306

Rep: Reputation: 30
Emacs and mmm-mode trouble


I am pretty mucha newbie when it comes to Emacs. I have tried to customize it to fit into asp programming. Therefore I use the mmm-mode package which makes me run visual-basic-mode inside html-helper-mode.

The problem I have is that the background colour on the visual-basic parts is a wrong colour which I have tried to change without luck. I am not even able to switch the background colour off. This is all tried to be done in my .emacs file.

I have pasted my .emacs file below. Hope you can help me resolve this annoying thing....

I have put hashmarks around the line which should change the colour


Code:
;;************************************************************
;; configure HTML editing
;;************************************************************

    (require 'visual-basic-mode)
    ;;
    ;; configure css-mode
    (autoload 'css-mode "css-mode")
    (add-to-list 'auto-mode-alist '("\\.css\\'" . css-mode))
     (setq cssm-indent-function #'cssm-c-style-indenter)
    (setq cssm-indent-level '2)
    ;;
    (add-hook 'visual-basic-mode-user-hook 'turn-on-font-lock)
    ;;
    (require 'mmm-mode)
    (setq mmm-global-mode 'maybe)
    ;;
    ;; set up an mmm group for fancy html editing
    (mmm-add-group
     'fancy-html
     '(
             (html-asp-tagged
                    :submode visual-basic-mode
                    :face mmm-code-submode-face
                    :front "<[%]"
                    :back "[%]>")
             (html-css-attribute
                    :submode css-mode
                    :face mmm-declaration-submode-face
                    :front "style=\""
                    :back "\"")))
    ;;
    ;; What files to invoke the new html-mode for?
    (add-to-list 'auto-mode-alist '("\\.inc\\'" . html-helper-mode))
    (add-to-list 'auto-mode-alist '("\\.phtml\\'" . html-helper-mode))
    (add-to-list 'auto-mode-alist '("\\.asp[34]?\\'" . html-helper-mode))
    (add-to-list 'auto-mode-alist '("\\.[sj]?html?\\'" . html-helper-mode))
    (add-to-list 'auto-mode-alist '("\\.inc\\'" . html-helper-mode))
    ;;
    ;; What features should be turned on in this html-mode?
    (add-to-list 'mmm-mode-ext-classes-alist '(html-helper-mode nil html-js))
    (add-to-list 'mmm-mode-ext-classes-alist '(html-helper-mode nil embedded-css))
    (add-to-list 'mmm-mode-ext-classes-alist '(html-helper-mode nil fancy-html))
  
################################################
  ;;Set no coloured background for VB Script
    (set-face-background 'mmm-default-submode-face "gray15")
################################################


;;************************************************************
;; configure various settings
;;************************************************************

;;Don't open files in new window
(defun my-new-frame-with-new-scratch ()
  (interactive)
  (let ((one-buffer-one-frame t))
    (new-frame-with-new-scratch)))

;;Open new frame with Apple-N
(define-key osx-key-mode-map (kbd "A-n") 'my-new-frame-with-new-scratch)

;;Remove toolbar
(tool-bar-mode)
 
Old 01-14-2006, 04:12 PM   #2
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
emacs lisp is certainly not my forte but try
(setq mmm-submode-decoration-level 1)
or
(setq mmm-submode-decoration-level 2)
 
Old 01-14-2006, 08:10 PM   #3
aliensub
Member
 
Registered: Apr 2002
Location: Denmark
Distribution: OS X
Posts: 306

Original Poster
Rep: Reputation: 30
Tried to do it but without result....
 
Old 01-14-2006, 11:26 PM   #4
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
the manual says mmm-default-submode-face sets color for all submodes the same ?
this would be Low coloring or
(setq mmm-submode-decoration-level 1)
so it might be you want
(setq mmm-submode-decoration-level 0)
which turns off submode background in mmm (i think)
also possibly use
(set-face-background 'mmm-default-submode-face nil)
or leave that line out alltogether

it's real easy in emacs to have one color setting stomp on the other.
if you can stop mmm
you might be able to set background for mode like normal

try this just as another blind try on my part
(this works here for naked non-mmm modes)
Code:
(add-hook 'visual-basic-mode-user-hook
              '(lambda ()
                 (set-background-color  "grey15")))

Last edited by foo_bar_foo; 01-14-2006 at 11:27 PM.
 
Old 01-15-2006, 05:20 PM   #5
aliensub
Member
 
Registered: Apr 2002
Location: Denmark
Distribution: OS X
Posts: 306

Original Poster
Rep: Reputation: 30
Thanx for trying it out....

I have tried to use the
(set-face-background 'mmm-default-submode-face nil)

And also the decorations levels without any result.

I really would like not to disable mmm since it then can mix html and vb in one file.

I just discovered that *Messages* writes the following when opening a file that uses the mmm mode:

Fontifying udlejning.asp... (Attributes ...)
Error during redisplay: (wrong-type-argument number-or-marker-p nil
 
Old 01-15-2006, 05:36 PM   #6
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
Quote:
Originally Posted by aliensub
Thanx for trying it out....



I really would like not to disable mmm since it then can mix html and vb in one file.

I just discovered that *Messages* writes the following when opening a file that uses the mmm mode:

Fontifying udlejning.asp... (Attributes ...)
Error during redisplay: (wrong-type-argument number-or-marker-p nil
yea i just meant add the hook below the other hook for vb you have in there
to see if it does anything.
another thing to try is just hacking at the vb mode itself.
just a guess the error is about indentation
sorry i can't help further working with variables in emacs modes is a bit like shooting at a moving target.
 
Old 01-15-2006, 06:52 PM   #7
aliensub
Member
 
Registered: Apr 2002
Location: Denmark
Distribution: OS X
Posts: 306

Original Poster
Rep: Reputation: 30
This is pretty weird or embarrassing.

just for the luck of it I tried mingeling with the (setq mmm-submode-decoration-level 0) which I had tried using 40 times already.
For some reason when putting it below the (setq mmm-global-mode 'maybe) it works.
Don't know why it didn't work everywhere else.....

Sorry for wasting your time :-) But thanx for trying
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Emacs: sgml mode lackluster Programming 4 04-23-2006 08:50 PM
emacs problem in shell mode bujecas Slackware 1 10-25-2004 04:37 AM
emacs and info and rpm in text mode pleinair Mandriva 0 08-03-2004 06:43 PM
emacs-21.2 php-mode.el howto ? cicisbeo Linux - Software 1 01-12-2004 08:26 PM
Disabling cc-mode Emacs amannuc Linux - Software 0 10-21-2003 12:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration