tags:

views:

32

answers:

1

Let's say I need to check if hello.el file is read or not.

(defun hello ()
  "Test"
  (interactive)
  (message "Hello, world"))

(format "hello")
(provide 'smcho)

I used the (format "hello") to show something, but it doesn't seem to work. How can I know if an elisp module is read.

+4  A: 

You should use message instead:

(message "hello")

format simply generates a formatted string, much like if you had

(+ 1 2)

which would result in adding two numbers. Nothing is done with the result, which is why you didn't see it. If you're familiar with C, it's much like having a line

sprintf(s, "hello");   /* this produces no output */

Note: If you have lots of these, you might need to customize the variable message-log-max.

Trey Jackson