speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

OT: Actually Implementing the Email Ideas, Trying to Learn Elisp


From: Milan Zamazal
Subject: OT: Actually Implementing the Email Ideas, Trying to Learn Elisp
Date: Mon, 25 Aug 2008 18:47:49 +0200

>>>>> "VT" == Veli-Pekka T?til? <vtatila at gmail.com> writes:

    VT> My NMTP server doesn't carry gnu.emacs but using a free server I
    VT> found in an on-line DB, seems to show that there's not much
    VT> traffic there. Otherwise that group would be the ideal media to
    VT> post this in.

The proper Usenet group is gnu.emacs.help, also available as a mailing
list and on Gmane as gmane.emacs.help.  It's a group with frequent
postings and perfectly fit for your questions (those not related to
accessibility and speech output).

    VT> Now the hardest part is learning enough Elisp and understanding
    VT> enough Emacs, to be able to do a new major mode for e-mail
    VT> re-quoting, navigation an deletion as described in my original
    VT> post. 

What you actually want is more likely a few additional commands added to
mail-mode-map or message-mode-map.

    VT> My question here would be, is there a middle ground between
    VT> macroes and good old Elisp hacking? Can I, for example, turn
    VT> macroes into lisp code and only add some conditions and loops as
    VT> needed?

If you speak about _keyboard_ macros then probably not although there
may exist an extension package doing it.

    VT> * easily getting the names of functions Emacs calls when I hit a
    VT> key, maybe put them in the kill ring directly.

`C-h c', `C-h k' + you can define keyboard macros for putting it into
keyring if you like.

    VT> * fancier operations such as temporarily setting the fill
    VT> prefix, word wrap column etc..., doing some prefix filling and
    VT> getting back to normal again.

I don't know more about them than Emacs manual does!

    VT> * How to do major or minor modes, or modify an existing one
    VT> Are there short tutorials that would only let me know the bare
    VT> minimum to get a thing like this done? 

Defining major and minor modes is very well described in Elisp manual.
Of course you can't do reasonable Elisp programming without knowing
Elisp and there is naturally no shortcut here.

    VT> I still have a similar attitude to LIsp than I have with Python,
    VT> heavily disliking its syntax compared to Ruby and Lua.

I'm afraid the only things that can help you here are either deep
understanding or sudden enlightenment :-).  If it doesn't happen, don't
worry, many programmers are unable to reach any of the two states :-).

    VT> IS there anything that would make the Lisp syntax more nicer to
    VT> listen to? A friend of mine suggested pauses between list items
    VT> and in stead of reading parentheses, mapping the nesting level
    VT> to musical pitch, in a user definable scale with a monotone
    VT> intonation. That let us into thinking Lisp songs analogously
    VT> with Perl poetry.

Cool idea :-).  

When using Festival, you can map sounds to parentheses, e.g. increasing
sound for opening parenthesis and decreasing sound for closing one.  See
festival-freebsoft-utils package
(http://www.freebsoft.org/festival-freebsoft-utils) for more details.

As for signalling nesting level, it might be possible to implement it,
but I don't think it would be that useful.  I think it would be better
if speechd-el spoke what's the corresponding opening part of an
expression after typing its closing parenthesis (Emacs does it visually
but speechd-el is silent during this operation).  Do you think such a
feature would be more useful?

BTW, keyboard macro performing `C-M-b' + 'C-M-f' may be helpful.

    VT> When I think of how to achieve things in Emacs I think in terms
    VT> of keyboard commands, that are actually interactive functions
    VT> bound to them. To kill a region that's well defined by a regexp
    VT> and some cursoring in lines, however, would require that the
    VT> macro can pause and check for a condition before it does a
    VT> deletion. The same thing applise to jumps when you consider
    VT> navigation. It would be far easier for me to work mostly with
    VT> macroes and do a minimum of actual lisp coding at this point,
    VT> bad laziness! Obviously, no conditionals are doable in macroes -
    VT> I've read that section of the Emacs manual.

I'm afraid this is true.

    VT> First of all, consider getting the quote level and index of
    VT> unquoted text, 

[...]

    VT> Then to navigate to a particular quoting level, 

[...]

    VT> Then for killing stuff quickly, one has to identify a branch of
    VT> quotes in a discussion 

If you look for a cheap way you *might* achieve something by dynamically
changing definitions of paragraph boundaries, see "Paragraphs" section
in Emacs manual.

Just to illustrate how to figure out quoting level of the current line:

  (defun my-quoting-level ()
    (save-excursion
      (forward-line 0)
      (looking-at "^[ \t]*\\(>*\\)")
      (length (match-string 1))))

    VT> One final bit of code could be used to unquote mail before
    VT> rewrapping and filling. 

`M-q' should do the right thing in mail buffers even when quotation
marks are present.

Regards,

Milan Zamazal



reply via email to

[Prev in Thread] Current Thread [Next in Thread]