Fix #139: no-region error in doom/scratch-buffer
This commit is contained in:
parent
bc10afb284
commit
1d961563c0
1 changed files with 5 additions and 3 deletions
|
@ -225,15 +225,17 @@ for function signatures or notes. Run again to clear the header line."
|
||||||
content)))))
|
content)))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun doom/scratch-buffer (&optional beg end arg)
|
(defun doom/scratch-buffer (&optional arg)
|
||||||
"Opens the scratch buffer in a popup window.
|
"Opens the scratch buffer in a popup window.
|
||||||
|
|
||||||
If ARG (universal argument) is non-nil, open it in the current window instead of
|
If ARG (universal argument) is non-nil, open it in the current window instead of
|
||||||
a popup.
|
a popup.
|
||||||
|
|
||||||
If a region is active, copy it into the scratch buffer."
|
If a region is active, copy it into the scratch buffer."
|
||||||
(interactive "rP")
|
(interactive "P")
|
||||||
(let ((text (and beg end (buffer-substring beg end)))
|
(let ((text (and (region-active-p)
|
||||||
|
(buffer-substring-no-properties
|
||||||
|
(region-beginning) (region-end))))
|
||||||
(mode major-mode)
|
(mode major-mode)
|
||||||
(derived-p (derived-mode-p 'prog-mode 'text-mode))
|
(derived-p (derived-mode-p 'prog-mode 'text-mode))
|
||||||
(old-project (doom-project-root))
|
(old-project (doom-project-root))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue