unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: require basic stuff from specific packages
Date: Sat, 16 Jul 2016 09:07:18 +0200	[thread overview]
Message-ID: <868tx2rrh5.fsf@student.uu.se> (raw)
In-Reply-To: mailman.1377.1468465957.26859.help-gnu-emacs@gnu.org

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=($@[5,-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 -                   


  parent reply	other threads:[~2016-07-16  7:07 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-03 23:13 require basic stuff from specific packages Emanuel Berg
2016-07-04  8:10 ` Stefan Monnier
2016-07-04  8:31 ` Lars Magne Ingebrigtsen
2016-07-05  0:44   ` Emanuel Berg
2016-07-13  1:26     ` Howard Melman
2016-07-13  1:58       ` Drew Adams
     [not found]       ` <mailman.1251.1468375187.26859.help-gnu-emacs@gnu.org>
2016-07-13  2:11         ` Emanuel Berg
     [not found]     ` <mailman.1248.1468373420.26859.help-gnu-emacs@gnu.org>
2016-07-13  2:06       ` Emanuel Berg
2016-07-13 13:31         ` Howard Melman
2016-07-13 14:10           ` Drew Adams
     [not found]         ` <mailman.1273.1468416740.26859.help-gnu-emacs@gnu.org>
2016-07-13 13:40           ` Emanuel Berg
2016-07-13 15:13             ` Drew Adams
     [not found]             ` <mailman.1301.1468422827.26859.help-gnu-emacs@gnu.org>
2016-07-13 16:07               ` Emanuel Berg
2016-07-13 16:16                 ` Kaushal Modi
2016-07-13 16:19                   ` Kaushal Modi
2016-07-13 16:41                     ` Drew Adams
2016-07-13 16:25                 ` Drew Adams
     [not found]                 ` <mailman.1322.1468427133.26859.help-gnu-emacs@gnu.org>
2016-07-13 19:24                   ` Emanuel Berg
2016-07-14  3:12                     ` Howard Melman
     [not found]                     ` <mailman.1377.1468465957.26859.help-gnu-emacs@gnu.org>
2016-07-15  1:49                       ` Emanuel Berg
2016-07-16  7:07                       ` Emanuel Berg [this message]
2016-07-19 20:43                         ` EB double-grep function for bash Tomas Nordin
2016-07-14  1:35                   ` require basic stuff from specific packages Emanuel Berg
2016-08-09 14:16 ` Udyant Wig
2016-08-10 15:39   ` Emanuel Berg
2016-08-10 15:51     ` Drew Adams
2016-08-10 17:54     ` Udyant Wig
2016-08-10 19:43       ` Emanuel Berg
2016-08-11  5:38         ` Udyant Wig
2016-08-11 14:49           ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=868tx2rrh5.fsf@student.uu.se \
    --to=embe8573@student.uu.se \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).