Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Wow, this is fantastic! This is exactly what I'm looking for! How can I also make this specific to ess-r-mode, do I just need to change all references to this-mode? Commented Jun 1, 2023 at 13:43
  • If you want the created buffer to always be in ess-r-mode, yes, just directly put ess-r-mode instead of this-mode. If what you want is being able to call this-mode-scratch only in ess-r-mode, you can use (define-key ess-r-mode-map (kbd "C-c n") 'this-mode-scratch). Commented Jun 1, 2023 at 16:55
  • If you need always the same mode the function can be simpler, see edit Commented Jun 1, 2023 at 17:33