What do you do if scan-lists reports an error?



Condition case re-introduced...

It now reads as follows:


(defun bounds-of-thatpt (thing &optional arg)
 "
 Determine the start and end buffer locations for the THING at point.
 THING is a symbol which specifies the kind of syntactic entity you want.
Possibilities include `symbol', `list', `sexp', `defun', `filename', `url',
 `word', `sentence', `whitespace', `line', `page' and others."
 (condition-case nil
     (save-excursion
     (let ((orig (point))
            (beg (progn
               (funcall ;; First, move to beg.
                (or (get thing 'beginning-op)
                (lambda ()
                  (forward-char 1)
                  (forward-thing thing -1))))
               (point)))
            (end
             (progn  (funcall ;; Then move to end.
              (or (get thing 'end-op)
              (lambda () (forward-thing thing 1))))
                (point))))
       ;; if orig not between beg and end, failure, nil
       (when (and(<= beg orig) (<= orig end) (< beg end))
         (cons beg end))))
   (error nil)))


Please have a look at the newly published thingatpt-util.el at gnu.emacs.sources


Thanks

__
Andreas Roehler



_______________________________________________
emacs-pretest-bug mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Reply via email to