From e0d278e568f3d5d8253f36c76d113aa29d94ba81 Mon Sep 17 00:00:00 2001 From: rubikitch Date: Tue, 10 Aug 2010 03:18:35 +0900 Subject: [PATCH] anything.el (anything-next-point-in-list): refactor: remove condition-case --- anything.el | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/anything.el b/anything.el index e429c23..08b7763 100644 --- a/anything.el +++ b/anything.el @@ -3208,18 +3208,17 @@ It is analogous to `dired-get-marked-files'." (defun anything-next-point-in-list (curpos points &optional prev) (cond ;; rule out special cases - ((null points) curpos) - ((and prev (< curpos (car points))) curpos) - ((and prev (< (car (last points)) curpos)) (car (last points))) + ((null points) curpos) + ((and prev (< curpos (car points))) curpos) + ((< (car (last points)) curpos) + (if prev (car (last points)) curpos)) (t - (condition-case err - (nth (+ (loop for pt in points - for i from 0 - if (or (< curpos pt) (and prev (= curpos pt))) - do (return i)) - (if prev -1 0)) - points) - (error curpos))))) + (nth (+ (loop for pt in points + for i from 0 + if (or (< curpos pt) (and prev (= curpos pt))) + do (return i)) + (if prev -1 0)) + points)))) (defun anything-next-visible-mark (&optional prev) "Move next anything visible mark." -- 2.11.4.GIT