[Top][All Lists]

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

Re: [Emacs 23] Does not show euro sign

From: Andreas Politz
Subject: Re: [Emacs 23] Does not show euro sign
Date: Sun, 18 Oct 2009 20:18:27 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

address@hidden (David Combs) writes:

> In article <address@hidden>,
> Peter Dyballa  <address@hidden> wrote:
> ...
>>If this does not help, bisecting can. It's a method of commenting one  
>>half of your init file and launching GNU Emacs. When the error is  
>>gone, then it's in the commented section. Otherwise it's in the not  
>>yet commented section. Now take care of the culprit section and  
>>divide it. And so on, until you've located the guilty line.
> Maybe someone good with elisp, and for the good of us all,
> could automate this bisection -- eg, not splitting defuns, etc.

Bisection is only useful by hand, otherwise it doesn't
matter and a sequential eval-test-loop is just fine.
Something like this.

(defun disect(&optional buffer pred)
  "Eval sexps in BUFFER until some condition is met.
If PRED is nil stop when an error occurs, otherwise stop when
PRED returns a non-nil value.

PRED must be side-effect free, e.g. not move point."
   (list (read-buffer "Disect: "
                      (current-buffer) t)
         (eval (read
                 "Predicate (default: check for errors): "
                 nil nil "nil")))))
  (let (result)
    (with-current-buffer (or buffer (current-buffer))
      (goto-char 1)
      (while (and (not (eobp))
                  (not result))
        (condition-case err
            (eval (read (current-buffer)))
          (error (unless pred
                   (setq result err))))
        (and pred
             (setq result
                   (funcall pred)))))
    (if (null result)
        (message "Nothing to report")
      (if (null pred)
          (message "Error here: %s" result)
        (message "Predicate fulfilled here")))))


reply via email to

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