[Top][All Lists]

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

switch-to-buffer doesn't work always?

From: rnd
Subject: switch-to-buffer doesn't work always?
Date: Tue, 9 Jan 2001 20:41:54 +0300 (MSK)

Hello, elisp guru!

(I am new to Emacs - only 4 days using it.
My emacs is 20.3, Linux RH6.2)

The following code is from my .emacs file
(I did it myself)

(setq mim-list ())
(defun enter-file ()
  (setq fn (thing-at-point 'filename))
  (find-file fn)
  (add-to-list 'mim-list fn)

(defun return-from-file ()
  (save-buffer (current-buffer))
  (if mim-list
     (switch-to-buffer (car mim-list))
  (setq mim-list (cdr mim-list))

(global-set-key [(control c) down] 'enter-file)
(global-set-key [(control c) up] 'return-from-file)


C-c Down is expected to enter file at the point and
C-c Up to return from the file (works recursively),
saving it but not killing the buffer.

C-c Down works fine but not C-c Up.
(In the first version of the code I saved not
the names of the files but bffers - with the same result)

I can't understand why return-from-file doesnt open old buffer!
(It saves is though)


And that is not the only problem!
I want to bind return-from-file to ESC Up and
enter-file to ESC Down, but Emacs doesn't allow this:

(global-set-key [ESC Down] 'enter-file)
(global-set-key [ESC Up] 'return-from-file)

- it just doesn't work for no reason!


Any ideas? I will appreciate your help!

Sincerely yours, Roman Suzi
Vote for my design:
_/ Russia _/ Karelia _/ Petrozavodsk _/ _/
_/ Tuesday, January 09, 2001 _/ Powered by Linux RedHat 6.2 _/
_/ "It's easy to apply yourself, just use crazy glue!" _/

reply via email to

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