Skip to content

Commit

Permalink
add runemacs in Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen Bin committed Jul 2, 2022
1 parent 38ebbc2 commit b258f96
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -45,5 +45,7 @@ Session.vim
.netrwhist
*~

deps/

TAGS
tags
8 changes: 7 additions & 1 deletion Makefile
@@ -1,7 +1,8 @@
SHELL = /bin/sh
EMACS ?= emacs
PROFILER =
EMACS_BATCH_OPTS=--batch -Q -l find-file-in-project.el
EMACS_GENERIC_OPTS=-Q -L . -L deps/ivy-0.13.4
EMACS_BATCH_OPTS:=--batch $(EMACS_GENERIC_OPTS)
RM = @rm -rf

.PHONY: test clean test compile
Expand All @@ -18,3 +19,8 @@ compile: clean
# Run tests.
test: compile
@$(EMACS) $(EMACS_BATCH_OPTS) -l tests/ffip-tests.el

runemacs:
@mkdir -p deps;
@if [ ! -f deps/ivy-0.13.4/ivy.el ]; then curl -L https://stable.melpa.org/packages/ivy-0.13.4.tar | tar x -C deps/; fi;
@$(EMACS) $(EMACS_GENERIC_OPTS) --load ./tests/emacs-init.el
3 changes: 2 additions & 1 deletion README.org
Expand Up @@ -20,7 +20,8 @@ Diff/patch files. Target files could be under any Version Control Software (VCS)
*Screenshot:*

[[https://raw.githubusercontent.com/redguardtoo/find-file-in-project/master/ffip-screenshot-nq8.png]]

* Try it
Run =make runemacs= in this project's root directory. The demo works out of box.
* Install
Place [[https://raw.githubusercontent.com/redguardtoo/find-file-in-project/master/find-file-in-project.el][find-file-in-project.el]] under [[https://www.emacswiki.org/emacs/LoadPath][Load Path]]. Then add =(require 'find-file-in-project)= to your configuration.

Expand Down
17 changes: 17 additions & 0 deletions tests/emacs-init.el
@@ -0,0 +1,17 @@
(require 'find-file-in-project)
(require 'ivy)
(ivy-mode 1)
(setq ffip-match-path-instead-of-filename t)
(run-with-idle-timer
1
nil
(lambda ()
(erase-buffer)
(goto-char (point-min))
(insert
";; Setup of this demo,\n"
"(setq ffip-match-path-instead-of-filename t)\n\n\n"
";; Run \"M-x find-file-in-project-by-selected\" and input search keyword \"el\" or \"tests\".\n\n\n"
";; Move cursor above below paths and run \"M-x find-file-in-project-at-point\",\n\n"
";; tests/ffip-tests.el ; open file directly \n"
";; find-file-in-project.el:50 ; open file and jump to line 50\n")))

0 comments on commit b258f96

Please sign in to comment.