Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

font-lock-fontify-buffer crashes on gitit doc #155

Closed
conal opened this issue Jul 25, 2016 · 4 comments
Closed

font-lock-fontify-buffer crashes on gitit doc #155

conal opened this issue Jul 25, 2016 · 4 comments

Comments

@conal
Copy link

conal commented Jul 25, 2016

The following Markdown doc crashes mmm-mode breaks mmm-mode:


---
title: gitit doc
...


```
ham
```

More than three hyphens below, and (font-lock-fontify-buffer) crashes.
----

Note that in gitit pages, meta-data blocks end with three dots, not three hyphens.

I first encountered this issue when using markdown-mode with mmm-mode. I submitted an mmm-mode issue, but it appears to be independent of mmm-mode, and indeed can be triggered by font-lock-fontify-buffer.

I'm running markdown-mode version 2.1 from MELPA.

Backtrace:

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  markdown-match-inline-generic("\\(?:\\`\\|[^\\]\\)\\(\\(`+\\)\\(\\(?:.\\|\n[^\n]\\)*?[^`]\\)\\(\\2\\)\\)\\(?:[^`]\\|\\'\\)" 130)
  markdown-match-code(130)
  font-lock-fontify-keywords-region(1 130 nil)
  font-lock-default-fontify-region(1 130 nil)
  font-lock-fontify-region(1 130 nil)
  byte-code("\212\303 �\304\216\305ed   #\210\306 \210\307\211�+\207" [save-match-data-internal verbose font-lock-fontified match-data ((byte-code "\301�\302\"\207" [save-match-data-internal set-match-data evaporate] 3)) font-lock-fontify-region font-lock-after-fontify-buffer t] 4)
  font-lock-default-fontify-buffer()
  eval((font-lock-default-fontify-buffer) nil)
  eval-expression((font-lock-default-fontify-buffer) nil)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)
@syohex
Copy link
Collaborator

syohex commented Jul 25, 2016

I cannot reproduce this issue on Emacs 24.5 and development Emacs. Can you reproduce this issue with latest version ?

And could you tell us how to reproduce this issue in more detail ?

  • Emacs version
  • Minimum configuration
  • etc

@conal
Copy link
Author

conal commented Jul 25, 2016

@syohex I just tried again and didn't get the error. However, this one (as used by mmm-mode) does:

(font-lock-fontify-region (point-min) (point-max))

Okay when the last line has only three hyphens, but crashes on four.

I also fixed the formatting in my issue report above, to clarify that the "More than" and "---" lines are part of the test case.

The following Emacs startup code suffices for me to provoke the error:

(setq debug-on-error t)

(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
(package-initialize)

(require 'markdown-mode)

emacs-version tells me:

GNU Emacs 24.5.1 (x86_64-apple-darwin15.4.0, NS apple-appkit-1404.46) of 2016-06-17 on 80e65028ef76

@conal
Copy link
Author

conal commented Jul 25, 2016

It does seem that there may be some connection to mmm-mode to trigger this problem in ordinary operation. I'm not sure that I've gotten to the heart of it. More information here.

To see the problematic interaction between mmm-mode and markdown-mode, the following Emacs init code suffices for me:

(setq debug-on-error t)

(require 'package)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
(package-initialize)

(package-install 'markdown-mode)
(package-install 'mmm-mode)

(require 'markdown-mode)
(require 'mmm-mode)

To trigger the error, visit the markdown example given above, and do M-x mmm-mode-on.

@syohex
Copy link
Collaborator

syohex commented Aug 4, 2016

Please reopen if you still have problem.

@syohex syohex closed this as completed Aug 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants