Where do I input a piece of code in Emacs?

Posted by Vivi on Stack Overflow See other posts from Stack Overflow or by Vivi
Published on 2010-05-22T05:27:54Z Indexed on 2010/05/22 5:30 UTC
Read the original article Hit count: 309

Filed under:
|
|

Hi there,

I have just started using Emacs for the specific purpose of editing latex documents. I was attracted to Emacs because I want to be able to customize syntax highlighting even to the point of defining the colors of specific words. I am new to Emacs and not a programmer, so I having an extreme difficulty in doing what I want to do because most help I find assume too much knowledge for my level (it took me days just to be able to install emacs + auctex and change the first face color).

I found something that I think will help me but I don't know how to do it. The post below is what I want to do, but what I am supposed to do with this code? Where should I insert it or where should I type it? I am using GNU Emacs in Windows. Thank you so much for you help :)

M-x what-face

will print the face found at the current point. And the code for that is:

(defun what-face (pos)
(interactive "d") (let ((face (or (get-char-property (point) 'read-face-name)
(get-char-property (point) 'face))))
(if face (message "Face: %s" face) (message "No face at %d" pos))))

By the way, I found this in another post that can be found here: http://stackoverflow.com/questions/1242352/get-font-face-under-cursor-in-emacs

© Stack Overflow or respective owner

Related posts about emacs

Related posts about code