unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Extra arg in interactive?
@ 2007-07-06  9:45 zslevin
  2007-07-07 13:06 ` Richard Stallman
  0 siblings, 1 reply; 2+ messages in thread
From: zslevin @ 2007-07-06  9:45 UTC (permalink / raw)
  To: emacs-devel

I find it handy in string input to use the region string if it is active, or 
read from user if it is not.

So I usually have:
  (interactive "Mphrase: \n")

replaced with:

  (interactive (list (or (and mark-active
			transient-mark-mode
			(buffer-substring-no-properties
			 (region-beginning)
			 (region-end)))
		   (read-string "phrase: "))))

If an extra arg in interactive does this as well, that saves lots of work.

Thank you
-Levin

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Extra arg in interactive?
  2007-07-06  9:45 Extra arg in interactive? zslevin
@ 2007-07-07 13:06 ` Richard Stallman
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Stallman @ 2007-07-07 13:06 UTC (permalink / raw)
  To: zslevin; +Cc: emacs-devel

    I find it handy in string input to use the region string if it is active, or 
    read from user if it is not.

For some commands, this could be natural.  But there are commands
for which it doesn't make sense, such as write-region.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-07-07 13:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-06  9:45 Extra arg in interactive? zslevin
2007-07-07 13:06 ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).