/[emacs]/emacs/lisp/vcursor.el
ViewVC logotype

Diff of /emacs/lisp/vcursor.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by pj, Sun Jul 15 16:15:34 2001 UTC revision 1.11.8.1 by miles, Fri Apr 4 06:20:11 2003 UTC
# Line 93  Line 93 
93  ;; other alternatives (search for "Oemacs").  There is also a keymap  ;; other alternatives (search for "Oemacs").  There is also a keymap
94  ;; which you can bind to a prefix key, which may give some more  ;; which you can bind to a prefix key, which may give some more
95  ;; intuitive alternatives in some cases, see `The vcursor keymap' below.  ;; intuitive alternatives in some cases, see `The vcursor keymap' below.
96  ;;  ;;
97  ;; Holding down control and shift and pressing insert (vcursor-copy)  ;; Holding down control and shift and pressing insert (vcursor-copy)
98  ;; copies one character from wherever the virtual cursor is to point;  ;; copies one character from wherever the virtual cursor is to point;
99  ;; point and the virtual cursor advance in the separate and equal  ;; point and the virtual cursor advance in the separate and equal
100  ;; station to which... (etc.).  M-C-S-return (vcursor-copy-line)  ;; station to which... (etc.).  M-C-S-return (vcursor-copy-line)
101  ;; copies to the end of the line instead of just one character,  ;; copies to the end of the line instead of just one character,
102  ;; C-S-delete or C-S-remove (vcursor-copy-word) copies a word.  ;; C-S-delete or C-S-remove (vcursor-copy-word) copies a word.
103  ;;  ;;
104  ;; A more general way of copying is to use C-S-tab, which is a toggle.  ;; A more general way of copying is to use C-S-tab, which is a toggle.
105  ;; In the "on" state, moving the virtual cursor will copy the  ;; In the "on" state, moving the virtual cursor will copy the
106  ;; moved-over text to the normal cursor position (including when going  ;; moved-over text to the normal cursor position (including when going
# Line 112  Line 112 
112  ;; window.  (See the function (vcursor-find-window) for details of how  ;; window.  (See the function (vcursor-find-window) for details of how
113  ;; this window is chosen.)  This gives you fingertip control over two  ;; this window is chosen.)  This gives you fingertip control over two
114  ;; windows at once.  ;; windows at once.
115  ;;  ;;
116  ;; C-S-return (vcursor-disable) disables the virtual cursor, removing  ;; C-S-return (vcursor-disable) disables the virtual cursor, removing
117  ;; it so that it starts from point whenever you move it again --- note  ;; it so that it starts from point whenever you move it again --- note
118  ;; that simply moving the cursor and virtual cursor on top of one  ;; that simply moving the cursor and virtual cursor on top of one
119  ;; another does not have this effect.  ;; another does not have this effect.
120  ;;  ;;
121  ;; If you give C-S-return a positive prefix arg, it will also delete the  ;; If you give C-S-return a positive prefix arg, it will also delete the
122  ;; window (unless it's the current one).  Whenever the virtual cursor  ;; window (unless it's the current one).  Whenever the virtual cursor
123  ;; goes off-screen in its own window, point in that window is moved as  ;; goes off-screen in its own window, point in that window is moved as
# Line 131  Line 131 
131  ;; remember the current cursor location for examining or copying from  ;; remember the current cursor location for examining or copying from
132  ;; that buffer.  (I just hit C-S-right C-S-left, but I'm a hopeless  ;; that buffer.  (I just hit C-S-right C-S-left, but I'm a hopeless
133  ;; lowbrow.)  ;; lowbrow.)
134  ;;  ;;
135  ;; There is also C-S-f6 (vcursor-other-window) which behaves like  ;; There is also C-S-f6 (vcursor-other-window) which behaves like
136  ;; C-x o on the virtual rather than the real cursor, except that it  ;; C-x o on the virtual rather than the real cursor, except that it
137  ;; will create another window if necessary.  ;; will create another window if necessary.
# Line 220  Line 220 
220  ;;  ;;
221  ;; Key bindings  ;; Key bindings
222  ;; ============  ;; ============
223  ;;  ;;
224  ;; There is an alternative set of key bindings which will be used  ;; There is an alternative set of key bindings which will be used
225  ;; automatically for a PC if Oemacs is detected.  This set uses separate  ;; automatically for a PC if Oemacs is detected.  This set uses separate
226  ;; control, shift and meta keys with function keys 1 to 10.  In  ;; control, shift and meta keys with function keys 1 to 10.  In
# Line 244  Line 244 
244  ;;  ;;
245  ;; If Emacs has set the variable window-system to nil, vcursor will  ;; If Emacs has set the variable window-system to nil, vcursor will
246  ;; assume that overlays cannot be displayed in a different face,  ;; assume that overlays cannot be displayed in a different face,
247  ;; and will instead use an string (the variable vcursor-string, by  ;; and will instead use a string (the variable vcursor-string, by
248  ;; default "**>") to show its position.  This was first implemented  ;; default "**>") to show its position.  This was first implemented
249  ;; in Emacs 19.29.  Unlike the old-fashioned overlay arrow (as used  ;; in Emacs 19.29.  Unlike the old-fashioned overlay arrow (as used
250  ;; by debuggers), this appears between existing text, which can  ;; by debuggers), this appears between existing text, which can
# Line 256  Line 256 
256  ;; get an easy key binding for the vcursor keys on a generic terminal.  ;; get an easy key binding for the vcursor keys on a generic terminal.
257  ;; Consequently a special keymap is defined for you to use traditional  ;; Consequently a special keymap is defined for you to use traditional
258  ;; methods: the keymap, however, is available on any terminal type.  ;; methods: the keymap, however, is available on any terminal type.
259  ;;  ;;
260  ;; The vcursor keymap  ;; The vcursor keymap
261  ;; ==================  ;; ==================
262  ;;  ;;
# Line 285  Line 285 
285  ;; does something else.  To get this effect, set  ;; does something else.  To get this effect, set
286  ;; vcursor-interpret-input to t.  This is normally not a good idea as  ;; vcursor-interpret-input to t.  This is normally not a good idea as
287  ;; interpreting input is very much slower than copying text.  ;; interpreting input is very much slower than copying text.
288  ;;  ;;
289  ;; Un-features  ;; Un-features
290  ;; ===========  ;; ===========
291  ;;  ;;
# Line 403  on loading vcursor and from the customiz Line 403  on loading vcursor and from the customiz
403  ;;; "\M-[\C-f\M-\C-s"   C-S-delete  ;;; "\M-[\C-f\M-\C-s"   C-S-delete
404  ;;; "\M-[\C-f\M-\C-d"   C-S-prior  ;;; "\M-[\C-f\M-\C-d"   C-S-prior
405  ;;; "\M-[\C-fv"         C-S-next  ;;; "\M-[\C-fv"         C-S-next
406  ;;;                        ;;;
407  ;;; "\M-[\C-f^"         C-S-f1  ;;; "\M-[\C-f^"         C-S-f1
408  ;;; "\M-[\C-f_"         C-S-f2  ;;; "\M-[\C-f_"         C-S-f2
409  ;;; "\M-[\C-f`"         C-S-f3  ;;; "\M-[\C-f`"         C-S-f3
# Line 420  on loading vcursor and from the customiz Line 420  on loading vcursor and from the customiz
420      (global-set-key (vcursor-cs-binding "down") 'vcursor-next-line)      (global-set-key (vcursor-cs-binding "down") 'vcursor-next-line)
421      (global-set-key (vcursor-cs-binding "left") 'vcursor-backward-char)      (global-set-key (vcursor-cs-binding "left") 'vcursor-backward-char)
422      (global-set-key (vcursor-cs-binding "right") 'vcursor-forward-char)      (global-set-key (vcursor-cs-binding "right") 'vcursor-forward-char)
423      
424      (global-set-key (vcursor-cs-binding "return") 'vcursor-disable)      (global-set-key (vcursor-cs-binding "return") 'vcursor-disable)
425      (global-set-key (vcursor-cs-binding "insert")  'vcursor-copy)      (global-set-key (vcursor-cs-binding "insert")  'vcursor-copy)
426      (global-set-key (vcursor-cs-binding "delete") 'vcursor-copy-word)      (global-set-key (vcursor-cs-binding "delete") 'vcursor-copy-word)
# Line 433  on loading vcursor and from the customiz Line 433  on loading vcursor and from the customiz
433      (global-set-key (vcursor-cs-binding "down" t) 'vcursor-end-of-buffer)      (global-set-key (vcursor-cs-binding "down" t) 'vcursor-end-of-buffer)
434      (global-set-key (vcursor-cs-binding "prior") 'vcursor-scroll-down)      (global-set-key (vcursor-cs-binding "prior") 'vcursor-scroll-down)
435      (global-set-key (vcursor-cs-binding "next") 'vcursor-scroll-up)      (global-set-key (vcursor-cs-binding "next") 'vcursor-scroll-up)
436      
437      (global-set-key (vcursor-cs-binding "f6") 'vcursor-other-window)      (global-set-key (vcursor-cs-binding "f6") 'vcursor-other-window)
438      (global-set-key (vcursor-cs-binding "f7") 'vcursor-goto)      (global-set-key (vcursor-cs-binding "f7") 'vcursor-goto)
439    
440      (global-set-key (vcursor-cs-binding "select")      (global-set-key (vcursor-cs-binding "select")
441                      'vcursor-swap-point) ; DEC keyboards                      'vcursor-swap-point) ; DEC keyboards
442      (global-set-key (vcursor-cs-binding "tab" t) 'vcursor-swap-point)      (global-set-key (vcursor-cs-binding "tab" t) 'vcursor-swap-point)
443    
444      (global-set-key (vcursor-cs-binding "find")      (global-set-key (vcursor-cs-binding "find")
445                      'vcursor-isearch-forward) ; DEC keyboards                      'vcursor-isearch-forward) ; DEC keyboards
446      (global-set-key (vcursor-cs-binding "f8") 'vcursor-isearch-forward)      (global-set-key (vcursor-cs-binding "f8") 'vcursor-isearch-forward)
447    
# Line 484  characters.  The default is simply to co Line 484  characters.  The default is simply to co
484    :group 'vcursor    :group 'vcursor
485    :version "20.3")    :version "20.3")
486    
487  (defvar vcursor-overlay nil  (defvar vcursor-overlay nil
488    "Overlay for the virtual cursor.    "Overlay for the virtual cursor.
489  It is nil if that is not enabled.")  It is nil if that is not enabled.")
490    
# Line 499  scrolling set this.  It is used by the ` Line 499  scrolling set this.  It is used by the `
499  ;; could do some memq-ing with last-command instead, but this will  ;; could do some memq-ing with last-command instead, but this will
500  ;; automatically handle any new commands using the primitives.  ;; automatically handle any new commands using the primitives.
501    
502  (defcustom vcursor-copy-flag nil  (defcustom vcursor-copy-flag nil
503    "*Non-nil means moving vcursor should copy characters moved over to point."    "*Non-nil means moving vcursor should copy characters moved over to point."
504    :type 'boolean    :type 'boolean
505    :group 'vcursor)    :group 'vcursor)
# Line 547  See vcursor-toggle-vcursor-map.") Line 547  See vcursor-toggle-vcursor-map.")
547  ;; If vcursor-key-bindings is already set on loading, bind the keys now.  ;; If vcursor-key-bindings is already set on loading, bind the keys now.
548  ;; This hybrid way of doing it retains compatibility while allowing  ;; This hybrid way of doing it retains compatibility while allowing
549  ;; customize to work smoothly.  ;; customize to work smoothly.
550  (if vcursor-key-bindings  (if vcursor-key-bindings
551      (vcursor-bind-keys 'vcursor-key-bindings vcursor-key-bindings))      (vcursor-bind-keys 'vcursor-key-bindings vcursor-key-bindings))
552    
553  (defun vcursor-locate ()  (defun vcursor-locate ()
# Line 599  Set `vcursor-window' to the returned val Line 599  Set `vcursor-window' to the returned val
599                 (pos-visible-in-window-p (point) vcursor-window))                 (pos-visible-in-window-p (point) vcursor-window))
600            (progn            (progn
601              (walk-windows              (walk-windows
602               (function               (function
603                (lambda (win)                (lambda (win)
604                  (and (not winok)                  (and (not winok)
605                       (eq (current-buffer) (window-buffer win))                       (eq (current-buffer) (window-buffer win))
# Line 817  Next time you use it, it will start from Line 817  Next time you use it, it will start from
817    
818  With a positive prefix ARG, the first window in cyclic order  With a positive prefix ARG, the first window in cyclic order
819  displaying the virtual cursor (or which was recently displaying the  displaying the virtual cursor (or which was recently displaying the
820  virutal cursor) will be deleted unless it's the selected  virtual cursor) will be deleted unless it's the selected
821  window.  window.
822    
823  With a negative prefix argument, enable the virtual cursor: make it  With a negative prefix argument, enable the virtual cursor: make it
# Line 845  not copy text until you turn it on again Line 845  not copy text until you turn it on again
845    
846  (defun vcursor-other-window (n &optional all-frames)  (defun vcursor-other-window (n &optional all-frames)
847    "Activate the virtual cursor in another window.    "Activate the virtual cursor in another window.
848  This is the next window cylically after one currently showing the  This is the next window cyclically after one currently showing the
849  virtual cursor, or else after the current selected window.  If there  virtual cursor, or else after the current selected window.  If there
850  is no other window, the current window is split.  is no other window, the current window is split.
851    
# Line 1124  line is treated like ordinary characters Line 1124  line is treated like ordinary characters
1124  (defun vcursor-toggle-vcursor-map (&optional force noredisp)  (defun vcursor-toggle-vcursor-map (&optional force noredisp)
1125    "Toggle the state of the vcursor key map.    "Toggle the state of the vcursor key map.
1126  When on, the keys defined in it are mapped directly on top of the main  When on, the keys defined in it are mapped directly on top of the main
1127  keymap,  allowing you to move the vcursor with ordinary motion keys.  keymap, allowing you to move the vcursor with ordinary motion keys.
1128  An indication \"!VC\" appears in the mode list.  The effect is  An indication \"!VC\" appears in the mode list.  The effect is
1129  local to the current buffer.  local to the current buffer.
1130  With prefix FORCE, turn on, or off if it is 0.  With prefix FORCE, turn on, or off if it is 0.

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.11.8.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26