all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>, help-gnu-emacs@gnu.org
Subject: Re: How to find when a feature was introduced
Date: Fri, 08 Jul 2016 16:33:05 +0000	[thread overview]
Message-ID: <CAFyQvY1ipiNoxOts7nknoOcDr01mZFT7oOPnD-bB32wwBLvFbA@mail.gmail.com> (raw)
In-Reply-To: <831t34k4uj.fsf@gnu.org>

Rustom's question inspired me to come up with this little counsel function
to quickly search through *all* NEWS files. The dependencies are the
'counsel' package and 'ag' executable (below can be adapted to use grep
instead of ag if desired).

It looks like this: http://i.imgur.com/GYT7gln.png

Below code is derived from the counsel-ag implementation in counsel.el:
https://github.com/abo-abo/swiper/blob/4dbd8c30d5bf0bf7154ca39712bf66ab6f580de7/counsel.el#L1442-1476

=====
;; NEWS search
(defun counsel-news-function (regexp)
  "Search in all NEWS files for REGEXP."
  (if (< (length regexp) 3)
      (counsel-more-chars 3)
    (let ((default-directory data-directory)
          (regex (counsel-unquote-regex-parens (setq ivy--old-re
(ivy--regex regexp)))))
      (counsel--async-command
       (format (concat counsel-ag-base-command " -G '/NEWS.*'")
               (shell-quote-argument regex)))
      nil)))

(defun counsel-news (&optional initial-input)
  "Grep for a pattern in regr*list files using ag.
INITIAL-INPUT can be given as the initial minibuffer input."
  (interactive)
  (require 'counsel)
  (setq counsel--git-grep-dir data-directory)
  (ivy-read "Search NEWS: " 'counsel-news-function
            :initial-input initial-input
            :dynamic-collection t
            :history 'counsel-git-grep-history
            :action #'counsel-git-grep-action
            :unwind (lambda ()
                      (counsel-delete-process)
                      (swiper--cleanup))
            :caller 'counsel-news))
=====

I have bound counsel-news to C-h n.

Full code:
https://github.com/kaushalmodi/.emacs.d/blob/master/setup-files/setup-news.el

On Fri, Jul 8, 2016 at 2:44 AM Eli Zaretskii <eliz@gnu.org> wrote:

> > Date: Thu, 7 Jul 2016 21:28:06 -0700 (PDT)
> > From: Rusi <rustompmody@gmail.com>
> >
> > So now I need to tell my students gnu-apl-mode will not run in emacsen
> less than
> > version X
> >
> > How to find out X?
>
> First, try the NEWS method that someone else pointed to.
>
> If that doesn't work, and the symbol is a defcustom, it should have a
> :version tag (if it isn't, report that as a bug).
>
> If that doesn't work either, or is inapplicable, the most elaborate
> method that _always_ works is this:
>
>   . C-h f SOMETHING or C-h v SOMETHING
>   . note the place in the sources where SOMETHING is defined
>   . go to the nearest Emacs Git repository and use Git facilities to
>     find out the date on which the code was added
>   . consult etc/HISTORY to see which Emacs release the date
>     corresponds to
>
> Notes:
> (1) The Git facilities are "git annotate" and "git log -L".
> (2) Due to branching before the release, a date that is before a
> release doesn't necessarily mean the feature was in that release, you
> will have to see when the release branch was cut; there should be a
> Git tag at the branch point.
>
> --

-- 
Kaushal Modi


      reply	other threads:[~2016-07-08 16:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-08  4:28 How to find when a feature was introduced Rusi
2016-07-08  4:41 ` Kaushal Modi
2016-07-08  4:53   ` Paul Rankin
2016-07-08  5:44     ` Drew Adams
2016-07-08 16:40       ` Drew Adams
2016-07-09 18:21         ` Kaushal Modi
     [not found]         ` <mailman.936.1468088520.26859.help-gnu-emacs@gnu.org>
2016-07-10  6:51           ` Rusi
2016-07-08  6:43 ` Eli Zaretskii
2016-07-08 16:33   ` Kaushal Modi [this message]

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

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

  git send-email \
    --in-reply-to=CAFyQvY1ipiNoxOts7nknoOcDr01mZFT7oOPnD-bB32wwBLvFbA@mail.gmail.com \
    --to=kaushal.modi@gmail.com \
    --cc=eliz@gnu.org \
    --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.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.