Lidi, potrebuju neco jako "buffer zapamatovanych mist". Registry mi nestaci. Vrtam ted do pomerne velkeho projektu a proste v tom zdrojaku bloudim, nevim odkud jsem kam prisel, atd. Hodlam zkusit push/pop strategii, kdy si mista kterymi prochazim pushnu na jakysi zasobnik, a az se chci vratit, popnu. Pokud nekdo vite o rezimu ktery to umi, sem s nim. Zatim si vystacim s timhle hackem primo v .emacs;)
(defvar pointstack-stack '() "Stack of bufferpoints")
(defun pointstack-push (arg)
(interactive "p")
(let ((val (cons (point) (buffer-name))))
(setq pointstack-stack (list val pointstack-stack))))
(defun pointstack-pop (arg)
(interactive "p")
(if pointstack-stack
(progn
(switch-to-buffer (cdar pointstack-stack))
(goto-char (caar pointstack-stack))
(setq pointstack-stack (cadr pointstack-stack)))
(message (format "Pointstack is empty" pointstack-stack))))
(defun pointstack-clear (arg)
(interactive "p")
(setq pointstack-stack '()))
(defun pointstack-debug (arg)
(interactive "p")
(message (format "pointstack='%s'" pointstack-stack)))
(global-set-key "\C-c\C-s\C-s" 'pointstack-push)
(global-set-key "\C-c\C-s\C-r" 'pointstack-pop)
(global-set-key "\C-c\C-s\C-d" 'pointstack-debug)
(global-set-key "\C-c\C-s\C-c" 'pointstack-clear)