[Howm-eng 6] Re: Elisp hyperlinks to action-lock rules

アーカイブの一覧に戻る

khi****@users***** khi****@users*****
Wed Jul 13 19:05:00 JST 2005


At Wed, 13 Jul 2005 03:17:58 -0300,
eduar****@fastm***** 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****@users*****



More information about the Howm-eng mailing list
アーカイブの一覧に戻る