emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: CUA property not set for multiple functions


From: Kim F. Storm
Subject: Re: CUA property not set for multiple functions
Date: Mon, 26 Sep 2005 13:47:34 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

M Jared Finder <address@hidden> writes:

> cua-mode requires any movement function's symbol to have the CUA
> property be set to the symbol move. (See cua--pre-command-handler-1.)
>
> All movement functions that come bundled with Emacs should work
> correctly with CUA.  

Right, but only _commands_ need to have the CUA property -- and some
of the forward-* _functions_ you mentioned are not commands.

Also, you only need to handle command which are bound to some key
where using the <shift> key together with that key makes sense (to
CUA).

So typically only commands bound to a single key-stroke, e.g. <up> or
<C-a> need the CUA property.

Of the forward- functions listed above, only forward-list and
forward-sexp fulfill these requirements.

>                      Executing the following code listed 494 symbols
> that need to have the CUA property set:

Really ?

First of all, you should only test commands, and then you
should look for commands bound to single keys, i.e.

 (let ((move-symbols '()))
    (do-all-symbols (symbol)
      (ignore-errors
        (when (and (commandp symbol)
                   (= (length (where-is-internal symbol nil t)) 1)
                   (string-match "move" (documentation symbol))
                   (not (eq (get symbol 'CUA) 'move)))
          (push symbol move-symbols))))
      move-symbols)

This reduces the list to the following 30 candidates:

down-list mark-word find-tag-regexp kmacro-end-call-mouse
mouse-yank-at-click mouse-set-point capitalize-word
toggle-require-final-newline search-forward mark-sexp isearch-forward
back-to-indentation end-of-defun forward-list downcase-word
artist-mode mouse-drag-secondary upcase-word
beginning-of-buffer-other-window mouse-drag-region dabbrev-expand
backward-up-list forward-sexp backward-list reposition-window
mouse-yank-secondary end-of-buffer-other-window ifill-prefix-handler
backward-sexp beginning-of-defun

This list can be further reduced to:

down-list
mark-word
search-forward
mark-sexp
back-to-indentation
end-of-defun
forward-list
backward-up-list
forward-sexp
backward-list
backward-sexp
beginning-of-defun

I will add CUA properties for these in CVS.


You may argue that if a user binds one of the other commands that may
be regarded as a CUA movement command to a single key, CUA will not
work for that key -- which is true, but then the user will have to add
the necessary CUA property too.  I don't want to "pollude" the sources
with properties that are only needed in theory.  But if you know of
some specific commands where it may be relevant, pls. tell me and I
will consider them case by case.

Thanks for bringing this to my attention.

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

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