From 1d961563c076854f74cf8c35e83c7f59508d7c12 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 5 Jul 2017 15:19:56 +0200 Subject: [PATCH] Fix #139: no-region error in doom/scratch-buffer --- core/autoload/editor.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core/autoload/editor.el b/core/autoload/editor.el index cb70648bd..fef24037b 100644 --- a/core/autoload/editor.el +++ b/core/autoload/editor.el @@ -225,15 +225,17 @@ for function signatures or notes. Run again to clear the header line." content))))) ;;;###autoload -(defun doom/scratch-buffer (&optional beg end arg) +(defun doom/scratch-buffer (&optional arg) "Opens the scratch buffer in a popup window. If ARG (universal argument) is non-nil, open it in the current window instead of a popup. If a region is active, copy it into the scratch buffer." - (interactive "rP") - (let ((text (and beg end (buffer-substring beg end))) + (interactive "P") + (let ((text (and (region-active-p) + (buffer-substring-no-properties + (region-beginning) (region-end)))) (mode major-mode) (derived-p (derived-mode-p 'prog-mode 'text-mode)) (old-project (doom-project-root))