From 9d2266f87c1f9df224e377f51f0635b3e0f9f663 Mon Sep 17 00:00:00 2001 From: Andreas Raster Date: Wed, 26 Aug 2015 13:45:41 +0200 Subject: [PATCH] I don't think I will get this to ever work as I want it to - forgot why I did this --- go-back.el | 67 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/go-back.el b/go-back.el index dbcead2..cee6b14 100644 --- a/go-back.el +++ b/go-back.el @@ -365,40 +365,43 @@ (defun go-back-prev () (interactive) - (dolist (ov (overlays-at (point))) - (let ((marker (overlay-get ov 'pop-tag-marker))) - (when (and marker - (not (eq (marker-buffer marker) (current-buffer)))) - (switch-to-buffer (or (marker-buffer marker) - (error "The marked buffer has been deleted"))) - (goto-char (marker-position marker)) - (set-marker marker nil nil) - (overlay-put ov 'pop-tag-marker nil)))) - (let* ((loc (go-back-make-location))) - (case last-command - ('go-back-prev - (go-back-shift :right) - (go-back-go (car (last go-back-past))) - (setq go-back-current (car (last go-back-past))) - ) - ('go-back-next - (go-back-go (car (last go-back-past))) - (setq go-back-current (car (last go-back-past))) - ) - (t - (let ((invoke-location (go-back-make-location))) - (go-back-go go-back-current) - (setq go-back-before invoke-location) - (when (= (point) (nth 1 invoke-location)) + (let ((used-pop-tag-marker nil)) + (dolist (ov (overlays-at (point))) + (let ((marker (overlay-get ov 'pop-tag-marker))) + (when (and marker + (not (eq (marker-buffer marker) (current-buffer)))) + (switch-to-buffer (or (marker-buffer marker) + (error "The marked buffer has been deleted"))) + (goto-char (marker-position marker)) + (set-marker marker nil nil) + (overlay-put ov 'pop-tag-marker nil) + (setq used-pop-tag-marker t)))) + (unless used-pop-tag-marker + (let* ((loc (go-back-make-location))) + (case last-command + ('go-back-prev (go-back-shift :right) + (go-back-go (car (last go-back-past))) (setq go-back-current (car (last go-back-past))) - (go-back-go go-back-current) - (setq go-back-before invoke-location)) - (when (eq go-back-current (car go-back-future)) - (go-back-shift :left)) - (go-back-push loc :right) - (setq go-back-current (car (last go-back-past)))) - )))) + ) + ('go-back-next + (go-back-go (car (last go-back-past))) + (setq go-back-current (car (last go-back-past))) + ) + (t + (let ((invoke-location (go-back-make-location))) + (go-back-go go-back-current) + (setq go-back-before invoke-location) + (when (= (point) (nth 1 invoke-location)) + (go-back-shift :right) + (setq go-back-current (car (last go-back-past))) + (go-back-go go-back-current) + (setq go-back-before invoke-location)) + (when (eq go-back-current (car go-back-future)) + (go-back-shift :left)) + (go-back-push loc :right) + (setq go-back-current (car (last go-back-past)))) + )))))) ;; blah