[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
simple useful functions
From: |
Stephen J. Turnbull |
Subject: |
simple useful functions |
Date: |
Fri, 29 Oct 2010 12:39:38 +0900 |
Tak Ota writes:
> If you think the following two functions are universally useful please
> consider incorporating them in simple.el or any appropriate package.
> If not disregard.
>
> -Tak
>
> (defun collect-string (regexp &optional num)
> "Collect strings of REGEXP (or optional NUM paren) from the
> current buffer into a collection buffer."
What does this do that M-x occur doesn't do? Could it be added to
occur or to occur-mode?
> (defun source (script &optional shell keep-current-directory)
> "Source the specified shell script.
> Source the shell SCRIPT and import the environment into this
> emacs. The optional SHELL specifies the shell other than the
> default `shell-file-name'. When KEEP-CURRENT-DIRECTORY is nil,
> which is the default, the current directory is temporarily
> changed to the directory where the script resides while sourcing
> the script."
Probably this should be in the "shell-" namespace.
I can see why the side effect of importing the environment might be
useful, but I think that should be explicit in the name.
> (call-process shell nil t nil "-c" (concat "source " script ";
> printenv"))
Isn't "." rather than "source" the portable idiom here?
- simple useful functions, Tak Ota, 2010/10/28
- simple useful functions,
Stephen J. Turnbull <=
- Re: simple useful functions, Tak Ota, 2010/10/29
- RE: simple useful functions, Drew Adams, 2010/10/29
- Re: simple useful functions, Andreas Schwab, 2010/10/29
- RE: simple useful functions, Drew Adams, 2010/10/29
- Re: simple useful functions, Andreas Schwab, 2010/10/29
- Re: simple useful functions, Chad Brown, 2010/10/29
- RE: simple useful functions, Drew Adams, 2010/10/29
- RE: simple useful functions, Stephen J. Turnbull, 2010/10/30
- Re: simple useful functions, Thierry Volpiatto, 2010/10/30
Re: simple useful functions, Andreas Schwab, 2010/10/29