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

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

Re: require basic stuff from specific packages


From: Emanuel Berg
Subject: Re: require basic stuff from specific packages
Date: Sat, 16 Jul 2016 09:07:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Here is another approach, namely to abandon the
Emacs documentation and help interface and
instead operate directly on the source with
shell tools, i.e. grep.

The advantage is that it works, and even better
perhaps; there is no unsafe `require' just to
get function definitions; and, it is
much faster.

There is also the ease of use advantage because
you can get all Elisp in the world and just
pour it into a directory and there won't be any
conflicts or problems loading or whatever as
it'll just be a bunch of dead text!

All in all, an unusually good solution -
as usual!

(yeah - how *do* you get *all* MELPA and GNU
ELPA code?)

Here is the function:

    double-grep () {
        local first=$1    # e.g., trim   (most unusual concept first!)
        local second=$2   #       string (the the more usual...)

        local context=$3  #  0 => no context: hits must be on same line
        local results=$4  # 10 => show max 10 (double) hits

        local -a files
        files=(address@hidden,-1])  # e.g., ~/sw/emacs24-24.4+1/lisp/**/*.el

        grep       --color=always -C $context $first  $files \
            | grep --color=always             $second        \
            | head -n $results

        # invocation example:
        #
        #   $ cd ~/sw/emacs24-24.4+1/lisp/
        #   $ double-grep trim string 0 10 **/*.el
    }

-- 
underground experts united .... http://user.it.uu.se/~embe8573
Emacs Gnus Blogomatic ......... http://user.it.uu.se/~embe8573/blogomatic
                   - so far: 58 Blogomatic articles -                   


reply via email to

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