From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p3DJXhil003051 for ; Wed, 13 Apr 2011 21:33:43 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At4BAN35pU1KfVK2imdsb2JhbACmEggUAQEBCgkNBxIGIYhvG545imiCI4U7MIhdAQEDBoVoBI1og297hFw6 X-IronPort-AV: E=Sophos;i="4.64,205,1301868000"; d="scan'208";a="80739804" Received: from mail-wy0-f182.google.com ([74.125.82.182]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 13 Apr 2011 21:33:38 +0200 Received: by wyf23 with SMTP id 23so1420021wyf.27 for ; Wed, 13 Apr 2011 12:33:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=ZxBQ3HElqyZFoKmdFthtkNiEsR4L1ZhHGUEFoIdUeUw=; b=EK91pWmqFF0nblxgPLaht7ZG0/+MMRYPD/O6NJFQPWqcx2QFPaXjTE7GAQqOQYA394 siBlIcIBlhv1ikjqGUUs1H9s7z+0tmzwTnZJK9ysMS/hrg+bhSJ3Ndr0UuPILL2ECjER 03cvLYKIV6nZGIezKZ/mP8jAyfK17oZL1cmjU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=CpXtc0x10Y1no5H/55G75OAfbr/wWPUnqHwVHKUPyI1WiVgcrrSO+YNWkBktYV4EwX 0KmG/fYm2G8l37ocOZLiqbJO4SW9efulEBa1VZZ6oXE1g0yD0gS2e2kJBqmycErrfzYp Ebi9v5NoVOstK+QNAfDjizsC7nJpNPcixfv2s= Received: by 10.227.28.217 with SMTP id n25mr275571wbc.68.1302723216328; Wed, 13 Apr 2011 12:33:36 -0700 (PDT) Received: from [192.168.1.80] ([93.7.165.145]) by mx.google.com with ESMTPS id p5sm534476wbg.45.2011.04.13.12.33.34 (version=SSLv3 cipher=OTHER); Wed, 13 Apr 2011 12:33:35 -0700 (PDT) Message-ID: <4DA5FA8C.50403@gmail.com> Date: Wed, 13 Apr 2011 21:33:32 +0200 From: Andrew User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; fr; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: =?KOI8-U?Q?=ED=C9=CB=CF=CC=C1_=F3=D4=D2=A4=C2=CB=CF=D7?= CC: Ralf Treinen , caml-list@inria.fr References: <4D9D7598.1070802@gmail.com> <20110413190103.GA2598@free.fr> <18E3195D-D349-4EF5-BE3C-776DF3BF2306@mykola.org> In-Reply-To: <18E3195D-D349-4EF5-BE3C-776DF3BF2306@mykola.org> Content-Type: text/plain; charset=KOI8-U; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] Underscores, Keywords and Tuareg mode. On Apr. 13, 2011, íÉËÏÌÁ óÔÒ¤ÂËÏ× wrote: > > On 13 ËצÔ. 2011, at 22:01, Ralf Treinen wrote: > >> Hello, >> >> On Thu, Apr 07, 2011 at 10:28:08AM +0200, Andrew wrote: >> >>> Basically, I can't use the do_list function at the beginning of a >>> line. Whenever I type do, and then press underscore, emacs emits a >>> beep and the underscore is replaces by a white space. The same >>> happens for keywords such as "then", "else", "done". >>> >>> To reproduce, just try to input do_list in Emacs, with tuareg mode enabled. >>> >>> I imagine that this has to do with electric indenting, but, after >>> carefully browsing tuareg source code, I couldn't locate the >>> offending lines. >>> >>> Has any of you come across this problem? Do you know how to solve it? >> >> yes, same here. When I type the underscore (which gets replaced by a blank), >> the message window displays "Wrong type argument: stringp, nil". Seems >> indeed to be a bug. I posted a bug report at https://forge.ocamlcore.org/tracker/index.php?func=detail&aid=950&group_id=43&atid=255 . Here's a stack trace if someone's interested. Debugger entered--Lisp error: (wrong-type-argument stringp nil) looking-at(nil) (let* ((looking-at-matching ...) (extra-unindent ...)) (+ (current-column) (tuareg-add-default-indent ...))) tuareg-compute-kwop-indent-general("do" nil) (cond ((string= kwop "|") (if real-pipe ... ... ...)) ((looking-at "[[{(][<|]?\\|\\.<") (tuareg-compute-paren-indent paren-match-p old-point)) ((string= kwop "with") (when ... ...) (while ... ... ...) (cond ... ... ...)) ((and ... ...) (tuareg-back-to-paren-or-indentation) (if ... ... ...)) ((or ... ...) (if ... ... ...)) ((string= kwop "in") (+ ... ...)) ((not ...) (tuareg-compute-kwop-indent-general kwop matching-kwop)) ((string= matching-kwop "with") (current-column)) (t (tuareg-paren-or-indentation-column))) (let* ((old-point ...) (paren-match-p ...) (real-pipe ...) (matching-kwop ...)) (cond (... ...) (... ...) (... ... ... ...) (... ... ...) (... ...) (... ...) (... ...) (... ...) (t ...))) tuareg-compute-kwop-indent("do") (cond ((tuareg-in-comment-p) (cond ... ... ... ...)) ((tuareg-in-literal-p) (current-column)) ((or ... ...) (if ... ... ...)) ((or ... ...) (tuareg-find-phrase-indentation)) ((and tuareg-sig-struct-align ...) (if ... ... ...)) ((looking-at ";") (tuareg-find-semicolon-match t)) ((looking-at "|!") (tuareg-indent-to-code ... ...)) ((looking-at ">>[=>|]") (tuareg-indent-to-code ... ...)) ((or ... ... ...) 0) ((or ... ... ...) (tuareg-compute-kwop-indent ...)) (t (tuareg-compute-normal-indent))) (save-excursion (cond (... ...) (... ...) (... ...) (... ...) (... ...) (... ...) (... ...) (... ...) (... 0) (... ...) (t ...))) tuareg-compute-indent() (max 0 (tuareg-compute-indent)) (indent-line-to (max 0 (tuareg-compute-indent))) (save-excursion (back-to-indentation) (indent-line-to (max 0 ...))) (progn (save-excursion (back-to-indentation) (indent-line-to ...)) (when (tuareg-in-indentation-p) (back-to-indentation))) (unwind-protect (progn (save-excursion ... ...) (when ... ...)) (modify-syntax-entry 46 "." tuareg-mode-syntax-table) (modify-syntax-entry 95 "_" tuareg-mode-syntax-table)) (progn (modify-syntax-entry 46 "w" tuareg-mode-syntax-table) (modify-syntax-entry 95 "w" tuareg-mode-syntax-table) (unwind-protect (progn ... ...) (modify-syntax-entry 46 "." tuareg-mode-syntax-table) (modify-syntax-entry 95 "_" tuareg-mode-syntax-table))) (tuareg-with-internal-syntax (save-excursion (back-to-indentation) (indent-line-to ...)) (when (tuareg-in-indentation-p) (back-to-indentation))) (let ((case-fold-search nil)) (tuareg-with-internal-syntax (save-excursion ... ...) (when ... ...))) tuareg-indent-command(t) (if point-leading-comment nil (tuareg-indent-command t)) (unless point-leading-comment (tuareg-indent-command t)) (progn (when (and ... ...) (unless ... ...) (setq return-leading t)) (unless point-leading-comment (tuareg-indent-command t))) (if tuareg-electric-indent (progn (when ... ... ...) (unless point-leading-comment ...))) (when tuareg-electric-indent (when (and ... ...) (unless ... ...) (setq return-leading t)) (unless point-leading-comment (tuareg-indent-command t))) (save-excursion (back-to-indentation) (when tuareg-electric-indent (when ... ... ...) (unless point-leading-comment ...))) (let ((point-leading-comment ...) (return-leading nil)) (save-excursion (back-to-indentation) (when tuareg-electric-indent ... ...)) return-leading) tuareg-auto-fill-insert-leading-star() (if from-leading-star nil (tuareg-auto-fill-insert-leading-star)) (unless from-leading-star (tuareg-auto-fill-insert-leading-star)) tuareg-indent-command() indent-according-to-mode() (progn (insert " ") (indent-according-to-mode) (backward-delete-char-untabify 1)) (if kw (progn (insert " ") (indent-according-to-mode) (backward-delete-char-untabify 1))) (when kw (insert " ") (indent-according-to-mode) (backward-delete-char-untabify 1)) (let* ((bol ...) (kw ...)) (when kw (insert " ") (indent-according-to-mode) (backward-delete-char-untabify 1))) (if (tuareg-in-literal-or-comment-p) nil (let* (... ...) (when kw ... ... ...))) (unless (tuareg-in-literal-or-comment-p) (let* (... ...) (when kw ... ... ...))) tuareg-abbrev-hook() abbrev-insert(do #("do" 0 2 (fontified t face font-lock-keyword-face)) 1 3) #[nil "\306 \211\211A@\211A@\211A@\211A@\203) >> This is emacs23, version 23.2+1, tuareg-mode version 2.0.4. The problem >> does not occur with xemacs. > > Problem does not occur. > Emacs 24.0.5, tuareg 2.0.4 Interesting. Emacs 24.05 is in beta, isn't it? Could they have fixed something? I'll try 24.05 as soon as I can. Cheers, Andrew.