Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Andrew <newsgroups.fr@gmail.com>
To: "Микола Стрєбков" <nick@mykola.org>
Cc: Ralf Treinen <treinen@free.fr>, caml-list@inria.fr
Subject: Re: [Caml-list] Underscores, Keywords and Tuareg mode.
Date: Wed, 13 Apr 2011 21:33:32 +0200	[thread overview]
Message-ID: <4DA5FA8C.50403@gmail.com> (raw)
In-Reply-To: <18E3195D-D349-4EF5-BE3C-776DF3BF2306@mykola.org>

On Apr. 13, 2011, Микола Стрєбков <nick@mykola.org> 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\x18\211A\x10@\x19\b\211A\x10@\x1a\b\211A\x10@^[\b\211A\x10@\x1c\b\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.


      reply	other threads:[~2011-04-13 19:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-07  8:28 Andrew
2011-04-13 19:01 ` Ralf Treinen
2011-04-13 19:06   ` Микола Стрєбков
2011-04-13 19:33     ` Andrew [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DA5FA8C.50403@gmail.com \
    --to=newsgroups.fr@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=nick@mykola.org \
    --cc=treinen@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox