[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: shell-command-on-region but with command line arguments
From: |
Emanuel Berg |
Subject: |
Re: shell-command-on-region but with command line arguments |
Date: |
Mon, 07 Nov 2022 18:22:57 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Luca Ferrari wrote:
> (defun fluca1978/run-perl-on-region () [...]
No real need for any -region functions IMO, check this out.
(This, in turn should be integrated in `interactive' and/or
`defun', see the other thread ... `cl-defun' with it's default
values is interesting, in principle we could even decouple
argument docstrings and have all that fully automated except
for the reading and writing parts ...)
(defun use-region ()
(when (use-region-p)
(list (region-beginning) (region-end)) ))
(defun test-dwim (&optional beg end)
(interactive (use-region))
(or beg (setq beg (point-min)))
(or end (setq end (point-max)))
(message "%d %d" beg end) )
https://dataswamp.org/~incal/emacs-init/dwim.el
--
underground experts united
https://dataswamp.org/~incal