help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Emacs standards with regions


From: Richard Riley
Subject: Emacs standards with regions
Date: Mon, 24 Nov 2008 16:03:46 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Is there some reason that most emacs commands do not consider active
region when invoked? One of the biggest UI improvements (for me) would
be for interactive commands to default to the marked region.

e.g C-s  for isearch-forward

Hilite "word" and "word" is the default search term. Ditto for % (search
and replace). I just modified my py-execute-buffer for example to call
py-execute-region with the marked region rather than the entire buffer
if the region was active. Why have a seperate "execute-region" command?

The ignoring of the region in so many key commands makes we wonder if I
am missnig a default setting or if there was a decision not to use the
region.

e.g this Google search function I use defaults

,----
| (defun rgr/google-search-prompt()
|   (interactive)
|   (let* ((default (region-or-word-at-point))
|        (term (read-string (format "Google the web for the following phrase 
(%s): "
|                                     default))))
|     (message "term is %s. Length is %d" term (length term))
|     (rgr/google (if (zerop(length term)) default term))
|     ))
`----


Can anyone add to this?



-- 
 important and urgent problems of the technology of today are no longer the 
satisfactions of the primary needs or of archetypal wishes, but the reparation 
of the evils and damages by the technology of yesterday.  ~Dennis Gabor, 
Innovations:  Scientific, Technological and Social, 1970


reply via email to

[Prev in Thread] Current Thread [Next in Thread]