Skip to content

Commit

Permalink
Remove arguments from 'webpaste-paste-buffer-or-region'
Browse files Browse the repository at this point in the history
Since (interactive "r") fails when starting Emacs (or creating new buffers,
perhaps?) with the following error message:

  execute-extended-command: The mark is not set now, so there is no region

Since this commit changes the function arguments, it might break some existing
calls from Elisp, and this might not be worth it.
  • Loading branch information
8dcc committed Nov 25, 2024
1 parent ac5f40e commit 7c56be8
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions webpaste.el
Original file line number Diff line number Diff line change
Expand Up @@ -618,15 +618,14 @@ Argument MARK Current mark."


;;;###autoload
(cl-defun webpaste-paste-buffer-or-region (&optional point mark)
"Paste current buffer or selected region to some paste service.
Takes optional POINT and MARK to paste a region."
(interactive "r")
(cl-defun webpaste-paste-buffer-or-region ()
"Paste current buffer or selected region to some paste service."
(interactive)

;; if region is selected
(if (region-active-p)
;; Paste selected region
(webpaste-paste-region point mark)
(webpaste-paste-region (region-beginning) (region-end))
;; Else, Paste buffer
(webpaste-paste-buffer)))

Expand Down

0 comments on commit 7c56be8

Please sign in to comment.