Like Tree1Likes
  • 1 Post By anduril462

Emacs init file problem

This is a discussion on Emacs init file problem within the Tech Board forums, part of the Community Boards category; Hi guys, I was trying to start customizing emacs using the .emacs file, I just wanted it to default to ...

  1. #1
    Registered User
    Join Date
    Dec 2013
    Posts
    22

    Emacs init file problem

    Hi guys,

    I was trying to start customizing emacs using the .emacs file, I just wanted it to default to k&r style in c-mode, but I just get errors now.

    I hoped it would really be as simple as the online tutorial implied but it's not. The default .emacs file without any modification is causing the problem, this is what I have.
    Code:
      ;;;;
    ~(custom-set-variables
     ;; custom-set-variables was added by Custom.
     ;; If you edit it by hand, you could mess it up, so be careful.
     ;; Your init file should contain only one such instance.
     ;; If there is more than one, they won't work right.
     '(show-paren-mode t))
    (custom-set-faces
     ;; custom-set-faces was added by Custom.
     ;; If you edit it by hand, you could mess it up, so be careful.
     ;; Your init file should contain only one such instance.
     ;; If there is more than one, they won't work right.
     )
    
    (setq -default-style "k&r"
         c-basic-offset 4)
    What I wanted was for it to just start as normal but default to k&r style when going into c- mode. If I remove the last bit, it still comes up with errors.

    Kind regards

    P166

  2. #2
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,498
    This is not a C question, so in the future, put such questions in the tech or general discussion sub-forums.

    Also, direct us to whatever tutorial/resources you are learning, so we can see them for ourselves.

    I'm not an emacs user, but a quick Google search and a bit of careful reading seems to show a typo in this bit (what type of default style is it you're setting?)
    Code:
    (setq -default-style "k&r"
         c-basic-offset 4)
    Last edited by anduril462; 01-14-2014 at 01:00 PM.
    Salem likes this.

  3. #3
    Registered User
    Join Date
    Dec 2013
    Posts
    22
    Sorry for posting in the wrong forum. It's a little confusing when you are new to this. And no, this does not work, it is what I have at the bottom of the code. Anyone out there know this?
    Last edited by P166BUG; 01-14-2014 at 04:54 PM.

  4. #4
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Quote Originally Posted by P166BUG View Post
    Sorry for posting in the wrong forum. It's a little confusing when you are new to this. And no, this does not work, it is what I have at the bottom of the code. Anyone out there know this?
    I don't think any of the Emacs variables start with a hyphen. Did you want c-default?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. zero init data member of class in header file
    By std10093 in forum C++ Programming
    Replies: 7
    Last Post: 01-09-2014, 03:25 PM
  2. struct init
    By hubris in forum C Programming
    Replies: 13
    Last Post: 10-10-2010, 11:18 PM
  3. Replies: 0
    Last Post: 10-03-2009, 05:25 PM
  4. class problem (init. struct, itierator for 2d array)
    By avgprogamerjoe in forum C++ Programming
    Replies: 2
    Last Post: 09-24-2007, 08:00 PM
  5. Read File To Char Array with Null char init
    By MicroFiend in forum Windows Programming
    Replies: 1
    Last Post: 10-28-2003, 05:18 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21