There is a function in ESS called ess-sas-goto-log (https://github.com/emacs-ess/ESS/blob/master/lisp/ess-sas-a.el#L705) that will open a log file and search forward using re-search-forward. I would like to make a version that searches backwards. What would be the best way to go about this?
I know I can simply replace search-forward with search-backward but I would like to do it the proper way.
Thanks!
advice
if at all possible, and everyone (but me) seems to love/up-vote that approach. A small handful of people post answers that use(require 'name-of-library)
followed by the new revised function with the same name so that the old function gets redefined. And there are a small minority of people who might create a new function and usedefalias
. – lawlist Sep 2 '16 at 15:31cl-letf
: emacs.stackexchange.com/a/22571/2287 I have a comment underneath the answer that demonstrates how I applied it to my particular use-case. I don't see a lot of answers using that, perhaps because it is a little advanced -- but it sure is nifty (in my opinion). On another note, there is a very important distinction betweensearch-forward
versusre-search-forward
andsearch-backward
versusre-search-backward
. One uses a literal string, whereas the other searches by a regexp. – lawlist Sep 2 '16 at 15:53