Question

My .emacs file has the following content:

$ cat ~/.emacs
(setq vc-handled-backends nil)
(global-linum-mode t)

$ od -xcb ~/.emacs
0000000      7328    7465    2071    6376    682d    6e61    6c64    6465
           (   s   e   t   q       v   c   -   h   a   n   d   l   e   d
          050 163 145 164 161 040 166 143 055 150 141 156 144 154 145 144
0000020      622d    6361    656b    646e    2073    696e    296c    280a
           -   b   a   c   k   e   n   d   s       n   i   l   )  \n   (
          055 142 141 143 153 145 156 144 163 040 156 151 154 051 012 050
0000040      6c67    626f    6c61    6c2d    6e69    6d75    6d2d    646f
           g   l   o   b   a   l   -   l   i   n   u   m   -   m   o   d
          147 154 157 142 141 154 055 154 151 156 165 155 055 155 157 144
0000060      2065    2974                                                
           e       t   )                                                
          145 040 164 051                                                
0000064

These are absolutely valid Emacs's LISP expressions. But recently whenever I start emacs, the line numbers no longer show up, instead, an error comes up:

$emacs --debug-init ~/.emacs
Debugger entered--Lisp error: (void-function global-linum-mode)
  (global-linum-mode t)
  eval-buffer(#<buffer  *load*> nil "/Users/user/.emacs" nil t)  ; Reading at buffer position 53
  load-with-code-conversion("/Users/user/.emacs" "/Users/user/.emacs" t t)
  load("~/.emacs" t t)
  #[nil "^H\205\276^@   \306=\203^Q^@\307^H\310Q\202A^@ \311=\2033^@\312\307\313\314#\203#^@\315\202A^@\312\307\313\316$
  command-line()
  normal-top-level()

Version of emacs:

$ emacs --version
GNU Emacs 22.1.1
Copyright (C) 2007 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

Does anyone have an idea what might have caused this? Thanks

Was it helpful?

Solution

Looks like linum mode was added to the Emacs distribution in version 23.1 (changelog). Because linum isn't distributed with Emacs 22, you're calling an undefined function and therefore getting an error.

Perhaps you used to run a more recent version of emacs, which has since been clobbered. You could either:

  • download the linum source, add it to your load path, then require it

  • install a newer version of Emacs.


Edit: As mentioned in the comments above, you could have multiple Emacs binaries on your path, with different versions. Have a look in /usr/bin, /opt/local/bin, et al, to see if this is the case.

OTHER TIPS

First thing I would check the contents of that file with something other than cat such as the octal dump program od if you're running under a UNIXy system:

od -xcb .emacs

Because 53 characters is about the size of those two lines, it might have some rubbish at the end of (or within) the file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top