* [Howm-eng 6] Re: Elisp hyperlinks to action-lock rules
@ 2005-07-13 10:05 khi
0 siblings, 0 replies; only message in thread
From: khi @ 2005-07-13 10:05 UTC (permalink / raw)
At Wed, 13 Jul 2005 03:17:58 -0300,
eduardoochs at fastmail.fm wrote:
> As there's very little documentation in English I'm trying to
> understand howm's action-lock rules work by reading the source
> code and inspecting the data structures.
To inspect action-lock mechanism, I recommend to try itself without howm.
It can be used independently, and it may be useful for other modes, too.
(1) Open *scratch* and type M-x action-lock-mode.
(2) Write {_}. Underline will appear there.
(3) Move cursor to that {_} and hit RET. Then it will change to [2005-07-13 19:30].
(4) Type M-x action-lock-mode again to turn off that mode.
You can add your own "magic rules".
For example, lets add a new rule that hitting RET on <<hogehoge>>
causes (message "hogehoge").
(setq your-rule (action-lock-general #'message "<<\\(.+\\)>>" 1 0))
;; 1 means first parenthesized expression is passed to `message'.
;; 0 means whole string should be underlined.
(action-lock-add-rules (list your-rule))
You can also write your-rule by hand without action-lock-general.
(setq your-rule
'("<<\\(.+\\)>>"
(lambda (&optional arg) (message (match-string-no-properties 1)))
0))
;; rule = (regexp action) or (regexp action hilit-pos)
;; Action should receive arg from (interactive "P").
Such rules are stored to a buffer local variable `action-lock-rules'.
Its default value is copied from `action-lock-default-rules'.
Howm uses action-lock.el internally for interface of hyperlinks.
("Hyperlinks" in howm are shortcuts of full-text search, indeed.)
If you have further questions or comments, please let me know. :-)
--
khi at users.sourceforge.jp
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-07-13 10:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-13 10:05 [Howm-eng 6] Re: Elisp hyperlinks to action-lock rules khi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).