[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Region argument
From: |
Juri Linkov |
Subject: |
Re: Region argument |
Date: |
Wed, 04 Jan 2017 02:57:08 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (x86_64-pc-linux-gnu) |
>> We could start by having Someoneā¢ "in the know" (hint, hint) describe
>> the new conventions in the ELisp manual.
>
> I remember we discussed a new convention, but I'm not sure if we did end
> up implementing one.
IIRC, the missing piece is just a small function:
(defun region ()
(funcall region-extract-function 'bounds))
to provide all info including former region-beginning and region-end
for ordinary regions as well as a list of boundaries in case of
rectangular regions. Then it could be used in the interactive spec:
(defun occur (regexp &optional nlines region)
(interactive
(nconc (occur-read-primary-args)
(list (and (use-region-p) (region)))))
(occur-1 regexp nlines (list (current-buffer))))
Here nconc for occur-read-primary-args complicates the issue a little,
but in the general case what is needed is only
(interactive (list (and (use-region-p) (region))))