Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7514575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:32:15+00:00 2026-05-30T00:32:15+00:00

I use defun to define a function in my .emacs file: (defun myfun ()

  • 0

I use defun to define a function in my .emacs file:

(defun myfun ()
   "i am already loaded the color-theme lib"
   (color-theme-initialize)
   (color-theme-darkblue))

Then I want to use this function in my mode-hook:

(add-hook 'python-mode-hook
   '(lambda ()
       (myfun)
       (...)))

But I got an error saying that the color-theme-initialize function is void.

P.S. my ~/.emacs snippet

(progn (require 'color-theme)
       (color-theme-initialize))

(progn (setq-default indent-tabs-mode nil)
       (setq-default tab-width 2)
       (setq indent-line-function 'insert-tab))

(add-hook 'emacs-lisp-mode-hook
          '(lambda ()
             (color-theme-resolve)
             (show-paren-mode t)
             (linum-mode t)))
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T00:32:16+00:00Added an answer on May 30, 2026 at 12:32 am

    You need to require (or otherwise load) the library which provides color-theme-initialize. I’m guessing (require 'color-theme).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use the following smart-tab defun in my .emacs for either completion on a
I use the following function from Latex, Emacs: automatically open *TeX Help* buffer on
I'm trying to use the interactive function name feature. On emacs lisp manual it
I use this function for printing a buffer's content to PDF (from my .emacs
I am writing an elisp file to integrate GNU Emacs with Zeitgeist over dbus.
I use Emacs for clojure development, because Swank-clojure is a great tool. But once
Is there any way to write something like this without taking over emacs? (defun
Suppose I have this wonderful function foo [92]> (defun foo () (lambda() 42)) FOO
...just like packages do. I use Emacs (maybe, it can offer some kind of
I have a copy of emacs that I use on a couple of different

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.