emacs-devel
[Top][All Lists]
Advanced

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

Re: mykie.el


From: Mitchel Humpherys
Subject: Re: mykie.el
Date: Sun, 05 Jan 2014 00:10:23 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

On Fri, Jan 03 2014 at 08:34:01 PM, Stefan Monnier <address@hidden> wrote:
>> Here's an example of context-dependent usage:
>
>> (mykie:global-set-key "C-j"
>>    :default  '(progn
>>                 (delete-trailing-whitespace)
>>                 (case major-mode
>>                   (org-mode (org-return-indent))
>>                   (t        (newline-and-indent))))
>>    :C-u&eolp '(fill-region (point-at-bol) (point-at-eol))
>>    :region   'query-replace-regexp)
>
>> (many other keywords are available, e.g. :prog for activating only in
>> programming modes)
>
> Is that really much better than:
>
>   (global-set-key "\C-j"
>      (lambda ()
>        (interactive)
>        (cond
>         (current-prefix-arg (fill-region (point-at-bol) (point-at-eol)))
>         ((and (use-region-p) (eolp))
>          (call-interactively 'query-replace-regexp))
>         (t
>          (delete-trailing-whitespace)
>          (case major-mode
>            (org-mode (org-return-indent))
>            (t        (newline-and-indent)))))))

Define "better". It's cool that yours is just vanilla Elisp but it took
me about 5 seconds to fully parse the mykie version and about 20 seconds
to fully parse your version.


-- 
Mitch



reply via email to

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