Recent Stories

Last 10 stories:

Announce: mk-project 1.3.1

Version 1.3.1 of mk-project.el is available from github or the Emacs Wiki. David Findlay reported that project-grep and project-ack where running from the project basedir's parent directory, not the project basedir. This behavior was possible on certain versions of Emacs if the project's basedir didn't include a trailing slash -- like this:

(project-def "test-project"
  ((basedir "/home/me/test-project") ; no trailing slash
   ...
   ))

The new version ensures that the trailing slash is appended to basedir when it is used as the default-directory value.

Thanks much to David for the bug report and helping me test potential solutions!

Technorati tags for this post:

Announce: mk-project 1.3

I'm pleased to announce the release of version 1.3 of mk-project. It offers several new features and a bug fix.

Feature: Custom Find Commands

Mk-project uses a "find" command in several scenarios: finding files to pipe to etags (project-tags), finding files to pipe to grep (project-grep) and finding files to index (project-index, project-find-file). Until this release, the find commands used in these situations where calculated using a combination of the "basedir", "src-patterns", "ignore-patterns" and "vcs" project settings. As nice and simple as this scheme was, there was no way to customize these find commands for more complicated project structures. For example, I'm currently working on a project with a very large $basedir/thirdparty directory that I do not want to include in TAGS, grep actions or the project index. With version 1.3, I can specify custom find commands that will omit the thirdparty directory:

(project-def "big-project"
  `((basedir         "~/big-project")
    (src-patterns    ("*.java"))
    (ignore-patterns ("*.class"))
    (src-find-cmd    ,(concat "find ~/big-project \\( -path ~/big-project/thirdparty -prune \\) -o "
                              "\\( -type f -name \"*.java\" -o -print \\)"))
    (grep-find-cmd   "find . -type f | egrep -v thirdparty ")
    (index-find-cmd  (lambda (context) 
                       (concat "find ~/big-project "
                               "\\( -path ~/big-project/thirdparty -prune \\) -o -print")))
    ...))

As you can see, there are 3 new "-find-cmd" project settings. The values can be simple strings specifying a "find" command or a function of 1 argument that returns the find command. The argument will be 'src, 'grep or 'index as appropriate, which allows you to write a single function to generate all 3 find commands if you'd like.

Feature: Relative paths in TAGS files

If your tags-file is located in your basedir (directly in the basedir, not a subdirectory of basedir), the generated TAGS file will now use relative file names. This makes the TAGS file portable. For example, if you copied the basedir to a new location, you could copy the TAGS file to the new directory and it would work without modification.

Feature: Custom ack command name

You can customize the ack-command name for your system. It defaults to "ack.pl" (or "ack" on Windows systems).

Bug Fix

Fixed issue #1: project-ack does not use the "confirmed" command.

...

mk-project.el 1.3 is available from github or the Emacs Wiki.

Technorati tags for this post:

mk-project.el v1.2.1

I've pushed mk-project version 1.2.1 to both the Emacs Wiki and github. It fixes a bug that was preventing mk-project from killing dired buffers open to a project's basedir (or a subdirectory of the basedir) when the project was closed (and the user elects to close all project files). You can now also expect dired buffers belonging to the project to be restored when the project is re-opened.

Thanks much to aleblanc@cotse.net for the bug report and code.

For more info on mk-project, see its homepage.

Technorati tags for this post:

Switching to Atom from RSS

I've added an Atom feed for this blog that carries complete xHTML content. The old RSS feed carries just simple text. I'll leave the RSS feed in place for the time being, but I will likely pull the plug on it in the future.

I've also created an Atom feed that carries just my Emacs-related content. This might be useful for anyone following mk-project happenings.

Both feeds should be auto-discoverable by your browser.

--Matt

Technorati tags for this post:

etags-update: update TAGS when saving a file

Here comes another Emacs post!

I've pushed etags-update to github. It's a global minor mode that updates your TAGS when you save a file. See the README for details.

While we're on the subject of TAGS, I recommend etags-select.el which will show a menu of matching tags when you run etags-select-find-tag (which I've bound to M-.). Very handy.

Technorati tags for this post:

mk-project.el v1.2 -- ido integration

I've pushed version 1.2 of mk-project to github. This version features integration with 'ido'.

From the commit messages:

  • New defcustom mk-proj-use-ido-selection enables ido-completing-read in project-load and project-find-file (for multiple matches)
  • New fn project-find-file-ido allows selection of files using ido methods instead of a regex (as in project-find-file)
  • Small doc improvements

Download mk-project.el from the EmacsWiki or github.

Technorati tags for this post:

mk-project.el v1.1: ack support

I've pushed version 1.1 of mk-project.el (homepage) to github. The library now supports ack which is a cool replacement for the "find ... | xargs grep ..." idiom.

Default arguments to ack can be set per-project via the "ack-args" directive as seen below:

(project-def "my-proj"
      '((basedir          "/home/me/my-proj/")
        (src-patterns     ("*.java" "*.jsp"))
        (ignore-patterns  ("*.class" "*.wsdl"))
        (tags-file        "/home/me/my-proj/TAGS")
        (file-list-cache  "/home/me/.my-proj-files")
        (open-files-cache "/home/me/.my-proj-open-files")
        (vcs              git)
        (compile-cmd      "ant")
        (ack-args         "--java")
        (startup-hook     myproj-startup-hook)
        (shutdown-hook    nil)))

Also new in 1.1, both project-find and project-ack will search from the project's basedir by default, but if given a C-u argument, they will search from the current buffer's directory.

There are several small bug fixes included since version 1.0.3 as well. See the commit log for details.

Technorati tags for this post:

Moved mk-project to github, released v1.0.3

I've separated mk-project from my personal emacs configuration git repository and moved it to github at http://github.com/mattkeller/mk-project.

The code at github is tagged 1.0.3 as I fixed a small bug where the mk-project-open-files-cache variable wasn't reset on project unload.

Technorati tags for this post:

mk-project.el v1.0.2

Thanks to Mihai Bazon for reporting a bug in version 1.0.1 of mk-project. The 'tags-file' directive in project-def should be optional, but Mihai noticed that projects didn't load when they didn't include the directive.

I've uploaded version 1.0.2 to the emacs wiki which includes a fix for the bug and also adds Mercurial support to the library.

Technorati tags for this post:

mk-project.el v1.0.1

I've been working on mk-project.el, my Emacs project library. I wanted to write up the changes I've made.

Bug Fix: Kill TAGS buffer on project-unload

When the project is unloaded, reset the variables use by the tags facility as well as deleting the buffer associated with the project's tags file.

New Feature: Save/restore open files on project-unload/load

When a project is unloaded, store the names of the open project files in a cache file. When loading the project, create buffers for the files listed in the cache file. To enable the feature, specify a cache file with 'open-files-cache' in the project's definition. For example:

(project-def "my-proj"
      '((basedir          "/home/me/my-proj/")
        (src-patterns     ("*.java" "*.jsp"))
        (ignore-patterns  ("*.class" "*.wsdl"))
        (tags-file        "/home/me/my-proj/TAGS")
        (file-list-cache  "/home/me/.my-proj-files")
        (open-files-cache "/home/me/.my-proj-open-files")
        (vcs              git)
        (compile-cmd      "ant")
        (startup-hook     myproj-startup-hook)
        (shutdown-hook    nil)))

New Feature: Version tags in the source

Given that I've already published several versions of this library, I'm a late in adding this. But now the elisp source includes a variable holding the version of the library. The version corresponds to tags in my git repo. I'm calling this version 1.0.1.

Technorati tags for this post:

« earlier :: later »