[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Seeking advice on writing a "line-based" major mode
From: |
Emanuel Berg |
Subject: |
Re: Seeking advice on writing a "line-based" major mode |
Date: |
Thu, 18 Jun 2015 17:57:53 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
Marcin Borkowski <mbork@mbork.pl> writes:
> Fair enough. I was mentioning Dired more to convey
> my needs than as a suggestion that I'd like to
> mimick its implementation - it is far more complex
> than what I need.
I think there are two schools how to do this.
The easiest way and the way I would do it is to just
write an iteration (or recursive) algorithm to
populate the window with data, which will also serve
as the UI.
Simply have a key (e.g., RET) execute an algorithm to
act on the data:
(let ((data (thing-at-point ... )))
(if ( ... data) (action data) ... ))
Last do polishing: font-lock keywords,
(speedified) cursor-movements, etc.
The more advanced way which is more schoolbookish and
ultimately more powerful (but it depends on the
purpose if such power is needed) is to have the UI
window-dressing separated from the logic - which you
instead put in text properties.
Then you can even have the UI format-stringed and have
the user curtain it in whatever way desired, but the
functionality will remain untouched.
--
underground experts united
http://user.it.uu.se/~embe8573
- Seeking advice on writing a "line-based" major mode, Marcin Borkowski, 2015/06/07
- RE: Seeking advice on writing a "line-based" major mode, Drew Adams, 2015/06/07
- Re: Seeking advice on writing a "line-based" major mode, Marcin Borkowski, 2015/06/18
- RE: Seeking advice on writing a "line-based" major mode, Drew Adams, 2015/06/18
- Re: Seeking advice on writing a "line-based" major mode, Marcin Borkowski, 2015/06/18
- RE: Seeking advice on writing a "line-based" major mode, Drew Adams, 2015/06/18
- Re: Seeking advice on writing a "line-based" major mode, Marcin Borkowski, 2015/06/18
- RE: Seeking advice on writing a "line-based" major mode, Drew Adams, 2015/06/18
- Message not available
- Re: Seeking advice on writing a "line-based" major mode, Emanuel Berg, 2015/06/18
Message not available
Re: Seeking advice on writing a "line-based" major mode, Tom Tromey, 2015/06/08