caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Underscores, Keywords and Tuareg mode.
@ 2011-04-07  8:28 Andrew
  2011-04-13 19:01 ` Ralf Treinen
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew @ 2011-04-07  8:28 UTC (permalink / raw)
  To: caml-list

Hi all,

I've noticed a somewhat annoying bug in Emacs Tuareg mode, but before reporting it as such I thought I'd better ask, to 
ensure that it's not a misconfiguration on my side.

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?
Thanks!
Andrew

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Underscores, Keywords and Tuareg mode.
  2011-04-07  8:28 [Caml-list] Underscores, Keywords and Tuareg mode Andrew
@ 2011-04-13 19:01 ` Ralf Treinen
  2011-04-13 19:06   ` Микола Стрєбков
  0 siblings, 1 reply; 4+ messages in thread
From: Ralf Treinen @ 2011-04-13 19:01 UTC (permalink / raw)
  To: Andrew; +Cc: caml-list

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.

This is emacs23, version 23.2+1, tuareg-mode version 2.0.4. The problem
does not occur with xemacs.

-Ralf.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Underscores, Keywords and Tuareg mode.
  2011-04-13 19:01 ` Ralf Treinen
@ 2011-04-13 19:06   ` Микола Стрєбков
  2011-04-13 19:33     ` Andrew
  0 siblings, 1 reply; 4+ messages in thread
From: Микола Стрєбков @ 2011-04-13 19:06 UTC (permalink / raw)
  To: Ralf Treinen; +Cc: Andrew, caml-list


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.
> 
> 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

-- 
Mykola Stryebkov
Public key: http://mykola.org/pubkey.txt
fpr: 0226 54EE C1FF 8636 36EF  2AC9 BCE9 CFC7 9CF4 6747



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Caml-list] Underscores, Keywords and Tuareg mode.
  2011-04-13 19:06   ` Микола Стрєбков
@ 2011-04-13 19:33     ` Andrew
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew @ 2011-04-13 19:33 UTC (permalink / raw)
  To: Микола
	Стрєбков
  Cc: Ralf Treinen, caml-list

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.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-04-13 19:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-07  8:28 [Caml-list] Underscores, Keywords and Tuareg mode Andrew
2011-04-13 19:01 ` Ralf Treinen
2011-04-13 19:06   ` Микола Стрєбков
2011-04-13 19:33     ` Andrew

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).