From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Romain Francoise Newsgroups: gmane.emacs.devel Subject: Emacs aborts during byte-compilation from Dired Date: Thu, 22 Feb 2007 10:13:07 +0100 Organization: orebokech dot com Message-ID: <877iuablng.fsf@pacem.orebokech.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1172135538 19796 80.91.229.12 (22 Feb 2007 09:12:18 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 22 Feb 2007 09:12:18 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 22 10:12:11 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HK9zm-0000rB-AT for ged-emacs-devel@m.gmane.org; Thu, 22 Feb 2007 10:12:10 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HK9zl-0004nl-Nr for ged-emacs-devel@m.gmane.org; Thu, 22 Feb 2007 04:12:09 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HK9zT-0004ng-RE for emacs-devel@gnu.org; Thu, 22 Feb 2007 04:11:51 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HK9zS-0004nU-1t for emacs-devel@gnu.org; Thu, 22 Feb 2007 04:11:51 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HK9zR-0004nR-QL for emacs-devel@gnu.org; Thu, 22 Feb 2007 04:11:49 -0500 Original-Received: from yeast.orebokech.com ([82.67.41.165]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HK9zR-0001db-2J for emacs-devel@gnu.org; Thu, 22 Feb 2007 04:11:49 -0500 Original-Received: from pacem.orebokech.com (pacem.orebokech.com [192.168.1.3]) by yeast.orebokech.com (Postfix) with ESMTP id 7270413063 for ; Thu, 22 Feb 2007 10:11:48 +0100 (CET) Original-Received: by pacem.orebokech.com (Postfix, from userid 1000) id 72F5F5242B; Thu, 22 Feb 2007 10:13:07 +0100 (CET) X-Face: }9mYu,e_@+e!`Z-P5kVXa3\_b:hdJ"B)ww[&=b<2=awG:GOIM List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:66604 Archived-At: --=-=-= Hi, I received this report from a Debian user: | The latest emacs-snapshot aborts if I try to compile Fontifier.el | from the mozart package. | | I am compiling it from dired (typing B on the line with Fontifier.el): The file is attached to this message. I can reproduce this bug with current CVS: #0 abort () at emacs.c:431 #1 0x082050dc in get_property_and_range (pos=0, prop=138093161, val=0xafa52360, start=0xafa5235c, end=0xafa52358, object=137922809) at intervals.c:2321 #2 0x0820c12e in find_composition (pos=0, limit=-1, start=0xafa5235c, end=0xafa52358, prop=0xafa52360, object=137922809) at composite.c:415 #3 0x080b7591 in lisp_string_width (string=137922809, precision=-1, nchars=0x0, nbytes=0x0) at charset.c:1365 #4 0x081a877e in Fformat (nargs=3, args=0xafa52644) at editfns.c:3590 #5 0x081b17cd in Ffuncall (nargs=4, args=0xafa52640) at eval.c:2978 #6 0x081b109d in Fapply (nargs=3, args=0xafa52744) at eval.c:2485 #7 0x081b17cd in Ffuncall (nargs=4, args=0xafa52740) at eval.c:2978 #8 0x081e92a2 in Fbyte_code (bytestr=140714411, vector=140181220, maxdepth=32) at bytecode.c:679 #9 0x081b208e in funcall_lambda (fun=140181404, nargs=3, arg_vector=0xafa52a44) at eval.c:3184 #10 0x081b1b4e in Ffuncall (nargs=4, args=0xafa52a40) at eval.c:3043 #11 0x081e92a2 in Fbyte_code (bytestr=140326403, vector=140171500, maxdepth=40) at bytecode.c:679 #12 0x081b208e in funcall_lambda (fun=140287860, nargs=0, arg_vector=0xafa52d54) at eval.c:3184 #13 0x081b1b4e in Ffuncall (nargs=1, args=0xafa52d50) at eval.c:3043 #14 0x081e92a2 in Fbyte_code (bytestr=140336819, vector=139954612, maxdepth=72) at bytecode.c:679 #15 0x081b208e in funcall_lambda (fun=140351404, nargs=4, arg_vector=0xafa53074) at eval.c:3184 #16 0x081b1b4e in Ffuncall (nargs=5, args=0xafa53070) at eval.c:3043 #17 0x081e92a2 in Fbyte_code (bytestr=140336851, vector=140228124, maxdepth=40) at bytecode.c:679 #18 0x081b208e in funcall_lambda (fun=140200420, nargs=1, arg_vector=0xafa533d4) at eval.c:3184 #19 0x081b1b4e in Ffuncall (nargs=2, args=0xafa533d0) at eval.c:3043 #20 0x081ad401 in Fcall_interactively (function=138002969, record_flag=137922761, keys=137963276) at callint.c:860 #21 0x0813aeae in Fcommand_execute (cmd=138002969, record_flag=137922761, keys=137922761, special=137922761) at keyboard.c:10014 #22 0x0812cde4 in command_loop_1 () at keyboard.c:1873 #23 0x081af4e6 in internal_condition_case (bfun=0x812b9f2 , handlers=137967417, hfun=0x812b3a2 ) at eval.c:1481 #24 0x0812b74d in command_loop_2 () at keyboard.c:1329 #25 0x081aefa1 in internal_catch (tag=137961401, func=0x812b72a , arg=137922761) at eval.c:1222 #26 0x0812b703 in command_loop () at keyboard.c:1308 #27 0x0812b120 in recursive_edit_1 () at keyboard.c:1006 #28 0x0812b262 in Frecursive_edit () at keyboard.c:1067 #29 0x08129b18 in main (argc=3, argv=0xafa53ec4) at emacs.c:1761 Lisp Backtrace: "format" (0x863b973) "apply" (0x83a5039) "dired-log" (0x85d35b3) "dired-byte-compile" (0x83888c9) "dired-map-over-marks-check" (0x8616619) "dired-do-byte-compile" (0x83888c9) "call-interactively" (0x839c219) -- Romain Francoise | The sea! the sea! the open it's a miracle -- http://orebokech.com/ | sea! The blue, the fresh, the | ever free! --Bryan W. Procter --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=Fontifier.el ;;; ;;; Author: ;;; Denys Duchier ;;; Leif Kornstaedt ;;; ;;; Copyright: ;;; Denys Duchier, 1998 ;;; Leif Kornstaedt, 1998 ;;; ;;; Last change: ;;; $Date: 1998/09/24 17:23:32 $ by $Author: duchier $ ;;; $Revision: 1.11 $ ;;; ;;; This file is part of Mozart, an implementation of Oz 3: ;;; $MOZARTURL$ ;;; ;;; See the file "LICENSE" or ;;; $LICENSEURL$ ;;; for information on usage and redistribution ;;; of this file, and for a DISCLAIMER OF ALL ;;; WARRANTIES. ;;; ;(require 'font-lock) (if (fboundp 'font-lock-add-keywords) (font-lock-add-keywords 'emacs-lisp-mode '(("(\\(setq\\)[ \t]+\\([^ \t\n]+\\)\\>" (1 font-lock-keyword-face) (2 font-lock-variable-name-face))))) (setq font-lock-maximum-decoration t) (defvar ozdoc-face-to-tag-alist '((font-lock-comment-face . comment) (font-lock-keyword-face . keyword) (font-lock-string-face . string) (font-lock-variable-name-face . variable) (font-lock-function-name-face . function) (font-lock-builtin-face . builtin) (font-lock-reference-face . reference) (font-lock-constant-face . reference) (font-lock-type-face . type) (font-lock-warning-face . warning) (nil . text))) (defun ozdoc-face-to-tag (face) (cdr (assq face ozdoc-face-to-tag-alist))) (defun ozdoc-fontify () (let ((in (nth 0 command-line-args-left)) (out (nth 1 command-line-args-left)) (oz-want-font-lock nil) (font-lock-verbose nil)) (ozdoc-fontify-internal in out))) ;;; input file has the following structure: ;;; ;;; ::= * ;;; ::= ;;; ::= ;;; ::= ;;; | * ;;; ::= ^D B ;;; ::= ^D E ;;; ::= ^D T ;;; ::= ^D O ;;; ::= ^D C ;;; here we abstract the details of the scheme ;;; so that it may easily be changed. (defconst ozdoc-mark-begin "\004B") (defconst ozdoc-mark-end "\004E") (defconst ozdoc-mark-text "\004T") (defconst ozdoc-mark-open "\004O") (defconst ozdoc-mark-close "\004C") (defun ozdoc-next-mark () "leaves point in front of next " (skip-chars-forward "^\004")) (defun ozdoc-after-mark () "the point is moved over the " (forward-char 2)) ;;; parse next request in the input buffer (defun ozdoc-parse-request () "should be invoked in the buffer contain the sequence of requests. the point should be positioned at the beginning of a request. the request is parsed and a description of it is returned as a tree and the point is left at the beginning of the next entry. The parsed representation of a request has the form: (MODE SPEC) where MODE is a symbol, and SPEC has the form: (simple P1 P2) or (complex SPEC1 ... SPECn) where P1 and P2 are positions in the request buffer for a span of textual data." (let (start mode spec) (if (not (looking-at ozdoc-mark-begin)) (error "expected begin mark")) (ozdoc-after-mark) (setq start (point)) (ozdoc-next-mark) (setq mode (intern (buffer-substring-no-properties start (point)))) (setq spec (ozdoc-parse-spec)) (if (not (looking-at ozdoc-mark-end)) (error "expected end mark")) (ozdoc-after-mark) (list mode spec))) (defun ozdoc-parse-spec () (cond ((looking-at ozdoc-mark-text) (ozdoc-parse-simple)) ((looking-at ozdoc-mark-open) (ozdoc-parse-complex)) (t (error "expected text or open mark")))) (defun ozdoc-parse-simple () (ozdoc-after-mark) (let ((start (point))) (ozdoc-next-mark) `(simple ,start ,(point)))) (defun ozdoc-parse-complex () (ozdoc-after-mark) (let ((specs nil)) (while (not (looking-at ozdoc-mark-close)) (setq specs (cons (ozdoc-parse-spec) specs))) (ozdoc-after-mark) `(complex ,@(reverse specs)))) ;;; process a spec, inserting corresponding text into the ;;; current buffer (the tmp-buffer). return a new spec where ;;; positions are into the current buffer. (defun ozdoc-install-spec (spec) "takes a parsed SPEC as single arg (see ozdoc-parse-request). The appropriate text is inserted into the current buffer with text properties to encode the structure. The data is taken from src-buffer." (cond ((eq 'simple (car spec)) (ozdoc-install-simple spec)) ((eq 'complex (car spec)) (ozdoc-install-complex spec)) (t (error "bad spec: %S" spec)))) (defun ozdoc-install-simple (request) (let ((p1 (nth 1 request)) (p2 (nth 2 request)) (p (point))) (insert-buffer-substring src-buffer p1 p2) `(simple ,p ,(point)))) (defun ozdoc-install-complex (request) (let ((old-specs (cdr request)) (new-specs nil)) (while old-specs (setq new-specs (cons (ozdoc-install-spec (car old-specs)) new-specs)) (setq old-specs (cdr old-specs))) `(complex ,@(reverse new-specs)))) (defun ozdoc-examine-spec (spec) "takes a SPEC as single arg (see ozdoc-parse-request) and examines the current buffer for face changes in the span corresponding to SPEC. For a simple spec (simple P1 P2), these face changes are returned as an alist: (simple (TAG . STRING) (TAG . STRING) ...) where TAG is a symbol corresponding to the face and STRING is the text that was thus highlighted. For a complex spec, we return (complex SPEC1 ... SPECn) where the result SPECs are obtain by processing the corresponding SPECs in the argument." (cond ((eq (car spec) 'simple) (ozdoc-examine-simple spec)) ((eq (car spec) 'complex) (ozdoc-examine-complex spec)) (t (error "bad spec: %S" spec)))) (defun ozdoc-examine-simple (spec) (let ((p1 (nth 1 spec)) (p2 (nth 2 spec)) (alist nil) face next) (goto-char p1) (while (< (point) p2) (setq face (get-text-property (point) 'face)) (setq next (or (next-single-property-change (point) 'face nil p2) p2)) (setq alist (cons (cons (ozdoc-face-to-tag face) (buffer-substring-no-properties (point) next)) alist)) (goto-char next)) `(simple ,@(reverse alist)))) (defun ozdoc-examine-complex (spec) (let ((specs (cdr spec)) (result nil)) (while specs (setq result (cons (ozdoc-examine-spec (car specs)) result)) (setq specs (cdr specs))) `(complex ,@(reverse result)))) ;;; the output file has the following structure: ;;; ;;; ::= * ;;; ::= ;;; ::= ;;; | ;;; ::= S * ;;; ::= C * ;;; ::= ;;; ;;; in an the first is the face and the 2nd ;;; one the data. (defun ozdoc-output-answer (spec) "inserts into the current buffer a representation of the result spec." (insert ozdoc-mark-begin) (ozdoc-output-spec spec) (insert ozdoc-mark-end)) (defun ozdoc-output-simple (spec) (let ((alist (cdr spec))) (insert ozdoc-mark-open ?S) (while alist (insert ozdoc-mark-text (symbol-name (car (car alist))) ozdoc-mark-text (cdr (car alist))) (setq alist (cdr alist))) (insert ozdoc-mark-close))) (defun ozdoc-output-complex (spec) (let ((specs (cdr spec))) (insert ozdoc-mark-open ?C) (while specs (ozdoc-output-spec (car specs)) (setq specs (cdr specs))) (insert ozdoc-mark-close))) (defun ozdoc-output-spec (spec) (cond ((eq (car spec) 'simple) (ozdoc-output-simple spec)) ((eq (car spec) 'complex) (ozdoc-output-complex spec)) (t (error "bad spec: %S" spec)))) ;;; process one request (defun ozdoc-process-request () "processes one request. must be invoked in src-buffer." (let (request mode spec) (setq request (ozdoc-parse-request)) (save-excursion (set-buffer tmp-buffer) (kill-all-local-variables) (widen) (erase-buffer) (setq mode (car request)) (setq mode (or (and (fboundp mode) mode) (let ((m (intern-soft (format "%s-mode" mode)))) (and m (fboundp m) m)) 'fundamental-mode)) (setq spec (car (cdr request))) (setq spec (ozdoc-install-spec spec)) (funcall mode) (font-lock-fontify-buffer) (setq spec (ozdoc-examine-spec spec)) (set-buffer out-buffer) (goto-char (point-max)) (ozdoc-output-answer spec)))) (defun ozdoc-fontify-internal (in out) (let ((tmp-buffer (get-buffer-create "*ozdoc-tmp*")) (src-buffer (find-file-noselect in t t)) (out-buffer (get-buffer-create "*ozdoc-out*")) ;(coding-system-for-write nil) ;(buffer-file-coding-system nil) ;(file-coding-system-alist nil) (enable-local-variables nil) ) (set-buffer src-buffer) (goto-char (point-min)) (while (not (eobp)) (ozdoc-process-request)) (set-buffer out-buffer) (write-region (point-min) (point-max) out))) ;;; Local Variables: *** ;;; mode: emacs-lisp *** ;;; byte-compile-dynamic-docstrings: nil *** ;;; byte-compile-compatibility: t *** ;;; End: *** --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --=-=-=--