emacs-devel
[Top][All Lists]
Advanced

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

Extra arg in interactive?


From: zslevin
Subject: Extra arg in interactive?
Date: Fri, 6 Jul 2007 17:45:17 +0800
User-agent: KMail/1.9.7

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




reply via email to

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