Skip to content

Instantly share code, notes, and snippets.

@mdsib
Last active April 12, 2017 00:43
Show Gist options
  • Save mdsib/a8658207297bbe50c516cded105c13d0 to your computer and use it in GitHub Desktop.
Save mdsib/a8658207297bbe50c516cded105c13d0 to your computer and use it in GitHub Desktop.
Creates a keybinding that links to the most recently edited file of a directory.
@mdsib
Copy link
Author

mdsib commented Apr 12, 2017

hi - I think this is exactly what I need! unfortunately executing results in 'Symbol's function definition is void: lexical-let"
With debugger 'on':
Debugger entered--Lisp error: (void-function lexical-let)
EDIT - just found out I needed to add (require 'cl)

Yeah, that's part of cl. All it's doing is allowing that dir parameter from ms-insert-newest-file to be used in the lambda function it's returning. You can see in the initial gist I used to just create the function in global-set-key. You can do that if you don't want to include cl.

I'm going to remove the relative filename conversion and append "file:" to the link, that should put the generated link in the correct format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment