Topic: https://brettterpstra.com/marked-bonus-pack-fix-and-marked-1-3-progress/
hide preview

What's next? verify your email address for reply notifications!

Pattulus 13y, 173d ago

Wow. Thanks in advance for the upcoming update and for making an already great prodcut even better! I'd love to have a CSSEdit alternative and keep the code in editor and the preview in another. I guess this will be splendid.

hide preview

What's next? verify your email address for reply notifications!

Markus 13y, 173d ago

I'm scratching my head about the Lion Fullscreen feature. Is this not defeating the object, having a preview next to your Editor?

remark link
hide preview

What's next? verify your email address for reply notifications!

Brett 13y, 173d ago

I'm with you, but it's been frequently requested and it was one checkbox to flip, so I went ahead and did it.

hide preview

What's next? verify your email address for reply notifications!

Donald Curtis 13y, 173d ago

I'm sure you probably do not care about Emacs enough to want to deal with maintaing code for it but just for reference in case other nerds are using Emacs,

Emacs is heavy into using scratch buffers which are still in markdown-mode but don't actually have a file on the disk. So you don't want to allow this function to be called on those buffers. Thus you need to make sure it's visiting a file.

(defun markdown-preview-file ()
"Open the current file (if visiting one) in Marked."
(interactive)
(when (buffer-file-name)
(shell-command (concat "open -a Marked.app " (shell-quote-argument buffer-file-name)))))

Second, you shouldn't set a global key for this. Keybindings are supposed to be mode specific in most cases and it makes sense since there is a markdown-mode that it should be bound in that mode,

(eval-after-load 'markdown-mode
'(define-key markdown-mode-map (kbd "C-c m") 'markdown-pandoc))

or if you only use text-mode you could do,

(define-key text-mode-map (kbd "C-c m") 'markdown-preview-file)

And as a footnote if you want to make markdown-mode the default for txt files you can do,

(setq auto-mode-alist
(cons '("\\.txt" . markdown-mode) auto-mode-alist))
hide preview

What's next? verify your email address for reply notifications!

Chris Lawrence 13y, 173d ago

Thanks so much Brett, this has fixed my issue with TextEdit opening. It feels much snappier to me as well.

hide preview

What's next? verify your email address for reply notifications!

Doug 13y, 173d ago

Thanks for the update. Looking forward to 1.3. I use Marked multiple times a day.

hide preview

What's next? verify your email address for reply notifications!