help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: turning line mode on/off with defun not working


From: Wes James
Subject: Re: turning line mode on/off with defun not working
Date: Fri, 6 Dec 2013 12:21:26 -0700

On Fri, Dec 6, 2013 at 11:35 AM, Emanuel Berg <address@hidden>wrote:

> Wes James <address@hidden> writes:
>
> > I have these lines in my .emacs, but they don't
> > work. Why?
>
> (interactive), for starters. But you probably won't to
> enable this buffer-local. Also, check out the below
> Elisp for two simple "toggle" defuns - you don't need
> one to turn it off, and one to turn it on - think of it
> as a binary state machine (i.e., with two states). It
> only requires one operation, "do whatever I don't do
> know".
>
> ;;; show point position
> ;; column
> (defun char-mode ()
>   "Mode bar: Show the index of the character at point (first = 0)."
>   (interactive)
>   (set-variable 'column-number-mode
>                 (not column-number-mode)
>                 t) ) ; local
> (defalias 'cols 'char-mode)
> ;; line
> (defun line-mode ()
>   "Mode bar: Show the line number at point (first = 1)."
>   (interactive)
>   (set-variable 'line-number-mode
>                 (not line-number-mode)
>                 t) ) ; local
> (defalias 'lines 'line-mode)
>
> --
> Emanuel Berg, programmer-for-rent. CV, projects, etc at uXu
> underground experts united:  http://user.it.uu.se/~embe8573
>


Thank you.  I appreciate this.

-wes


reply via email to

[Prev in Thread] Current Thread [Next in Thread]