[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to find when a feature was introduced
From: |
Kaushal Modi |
Subject: |
Re: How to find when a feature was introduced |
Date: |
Fri, 08 Jul 2016 16:33:05 +0000 |
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
Re: How to find when a feature was introduced, Eli Zaretskii, 2016/07/08
- Re: How to find when a feature was introduced,
Kaushal Modi <=