[Top][All Lists]

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

Re: function defined in .emacs: so what's the big secret?

From: Dan Jacobson
Subject: Re: function defined in .emacs: so what's the big secret?
Date: 10 Feb 2002 09:25:41 +0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

>>>>> "Eli" == Eli Zaretskii <address@hidden> writes:

Eli> It does for me: I tried several functions from my .emacs, and Emacs
Eli> did say they were defined in ~/.emacs.  I also tried an otherwise
Eli> empty .emacs with the definition of your switch-to-other-buffer, and
Eli> it also worked.

Eli> What version of Emacs did you try that in?  (It's Emacs 21.x here.)

I used the emacs listed in my headers and the .emacs on

wait... I see that it is inside term-setup-hook ... OK, well... at
least emacs should say what hook or file it came from...

By the way, (describe-variable (quote term-setup-hook))
term-setup-hook's value is shown below...

Defined in `startup'....
shouldn't it say .emacs, not startup, now that I define it... or maybe
it should say both?  Also doesn't it want to say startup.el/c or even
a full path, instead of the mystery filled "startup".

>>>>> "John" == John Paul Wallington <address@hidden> writes:

John> Hi Dan
John> you wrote:

>> I do (describe-function (quote switch-to-other-buffer))
>> switch-to-other-buffer is an interactive Lisp function.
>> (switch-to-other-buffer)
>> not documented
>> OK, but where was this function defined?  Doesn't emacs often tell me
>> what file I might find it in, etc.?

John> If you do M-x describe-function switch-to-other-buffer does it tell
John> you where it was defined?  If so perhaps its help-setup-xref call is
John> the culprit.

apparently it can hide in a hook... even though the hook had been run.

John> Does (symbol-file 'switch-to-other-buffer) return "~/.emacs" or somesuch?


>> Oh... it was defined in my .emacs file!  OK, can't the mighty emacs
>> mention something to that effect, instead of "I'm sorry sir, the
>> function requested that their number not be listed in the phone book,
>> you will need a court order if you want to find where in the world you
>> ingested this function's definition."
>> P.S. I have
>> (defun switch-to-other-buffer () (interactive) (switch-to-buffer
>> (other-buffer)))
>> but I would like one that ignores dired etc. buffers.

John> There is another switch-to-other-buffer kicking around, but it
John> doesn't do that:

John> (defun switch-to-other-buffer (arg)
John>   "Switch to the previous buffer.  With a numeric arg, n, switch to the 
John> most recent buffer.  With an arg of 0, buries the current buffer at the
John> bottom of the buffer stack."
John>   (interactive "p")
John>   (if (eq arg 0)
John>       (bury-buffer (current-buffer)))
John>   (switch-to-buffer
John>    (if (<= arg 1) (other-buffer (current-buffer))
John>      (nth (1+ arg) (buffer-list)))))

John> Happy hacking!
http://www.geocities.com/jidanni/ Taiwan(04)25854780

reply via email to

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