emacs cl refactoring bookmarks org mode etc
- From: Antony <remove+spam_lisp.linux@xxxxxxxxx>
- Date: Wed, 25 Jan 2012 12:29:15 -0800
Hi
Just some elisp code that got me so excited I wanted to share :)
Here's what got me to write this code:
I am about to start a refactor of some of my CL code to add some functionality. This would need me to navigate to a couple of files to a couple of functions and make some notes about how I am going to change them. Essentially build a work plan to execute with links to the appropriate places.
Plain emacs bookmarks don't work cause they have no descriptive context.
Standard org mode has no help in creating the navigable bookmarks easily.
So I came up with the following after googling for the appropriate parts
(defun qqqq-org-bookmark-selection ()
"generate a org mode bookmark to current selection and copy to kill ring"
(interactive)
;;first set standard bookmark just for fun
(bookmark-set (buffer-substring-no-properties (mark) (point)))
;;create a org mode bookmark and copy to kill
(kill-new (concat "[[file:"
(file-truename buffer-file-name)
"::"
(buffer-substring-no-properties (mark) (point))
"]["
(buffer-substring-no-properties (mark) (point))
"]]"
)))
Then I can create work plan file that looks pretty inside a org mode buffer (stupid example follows)
To make magic happen add extra argument to [[file:/thirdparty/hunchentoot/easy-handlers.lisp::defun compute-array-parameter][defun compute-array-parameter]]
and then change [[file:/thirdparty/hunchentoot/log.lisp::defmacro with-log-stream][defmacro with-log-stream]]
The only issue I have is -
when I run it as
M-x qqqq-org-bookmark-selection
it works without prompting for anything which is what I want
But if I rebind
(add-hook 'lisp-mode-hook
(lambda ()
(local-set-key (kbd "C-x r m") 'qqqq-org-bookmark-selection)
and run it using C-x r m
it starts prompting for the bookmark description.
Any help on fixing that
-Antony
.
- Follow-Ups:
- Re: emacs cl refactoring bookmarks org mode etc
- From: Antony
- Re: emacs cl refactoring bookmarks org mode etc
- Prev by Date: Re: Case with a string
- Next by Date: Mustache render library from a new lisper - request for comments
- Previous by thread: PHOTONUKE - DAILY POST
- Next by thread: Re: emacs cl refactoring bookmarks org mode etc
- Index(es):