summaryrefslogtreecommitdiff
path: root/lisp/emulation
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emulation')
-rw-r--r--lisp/emulation/crisp.el4
-rw-r--r--lisp/emulation/cua-base.el72
-rw-r--r--lisp/emulation/cua-gmrk.el5
-rw-r--r--lisp/emulation/cua-rect.el13
-rw-r--r--lisp/emulation/edt-lk201.el1
-rw-r--r--lisp/emulation/edt-mapper.el1
-rw-r--r--lisp/emulation/edt-pc.el1
-rw-r--r--lisp/emulation/edt-vt100.el1
-rw-r--r--lisp/emulation/edt.el347
-rw-r--r--lisp/emulation/pc-select.el12
-rw-r--r--lisp/emulation/tpu-edt.el2
-rw-r--r--lisp/emulation/tpu-extras.el131
-rw-r--r--lisp/emulation/tpu-mapper.el1
-rw-r--r--lisp/emulation/vip.el16
-rw-r--r--lisp/emulation/viper-cmd.el62
-rw-r--r--lisp/emulation/viper-ex.el3
-rw-r--r--lisp/emulation/viper-init.el11
-rw-r--r--lisp/emulation/viper-keym.el1
-rw-r--r--lisp/emulation/viper-macs.el1
-rw-r--r--lisp/emulation/viper-mous.el1
-rw-r--r--lisp/emulation/viper-util.el3
-rw-r--r--lisp/emulation/viper.el1
-rw-r--r--lisp/emulation/ws-mode.el310
23 files changed, 437 insertions, 563 deletions
diff --git a/lisp/emulation/crisp.el b/lisp/emulation/crisp.el
index 09e48b0a4c1..f3145227dfa 100644
--- a/lisp/emulation/crisp.el
+++ b/lisp/emulation/crisp.el
@@ -175,7 +175,7 @@ All the bindings are done here instead of globally to try and be
nice to the world.")
(defcustom crisp-mode-modeline-string " *CRiSP*"
- "*String to display in the modeline when CRiSP emulation mode is enabled."
+ "String to display in the modeline when CRiSP emulation mode is enabled."
:type 'string
:group 'crisp)
@@ -195,7 +195,7 @@ use either M-x customize or the function `crisp-mode'."
:group 'crisp)
(defcustom crisp-override-meta-x t
- "*Controls overriding the normal Emacs M-x key binding in the CRiSP emulator.
+ "Controls overriding the normal Emacs M-x key binding in the CRiSP emulator.
Normally the CRiSP emulator rebinds M-x to `save-buffers-exit-emacs', and
provides the usual M-x functionality on the F10 key. If this variable
is non-nil, M-x will exit Emacs."
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index e590d09b783..cf7d8510d89 100644
--- a/lisp/emulation/cua-base.el
+++ b/lisp/emulation/cua-base.el
@@ -270,7 +270,7 @@
:link '(emacs-library-link :tag "Lisp File" "cua-base.el"))
(defcustom cua-enable-cua-keys t
- "*Enable using C-z, C-x, C-c, and C-v for undo, cut, copy, and paste.
+ "Enable using C-z, C-x, C-c, and C-v for undo, cut, copy, and paste.
If the value is t, these mappings are always enabled. If the value is
`shift', these keys are only enabled if the last region was marked with
a shifted movement key. If the value is nil, these keys are never
@@ -281,18 +281,18 @@ enabled."
:group 'cua)
(defcustom cua-remap-control-v t
- "*If non-nil, C-v binding is used for paste (yank).
+ "If non-nil, C-v binding is used for paste (yank).
Also, M-v is mapped to `cua-repeat-replace-region'."
:type 'boolean
:group 'cua)
(defcustom cua-remap-control-z t
- "*If non-nil, C-z binding is used for undo."
+ "If non-nil, C-z binding is used for undo."
:type 'boolean
:group 'cua)
(defcustom cua-highlight-region-shift-only nil
- "*If non-nil, only highlight region if marked with S-<move>.
+ "If non-nil, only highlight region if marked with S-<move>.
When this is non-nil, CUA toggles `transient-mark-mode' on when the region
is marked using shifted movement keys, and off when the mark is cleared.
But when the mark was set using \\[cua-set-mark], Transient Mark mode
@@ -300,9 +300,8 @@ is not turned on."
:type 'boolean
:group 'cua)
-(defcustom cua-prefix-override-inhibit-delay
- (if (featurep 'lisp-float-type) (/ (float 1) (float 5)) nil)
- "*If non-nil, time in seconds to delay before overriding prefix key.
+(defcustom cua-prefix-override-inhibit-delay 0.2
+ "If non-nil, time in seconds to delay before overriding prefix key.
If there is additional input within this time, the prefix key is
used as a normal prefix key. So typing a key sequence quickly will
inhibit overriding the prefix key.
@@ -315,7 +314,7 @@ If the value is nil, use a shifted prefix key to inhibit the override."
:group 'cua)
(defcustom cua-delete-selection t
- "*If non-nil, typed text replaces text in the active selection."
+ "If non-nil, typed text replaces text in the active selection."
:type '(choice (const :tag "Disabled" nil)
(other :tag "Enabled" t))
:group 'cua)
@@ -326,13 +325,13 @@ If the value is nil, use a shifted prefix key to inhibit the override."
:group 'cua)
(defcustom cua-toggle-set-mark t
- "*If non-nil, the `cua-set-mark' command toggles the mark."
+ "If non-nil, the `cua-set-mark' command toggles the mark."
:type '(choice (const :tag "Disabled" nil)
(other :tag "Enabled" t))
:group 'cua)
(defcustom cua-auto-mark-last-change nil
- "*If non-nil, set implicit mark at position of last buffer change.
+ "If non-nil, set implicit mark at position of last buffer change.
This means that \\[universal-argument] \\[cua-set-mark] will jump to the position
of the last buffer change before jumping to the explicit marks on the mark ring.
See `cua-set-mark' for details."
@@ -340,7 +339,7 @@ See `cua-set-mark' for details."
:group 'cua)
(defcustom cua-enable-register-prefix 'not-ctrl-u
- "*If non-nil, registers are supported via numeric prefix arg.
+ "If non-nil, registers are supported via numeric prefix arg.
If the value is t, any numeric prefix arg in the range 0 to 9 will be
interpreted as a register number.
If the value is `not-ctrl-u', using C-u to enter a numeric prefix is not
@@ -354,29 +353,29 @@ interpreted as a register number."
:group 'cua)
(defcustom cua-delete-copy-to-register-0 t
- "*If non-nil, save last deleted region or rectangle to register 0."
+ "If non-nil, save last deleted region or rectangle to register 0."
:type 'boolean
:group 'cua)
(defcustom cua-enable-region-auto-help nil
- "*If non-nil, automatically show help for active region."
+ "If non-nil, automatically show help for active region."
:type 'boolean
:group 'cua)
(defcustom cua-enable-modeline-indications nil
- "*If non-nil, use minor-mode hook to show status in mode line."
+ "If non-nil, use minor-mode hook to show status in mode line."
:type 'boolean
:group 'cua)
(defcustom cua-check-pending-input t
- "*If non-nil, don't override prefix key if input pending.
+ "If non-nil, don't override prefix key if input pending.
It is rumoured that `input-pending-p' is unreliable under some window
managers, so try setting this to nil, if prefix override doesn't work."
:type 'boolean
:group 'cua)
(defcustom cua-paste-pop-rotate-temporarily nil
- "*If non-nil, \\[cua-paste-pop] only rotates the kill-ring temporarily.
+ "If non-nil, \\[cua-paste-pop] only rotates the kill-ring temporarily.
This means that both \\[yank] and the first \\[yank-pop] in a sequence always insert
the most recently killed text. Each immediately following \\[cua-paste-pop] replaces
the previous text with the next older element on the `kill-ring'.
@@ -388,7 +387,7 @@ recent \\[yank-pop] (or \\[yank]) command."
;;; Rectangle Customization
(defcustom cua-virtual-rectangle-edges t
- "*If non-nil, rectangles have virtual straight edges.
+ "If non-nil, rectangles have virtual straight edges.
Note that although rectangles are always DISPLAYED with straight edges, the
buffer is NOT modified, until you execute a command that actually modifies it.
M-p toggles this feature when a rectangle is active."
@@ -396,7 +395,7 @@ M-p toggles this feature when a rectangle is active."
:group 'cua)
(defcustom cua-auto-tabify-rectangles 1000
- "*If non-nil, automatically tabify after rectangle commands.
+ "If non-nil, automatically tabify after rectangle commands.
This basically means that `tabify' is applied to all lines that
are modified by inserting or deleting a rectangle. If value is
an integer, CUA will look for existing tabs in a region around
@@ -428,7 +427,7 @@ and after the region marked by the rectangle to search."
:group 'cua)
(defcustom cua-rectangle-modifier-key 'meta
- "*Modifier key used for rectangle commands bindings.
+ "Modifier key used for rectangle commands bindings.
On non-window systems, always use the meta modifier.
Must be set prior to enabling CUA."
:type '(choice (const :tag "Meta key" meta)
@@ -438,27 +437,27 @@ Must be set prior to enabling CUA."
:group 'cua)
(defcustom cua-enable-rectangle-auto-help t
- "*If non-nil, automatically show help for region, rectangle and global mark."
+ "If non-nil, automatically show help for region, rectangle and global mark."
:type 'boolean
:group 'cua)
(defface cua-rectangle
'((default :inherit region)
(((class color)) :foreground "white" :background "maroon"))
- "*Font used by CUA for highlighting the rectangle."
+ "Font used by CUA for highlighting the rectangle."
:group 'cua)
(defface cua-rectangle-noselect
'((default :inherit region)
(((class color)) :foreground "white" :background "dimgray"))
- "*Font used by CUA for highlighting the non-selected rectangle lines."
+ "Font used by CUA for highlighting the non-selected rectangle lines."
:group 'cua)
;;; Global Mark Customization
(defcustom cua-global-mark-keep-visible t
- "*If non-nil, always keep global mark visible in other window."
+ "If non-nil, always keep global mark visible in other window."
:type 'boolean
:group 'cua)
@@ -466,11 +465,11 @@ Must be set prior to enabling CUA."
'((((min-colors 88)(class color)) :foreground "black" :background "yellow1")
(((class color)) :foreground "black" :background "yellow")
(t :bold t))
- "*Font used by CUA for highlighting the global mark."
+ "Font used by CUA for highlighting the global mark."
:group 'cua)
(defcustom cua-global-mark-blink-cursor-interval 0.20
- "*Blink cursor at this interval when global mark is active."
+ "Blink cursor at this interval when global mark is active."
:type '(choice (number :tag "Blink interval")
(const :tag "No blink" nil))
:group 'cua)
@@ -479,7 +478,7 @@ Must be set prior to enabling CUA."
;;; Cursor Indication Customization
(defcustom cua-enable-cursor-indications nil
- "*If non-nil, use different cursor colors for indications."
+ "If non-nil, use different cursor colors for indications."
:type 'boolean
:group 'cua)
@@ -517,7 +516,7 @@ a cons (TYPE . COLOR), then both properties are affected."
:group 'cua)
(defcustom cua-read-only-cursor-color "darkgreen"
- "*Cursor color used in read-only buffers, if non-nil.
+ "Cursor color used in read-only buffers, if non-nil.
Only used when `cua-enable-cursor-indications' is non-nil.
If the value is a COLOR name, then only the `cursor-color' attribute will be
@@ -541,7 +540,7 @@ a cons (TYPE . COLOR), then both properties are affected."
:group 'cua)
(defcustom cua-overwrite-cursor-color "yellow"
- "*Cursor color used when overwrite mode is set, if non-nil.
+ "Cursor color used when overwrite mode is set, if non-nil.
Only used when `cua-enable-cursor-indications' is non-nil.
If the value is a COLOR name, then only the `cursor-color' attribute will be
@@ -565,7 +564,7 @@ a cons (TYPE . COLOR), then both properties are affected."
:group 'cua)
(defcustom cua-global-mark-cursor-color "cyan"
- "*Indication for active global mark.
+ "Indication for active global mark.
Will change cursor color to specified color if string.
Only used when `cua-enable-cursor-indications' is non-nil.
@@ -780,6 +779,10 @@ Repeating prefix key when region is active works as a single prefix key."
(setq mark-active nil)
(run-hooks 'deactivate-mark-hook)))
+(defun cua--filter-buffer-noprops (start end)
+ (let ((str (filter-buffer-substring start end)))
+ (set-text-properties 0 (length str) nil str)
+ str))
;; The current register prefix
(defvar cua--register nil)
@@ -1039,8 +1042,7 @@ of text."
(setq s (car u))
(setq s (car u) e (cdr u)))))))
(cond ((and s e (<= s e) (= s (mark t)))
- (setq cua--repeat-replace-text
- (filter-buffer-substring s e nil t)))
+ (setq cua--repeat-replace-text (cua--filter-buffer-noprops s e)))
((and (null s) (eq u elt)) ;; nothing inserted
(setq cua--repeat-replace-text
""))
@@ -1436,10 +1438,13 @@ If ARG is the atom `-', scroll upward by nearly full screen."
(define-key cua-global-keymap [remap yank-pop] 'cua-paste-pop)
;; set mark
(define-key cua-global-keymap [remap set-mark-command] 'cua-set-mark)
+ (define-key cua-global-keymap [remap exchange-point-and-mark] 'cua-exchange-point-and-mark)
;; scrolling
(define-key cua-global-keymap [remap scroll-up] 'cua-scroll-up)
(define-key cua-global-keymap [remap scroll-down] 'cua-scroll-down)
+ (define-key cua-global-keymap [remap scroll-up-command] 'cua-scroll-up)
+ (define-key cua-global-keymap [remap scroll-down-command] 'cua-scroll-down)
(define-key cua--cua-keys-keymap [(control x) timeout] 'kill-region)
(define-key cua--cua-keys-keymap [(control c) timeout] 'copy-region-as-kill)
@@ -1448,7 +1453,6 @@ If ARG is the atom `-', scroll upward by nearly full screen."
(when cua-remap-control-v
(define-key cua--cua-keys-keymap [(control v)] 'yank)
(define-key cua--cua-keys-keymap [(meta v)] 'cua-repeat-replace-region))
- (define-key cua--cua-keys-keymap [remap exchange-point-and-mark] 'cua-exchange-point-and-mark)
(define-key cua--prefix-override-keymap [(control x)] 'cua--prefix-override-handler)
(define-key cua--prefix-override-keymap [(control c)] 'cua--prefix-override-handler)
@@ -1492,6 +1496,8 @@ If ARG is the atom `-', scroll upward by nearly full screen."
(dolist (cmd
'(forward-char backward-char
+ right-char left-char
+ right-word left-word
next-line previous-line
forward-word backward-word
end-of-line beginning-of-line
@@ -1499,6 +1505,7 @@ If ARG is the atom `-', scroll upward by nearly full screen."
move-end-of-line move-beginning-of-line
end-of-buffer beginning-of-buffer
scroll-up scroll-down
+ scroll-up-command scroll-down-command
up-list down-list backward-up-list
end-of-defun beginning-of-defun
forward-sexp backward-sexp
@@ -1629,5 +1636,4 @@ shifted movement key, set `cua-highlight-region-shift-only'."
(provide 'cua-base)
-;; arch-tag: 21fb6289-ba25-4fee-bfdc-f9fb351acf05
;;; cua-base.el ends here
diff --git a/lisp/emulation/cua-gmrk.el b/lisp/emulation/cua-gmrk.el
index a7fe1e27a5d..d02d4b9cdcd 100644
--- a/lisp/emulation/cua-gmrk.el
+++ b/lisp/emulation/cua-gmrk.el
@@ -5,6 +5,7 @@
;; Author: Kim F. Storm <storm@cua.dk>
;; Keywords: keyboard emulations convenience cua mark
+;; Package: cua-base
;; This file is part of GNU Emacs.
@@ -137,7 +138,7 @@ With prefix argument, don't jump to global mark when cancelling it."
(let ((src-buf (current-buffer)))
(save-excursion
(if (equal (marker-buffer cua--global-mark-marker) src-buf)
- (let ((text (filter-buffer-substring start end nil t)))
+ (let ((text (cua--filter-buffer-noprops start end)))
(goto-char (marker-position cua--global-mark-marker))
(insert text))
(set-buffer (marker-buffer cua--global-mark-marker))
@@ -161,7 +162,7 @@ With prefix argument, don't jump to global mark when cancelling it."
(if (and (< start (marker-position cua--global-mark-marker))
(< (marker-position cua--global-mark-marker) end))
(message "Can't move region into itself")
- (let ((text (filter-buffer-substring start end nil t))
+ (let ((text (cua--filter-buffer-noprops start end))
(p1 (copy-marker start))
(p2 (copy-marker end)))
(goto-char (marker-position cua--global-mark-marker))
diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el
index 7f6067f573e..1d8fdcd1af5 100644
--- a/lisp/emulation/cua-rect.el
+++ b/lisp/emulation/cua-rect.el
@@ -5,6 +5,7 @@
;; Author: Kim F. Storm <storm@cua.dk>
;; Keywords: keyboard emulations convenience CUA
+;; Package: cua-base
;; This file is part of GNU Emacs.
@@ -625,7 +626,7 @@ If command is repeated at same position, delete the rectangle."
(if (not (cua--rectangle-virtual-edges))
(cua--rectangle-operation nil nil nil nil nil ; do not tabify
'(lambda (s e l r)
- (setq rect (cons (filter-buffer-substring s e nil t) rect))))
+ (setq rect (cons (cua--filter-buffer-noprops s e) rect))))
(cua--rectangle-operation nil 1 nil nil nil ; do not tabify
'(lambda (s e l r v)
(let ((copy t) (bs 0) (as 0) row)
@@ -643,7 +644,7 @@ If command is repeated at same position, delete the rectangle."
(setq as (- r (max (current-column) l))
e (point)))
(setq row (if (and copy (> e s))
- (filter-buffer-substring s e nil t)
+ (cua--filter-buffer-noprops s e)
""))
(when (> bs 0)
(setq row (concat (make-string bs ?\s) row)))
@@ -1124,12 +1125,12 @@ The length of STRING need not be the same as the rectangle width."
'(lambda (s e l r)
(cond
((re-search-forward "0x\\([0-9a-fA-F]+\\)" e t)
- (let* ((txt (filter-buffer-substring (match-beginning 1) (match-end 1) nil t))
+ (let* ((txt (cua--filter-buffer-noprops (match-beginning 1) (match-end 1)))
(n (string-to-number txt 16))
(fmt (format "0x%%0%dx" (length txt))))
(replace-match (format fmt (+ n increment)))))
((re-search-forward "\\( *-?[0-9]+\\)" e t)
- (let* ((txt (filter-buffer-substring (match-beginning 1) (match-end 1) nil t))
+ (let* ((txt (cua--filter-buffer-noprops (match-beginning 1) (match-end 1)))
(prefix (if (= (aref txt 0) ?0) "0" ""))
(n (string-to-number txt 10))
(fmt (format "%%%s%dd" prefix (length txt))))
@@ -1344,7 +1345,7 @@ With prefix arg, indent to that column."
pad)
(if (bolp)
nil
- (delete-backward-char 1)
+ (delete-char -1)
(if (cua--rectangle-right-side t)
(cua--rectangle-insert-col (current-column))
(setq indent (- l (current-column))))))
@@ -1432,6 +1433,8 @@ With prefix arg, indent to that column."
(define-key cua--rectangle-keymap [remap beginning-of-buffer] 'cua-resize-rectangle-top)
(define-key cua--rectangle-keymap [remap scroll-down] 'cua-resize-rectangle-page-up)
(define-key cua--rectangle-keymap [remap scroll-up] 'cua-resize-rectangle-page-down)
+ (define-key cua--rectangle-keymap [remap scroll-down-command] 'cua-resize-rectangle-page-up)
+ (define-key cua--rectangle-keymap [remap scroll-up-command] 'cua-resize-rectangle-page-down)
(define-key cua--rectangle-keymap [remap delete-backward-char] 'cua-delete-char-rectangle)
(define-key cua--rectangle-keymap [remap backward-delete-char] 'cua-delete-char-rectangle)
diff --git a/lisp/emulation/edt-lk201.el b/lisp/emulation/edt-lk201.el
index eb9a75bcac9..6183946ee94 100644
--- a/lisp/emulation/edt-lk201.el
+++ b/lisp/emulation/edt-lk201.el
@@ -6,6 +6,7 @@
;; Author: Kevin Gallagher <Kevin.Gallagher@boeing.com>
;; Maintainer: Kevin Gallagher <Kevin.Gallagher@boeing.com>
;; Keywords: emulations
+;; Package: edt
;; This file is part of GNU Emacs.
diff --git a/lisp/emulation/edt-mapper.el b/lisp/emulation/edt-mapper.el
index 64120686f24..87359af665f 100644
--- a/lisp/emulation/edt-mapper.el
+++ b/lisp/emulation/edt-mapper.el
@@ -6,6 +6,7 @@
;; Author: Kevin Gallagher <Kevin.Gallagher@boeing.com>
;; Maintainer: Kevin Gallagher <Kevin.Gallagher@boeing.com>
;; Keywords: emulations
+;; Package: edt
;; This file is part of GNU Emacs.
diff --git a/lisp/emulation/edt-pc.el b/lisp/emulation/edt-pc.el
index b775ec438b5..f896b7d30bc 100644
--- a/lisp/emulation/edt-pc.el
+++ b/lisp/emulation/edt-pc.el
@@ -6,6 +6,7 @@
;; Author: Kevin Gallagher <Kevin.Gallagher@boeing.com>
;; Maintainer: Kevin Gallagher <Kevin.Gallagher@boeing.com>
;; Keywords: emulations
+;; Package: edt
;; This file is part of GNU Emacs.
diff --git a/lisp/emulation/edt-vt100.el b/lisp/emulation/edt-vt100.el
index 59ff1e6e5de..23c4f4e8f66 100644
--- a/lisp/emulation/edt-vt100.el
+++ b/lisp/emulation/edt-vt100.el
@@ -6,6 +6,7 @@
;; Author: Kevin Gallagher <Kevin.Gallagher@boeing.com>
;; Maintainer: Kevin Gallagher <Kevin.Gallagher@boeing.com>
;; Keywords: emulations
+;; Package: edt
;; This file is part of GNU Emacs.
diff --git a/lisp/emulation/edt.el b/lisp/emulation/edt.el
index 3e746cb0346..52b083da6a1 100644
--- a/lisp/emulation/edt.el
+++ b/lisp/emulation/edt.el
@@ -1,4 +1,4 @@
-;;; edt.el --- enhanced EDT keypad mode emulation for GNU Emacs 19
+;;; edt.el --- enhanced EDT keypad mode emulation for GNU Emacs
;; Copyright (C) 1986, 1992, 1993, 1994, 1995, 2000, 2001, 2002, 2003,
;; 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
@@ -27,7 +27,7 @@
;;; Commentary:
;;
-;; This is Version 4.0 of the EDT Emulation for Emacs 19 and above.
+;; This is Version 4.0 of the EDT Emulation for Emacs.
;; It comes with special functions which replicate nearly all of EDT's
;; keypad mode behavior. It sets up default keypad and function key
;; bindings which closely match those found in EDT. Support is
@@ -88,8 +88,8 @@
;; settings for that session.
;;
;; NOTE: Another way to set the scroll margins is to use the
-;; Emacs customization feature (not available in Emacs 19) to set
-;; the following two variables directly:
+;; Emacs customization feature to set the following two variables
+;; directly:
;;
;; edt-top-scroll-margin and edt-bottom-scroll-margin
;;
@@ -193,7 +193,7 @@
;;;
(defcustom edt-keep-current-page-delimiter nil
- "*Emacs MUST be restarted for a change in value to take effect!
+ "Emacs MUST be restarted for a change in value to take effect!
Non-nil leaves Emacs value of `page-delimiter' unchanged within EDT
Emulation. If set to nil (the default), the `page-delimiter' variable
is set to \"\\f\" when edt-emulation-on is first invoked. This
@@ -203,7 +203,7 @@ is restored when edt-emulation-off is called."
:group 'edt)
(defcustom edt-use-EDT-control-key-bindings nil
- "*Emacs MUST be restarted for a change in value to take effect!
+ "Emacs MUST be restarted for a change in value to take effect!
Non-nil causes the control key bindings to be replaced with EDT
bindings. If set to nil (the default), EDT control key bindings are
not used and the current Emacs control key bindings are retained for
@@ -212,7 +212,7 @@ use within the EDT emulation."
:group 'edt)
(defcustom edt-word-entities '(?\t)
- "*Specifies the list of EDT word entity characters.
+ "Specifies the list of EDT word entity characters.
The default list, (\?\\t), contains just the TAB character, which
emulates EDT. Characters are specified in the list using their
decimal ASCII values. A question mark, followed by the actual
@@ -237,14 +237,14 @@ will be treated as if it were a separate word."
:group 'edt)
(defcustom edt-top-scroll-margin 10
- "*Scroll margin at the top of the screen.
+ "Scroll margin at the top of the screen.
Interpreted as a percent of the current window size with a default
setting of 10%. If set to 0, top scroll margin is disabled."
:type 'integer
:group 'edt)
(defcustom edt-bottom-scroll-margin 15
- "*Scroll margin at the bottom of the screen.
+ "Scroll margin at the bottom of the screen.
Interpreted as a percent of the current window size with a default
setting of 15%. If set to 0, bottom scroll margin is disabled."
:type 'integer
@@ -666,6 +666,25 @@ Argument NUM is the number of lines to move."
(goto-char (point-max))
(edt-line-to-bottom-of-window))
+(defmacro edt-with-position (&rest body)
+ "Execute BODY with some position-related variables bound."
+ `(let* ((left nil)
+ (beg (edt-current-line))
+ (height (window-height))
+ (top-percent
+ (if (zerop edt-top-scroll-margin) 10 edt-top-scroll-margin))
+ (bottom-percent
+ (if (zerop edt-bottom-scroll-margin) 15 edt-bottom-scroll-margin))
+ (top-margin (/ (* height top-percent) 100))
+ (bottom-up-margin (1+ (/ (* height bottom-percent) 100)))
+ (bottom-margin (max beg (- height bottom-up-margin 1)))
+ (top (save-excursion (move-to-window-line top-margin) (point)))
+ (bottom (save-excursion (move-to-window-line bottom-margin) (point)))
+ (far (save-excursion
+ (goto-char bottom)
+ (point-at-bol (1- height)))))
+ ,@body))
+
;;;
;;; FIND
;;;
@@ -674,57 +693,29 @@ Argument NUM is the number of lines to move."
"Find first occurrence of a string in forward direction and save it.
Optional argument FIND is t is this function is called from `edt-find'."
(interactive)
- (if (not find)
- (set 'edt-find-last-text (read-string "Search forward: ")))
- (let* ((left nil)
- (beg (edt-current-line))
- (height (window-height))
- (top-percent
- (if (= 0 edt-top-scroll-margin) 10 edt-top-scroll-margin))
- (bottom-percent
- (if (= 0 edt-bottom-scroll-margin) 15 edt-bottom-scroll-margin))
- (top-margin (/ (* height top-percent) 100))
- (bottom-up-margin (+ 1 (/ (* height bottom-percent) 100)))
- (bottom-margin (max beg (- height bottom-up-margin 1)))
- (top (save-excursion (move-to-window-line top-margin) (point)))
- (bottom (save-excursion (move-to-window-line bottom-margin) (point)))
- (far (save-excursion
- (goto-char bottom) (forward-line (- height 2)) (point))))
- (if (search-forward edt-find-last-text)
- (progn
- (search-backward edt-find-last-text)
- (edt-set-match)
- (cond((> (point) far)
- (setq left (save-excursion (forward-line height)))
- (if (= 0 left) (recenter top-margin)
- (recenter (- left bottom-up-margin))))
- (t
- (and (> (point) bottom) (recenter bottom-margin)))))))
+ (or find
+ (setq edt-find-last-text (read-string "Search forward: ")))
+ (edt-with-position
+ (when (search-forward edt-find-last-text) ; FIXME noerror?
+ (search-backward edt-find-last-text)
+ (edt-set-match)
+ (if (> (point) far)
+ (if (zerop (setq left (save-excursion (forward-line height))))
+ (recenter top-margin)
+ (recenter (- left bottom-up-margin)))
+ (and (> (point) bottom) (recenter bottom-margin)))))
(if (featurep 'xemacs) (setq zmacs-region-stays t)))
(defun edt-find-backward (&optional find)
"Find first occurrence of a string in the backward direction and save it.
Optional argument FIND is t if this function is called from `edt-find'."
(interactive)
- (if (not find)
- (set 'edt-find-last-text (read-string "Search backward: ")))
- (let* ((left nil)
- (beg (edt-current-line))
- (height (window-height))
- (top-percent
- (if (= 0 edt-top-scroll-margin) 10 edt-top-scroll-margin))
- (bottom-percent
- (if (= 0 edt-bottom-scroll-margin) 15 edt-bottom-scroll-margin))
- (top-margin (/ (* height top-percent) 100))
- (bottom-up-margin (+ 1 (/ (* height bottom-percent) 100)))
- (bottom-margin (max beg (- height bottom-up-margin 1)))
- (top (save-excursion (move-to-window-line top-margin) (point)))
- (bottom (save-excursion (move-to-window-line bottom-margin) (point)))
- (far (save-excursion
- (goto-char bottom) (forward-line (- height 2)) (point))))
- (if (search-backward edt-find-last-text)
- (edt-set-match))
- (and (< (point) top) (recenter (min beg top-margin))))
+ (or find
+ (setq edt-find-last-text (read-string "Search backward: ")))
+ (edt-with-position
+ (if (search-backward edt-find-last-text)
+ (edt-set-match))
+ (and (< (point) top) (recenter (min beg top-margin))))
(if (featurep 'xemacs) (setq zmacs-region-stays t)))
(defun edt-find ()
@@ -743,58 +734,29 @@ Optional argument FIND is t if this function is called from `edt-find'."
(defun edt-find-next-forward ()
"Find next occurrence of a string in forward direction."
(interactive)
- (let* ((left nil)
- (beg (edt-current-line))
- (height (window-height))
- (top-percent
- (if (= 0 edt-top-scroll-margin) 10 edt-top-scroll-margin))
- (bottom-percent
- (if (= 0 edt-bottom-scroll-margin) 15 edt-bottom-scroll-margin))
- (top-margin (/ (* height top-percent) 100))
- (bottom-up-margin (+ 1 (/ (* height bottom-percent) 100)))
- (bottom-margin (max beg (- height bottom-up-margin 1)))
- (top (save-excursion (move-to-window-line top-margin) (point)))
- (bottom (save-excursion (move-to-window-line bottom-margin) (point)))
- (far (save-excursion
- (goto-char bottom) (forward-line (- height 2)) (point))))
- (forward-char 1)
- (if (search-forward edt-find-last-text nil t)
- (progn
- (search-backward edt-find-last-text)
- (edt-set-match)
- (cond((> (point) far)
- (setq left (save-excursion (forward-line height)))
- (if (= 0 left) (recenter top-margin)
- (recenter (- left bottom-up-margin))))
- (t
- (and (> (point) bottom) (recenter bottom-margin)))))
- (progn
- (backward-char 1)
- (error "Search failed: \"%s\"" edt-find-last-text))))
+ (edt-with-position
+ (forward-char 1)
+ (if (search-forward edt-find-last-text nil t)
+ (progn
+ (search-backward edt-find-last-text)
+ (edt-set-match)
+ (if (> (point) far)
+ (if (zerop (setq left (save-excursion (forward-line height))))
+ (recenter top-margin)
+ (recenter (- left bottom-up-margin)))
+ (and (> (point) bottom) (recenter bottom-margin))))
+ (backward-char 1)
+ (error "Search failed: \"%s\"" edt-find-last-text)))
(if (featurep 'xemacs) (setq zmacs-region-stays t)))
(defun edt-find-next-backward ()
"Find next occurrence of a string in backward direction."
(interactive)
- (let* ((left nil)
- (beg (edt-current-line))
- (height (window-height))
- (top-percent
- (if (= 0 edt-top-scroll-margin) 10 edt-top-scroll-margin))
- (bottom-percent
- (if (= 0 edt-bottom-scroll-margin) 15 edt-bottom-scroll-margin))
- (top-margin (/ (* height top-percent) 100))
- (bottom-up-margin (+ 1 (/ (* height bottom-percent) 100)))
- (bottom-margin (max beg (- height bottom-up-margin 1)))
- (top (save-excursion (move-to-window-line top-margin) (point)))
- (bottom (save-excursion (move-to-window-line bottom-margin) (point)))
- (far (save-excursion
- (goto-char bottom) (forward-line (- height 2)) (point))))
- (if (not (search-backward edt-find-last-text nil t))
- (error "Search failed: \"%s\"" edt-find-last-text)
- (progn
- (edt-set-match)
- (and (< (point) top) (recenter (min beg top-margin))))))
+ (edt-with-position
+ (if (not (search-backward edt-find-last-text nil t))
+ (error "Search failed: \"%s\"" edt-find-last-text)
+ (edt-set-match)
+ (and (< (point) top) (recenter (min beg top-margin)))))
(if (featurep 'xemacs) (setq zmacs-region-stays t)))
(defun edt-find-next ()
@@ -858,8 +820,7 @@ Argument NUM is the number of lines to delete."
In select mode, selected text is highlighted."
(if arg
(progn
- (make-local-variable 'edt-select-mode)
- (setq edt-select-mode 'edt-select-mode-current)
+ (set (make-local-variable 'edt-select-mode) 'edt-select-mode-current)
(setq rect-start-point (window-point)))
(progn
(kill-local-variable 'edt-select-mode)))
@@ -1318,33 +1279,17 @@ Argument BOTTOM is the bottom margin in number of lines or percent of window."
Argument NUM is the positive number of sentences to move."
(interactive "p")
(edt-check-prefix num)
- (let* ((left nil)
- (beg (edt-current-line))
- (height (window-height))
- (top-percent
- (if (= 0 edt-top-scroll-margin) 10 edt-top-scroll-margin))
- (bottom-percent
- (if (= 0 edt-bottom-scroll-margin) 15 edt-bottom-scroll-margin))
- (top-margin (/ (* height top-percent) 100))
- (bottom-up-margin (+ 1 (/ (* height bottom-percent) 100)))
- (bottom-margin (max beg (- height bottom-up-margin 1)))
- (top (save-excursion (move-to-window-line top-margin) (point)))
- (bottom (save-excursion (move-to-window-line bottom-margin) (point)))
- (far (save-excursion
- (goto-char bottom) (forward-line (- height 2)) (point))))
- (if (eobp)
- (progn
- (error "End of buffer"))
- (progn
- (forward-sentence num)
- (forward-word 1)
- (backward-sentence)))
- (cond((> (point) far)
- (setq left (save-excursion (forward-line height)))
- (if (= 0 left) (recenter top-margin)
- (recenter (- left bottom-up-margin))))
- (t
- (and (> (point) bottom) (recenter bottom-margin)))))
+ (edt-with-position
+ (if (eobp)
+ (error "End of buffer")
+ (forward-sentence num)
+ (forward-word 1)
+ (backward-sentence))
+ (if (> (point) far)
+ (if (zerop (setq left (save-excursion (forward-line height))))
+ (recenter top-margin)
+ (recenter (- left bottom-up-margin)))
+ (and (> (point) bottom) (recenter bottom-margin))))
(if (featurep 'xemacs) (setq zmacs-region-stays t)))
(defun edt-sentence-backward (num)
@@ -1352,25 +1297,11 @@ Argument NUM is the positive number of sentences to move."
Argument NUM is the positive number of sentences to move."
(interactive "p")
(edt-check-prefix num)
- (let* ((left nil)
- (beg (edt-current-line))
- (height (window-height))
- (top-percent
- (if (= 0 edt-top-scroll-margin) 10 edt-top-scroll-margin))
- (bottom-percent
- (if (= 0 edt-bottom-scroll-margin) 15 edt-bottom-scroll-margin))
- (top-margin (/ (* height top-percent) 100))
- (bottom-up-margin (+ 1 (/ (* height bottom-percent) 100)))
- (bottom-margin (max beg (- height bottom-up-margin 1)))
- (top (save-excursion (move-to-window-line top-margin) (point)))
- (bottom (save-excursion (move-to-window-line bottom-margin) (point)))
- (far (save-excursion
- (goto-char bottom) (forward-line (- height 2)) (point))))
- (if (eobp)
- (progn
- (error "End of buffer"))
- (backward-sentence num))
- (and (< (point) top) (recenter (min beg top-margin))))
+ (edt-with-position
+ (if (eobp)
+ (error "End of buffer")
+ (backward-sentence num))
+ (and (< (point) top) (recenter (min beg top-margin))))
(if (featurep 'xemacs) (setq zmacs-region-stays t)))
(defun edt-sentence (num)
@@ -1390,32 +1321,18 @@ Argument NUM is the positive number of sentences to move."
Argument NUM is the positive number of paragraphs to move."
(interactive "p")
(edt-check-prefix num)
- (let* ((left nil)
- (beg (edt-current-line))
- (height (window-height))
- (top-percent
- (if (= 0 edt-top-scroll-margin) 10 edt-top-scroll-margin))
- (bottom-percent
- (if (= 0 edt-bottom-scroll-margin) 15 edt-bottom-scroll-margin))
- (top-margin (/ (* height top-percent) 100))
- (bottom-up-margin (+ 1 (/ (* height bottom-percent) 100)))
- (bottom-margin (max beg (- height bottom-up-margin 1)))
- (top (save-excursion (move-to-window-line top-margin) (point)))
- (bottom (save-excursion (move-to-window-line bottom-margin) (point)))
- (far (save-excursion
- (goto-char bottom) (forward-line (- height 2)) (point))))
- (while (> num 0)
- (forward-paragraph (+ num 1))
- (start-of-paragraph-text)
- (if (eolp)
- (forward-line 1))
- (setq num (1- num)))
- (cond((> (point) far)
- (setq left (save-excursion (forward-line height)))
- (if (= 0 left) (recenter top-margin)
- (recenter (- left bottom-up-margin))))
- (t
- (and (> (point) bottom) (recenter bottom-margin)))))
+ (edt-with-position
+ (while (> num 0)
+ (forward-paragraph (+ num 1))
+ (start-of-paragraph-text)
+ (if (eolp)
+ (forward-line 1))
+ (setq num (1- num)))
+ (if (> (point) far)
+ (if (zerop (setq left (save-excursion (forward-line height))))
+ (recenter top-margin)
+ (recenter (- left bottom-up-margin)))
+ (and (> (point) bottom) (recenter bottom-margin))))
(if (featurep 'xemacs) (setq zmacs-region-stays t)))
(defun edt-paragraph-backward (num)
@@ -1423,24 +1340,11 @@ Argument NUM is the positive number of paragraphs to move."
Argument NUM is the positive number of paragraphs to move."
(interactive "p")
(edt-check-prefix num)
- (let* ((left nil)
- (beg (edt-current-line))
- (height (window-height))
- (top-percent
- (if (= 0 edt-top-scroll-margin) 10 edt-top-scroll-margin))
- (bottom-percent
- (if (= 0 edt-bottom-scroll-margin) 15 edt-bottom-scroll-margin))
- (top-margin (/ (* height top-percent) 100))
- (bottom-up-margin (+ 1 (/ (* height bottom-percent) 100)))
- (bottom-margin (max beg (- height bottom-up-margin 1)))
- (top (save-excursion (move-to-window-line top-margin) (point)))
- (bottom (save-excursion (move-to-window-line bottom-margin) (point)))
- (far (save-excursion
- (goto-char bottom) (forward-line (- height 2)) (point))))
- (while (> num 0)
- (start-of-paragraph-text)
- (setq num (1- num)))
- (and (< (point) top) (recenter (min beg top-margin))))
+ (edt-with-position
+ (while (> num 0)
+ (start-of-paragraph-text)
+ (setq num (1- num)))
+ (and (< (point) top) (recenter (min beg top-margin))))
(if (featurep 'xemacs) (setq zmacs-region-stays t)))
(defun edt-paragraph (num)
@@ -2057,40 +1961,32 @@ created."
Ack!! You're running the Enhanced EDT Emulation without loading an
EDT key mapping file. To create an EDT key mapping file, run the
- edt-mapper.el program. It is safest to run it from an Emacs loaded
+ edt-mapper program. It is safest to run it from an Emacs loaded
without any of your own customizations found in your .emacs file, etc.
The reason for this is that some user customizations confuse edt-mapper.
You can do this by quitting Emacs and then invoking Emacs again as
follows:
- emacs -q -l edt-mapper.el
+ emacs -q -l edt-mapper
[NOTE: If you do nothing out of the ordinary in your .emacs file, and
- the search for edt-mapper.el is successful, you can try running it now.]
+ the search for edt-mapper is successful, you can try running it now.]
- The file edt-mapper.el includes these same directions on how to
+ The library edt-mapper includes these same directions on how to
use it! Perhaps it's lying around here someplace. \n ")
- (let ((file "edt-mapper.el")
- (found nil)
- (path nil)
- (search-list (append (list (expand-file-name ".")) load-path)))
- (while (and (not found) search-list)
- (setq path (concat (car search-list)
- (if (string-match "/$" (car search-list)) "" "/")
- file))
- (if (and (file-exists-p path) (not (file-directory-p path)))
- (setq found t))
- (setq search-list (cdr search-list)))
- (cond (found
- (insert (format
- "Ah yes, there it is, in \n\n %s \n\n" path))
- (if (edt-y-or-n-p "Do you want to run it now? ")
- (load-file path)
- (error "EDT Emulation not configured")))
- (t
- (insert "Nope, I can't seem to find it. :-(\n\n")
- (sit-for 20)
- (error "EDT Emulation not configured")))))))
+ (let ((path (locate-library
+ "edt-mapper"
+ nil (append (list default-directory) load-path))))
+ (if path
+ (progn
+ (insert (format
+ "Ah yes, there it is, in \n\n %s \n\n" path))
+ (if (edt-y-or-n-p "Do you want to run it now? ")
+ (load-file path)
+ (error "EDT Emulation not configured")))
+ (insert "Nope, I can't seem to find it. :-(\n\n")
+ (sit-for 20)
+ (error "EDT Emulation not configured"))))))
;;;
;;; Turning the EDT Emulation on and off.
@@ -2571,12 +2467,12 @@ Argument GOLD-BINDING is the Emacs function to be bound to GOLD <KEY>."
;;; DEFAULT EDT KEYPAD HELP
;;;
-;;;
-;;; Upper case commands in the keypad diagram below indicate that the
-;;; emulation should look and feel very much like EDT. Lower case
-;;; commands are enhancements and/or additions to the EDT keypad
-;;; commands or are native Emacs commands.
-;;;
+;;
+;; Upper case commands in the keypad diagram below indicate that the
+;; emulation should look and feel very much like EDT. Lower case
+;; commands are enhancements and/or additions to the EDT keypad
+;; commands or are native Emacs commands.
+;;
(defun edt-keypad-help ()
"DEFAULT EDT Keypad Active.
@@ -2685,7 +2581,7 @@ G-C-\\: Split Window | FNDNXT | Yank | CUT |
;;;
;;; EDT emulation screen width commands.
-;;;
+;;
;; Some terminals require modification of terminal attributes when
;; changing the number of columns displayed, hence the fboundp tests
;; below. These functions are defined in the corresponding terminal
@@ -2709,5 +2605,4 @@ G-C-\\: Split Window | FNDNXT | Yank | CUT |
(provide 'edt)
-;; arch-tag: 18d1c54f-6900-4078-8bbc-7c2292f48941
;;; edt.el ends here
diff --git a/lisp/emulation/pc-select.el b/lisp/emulation/pc-select.el
index 09b999b2298..5e3b8a6d5b4 100644
--- a/lisp/emulation/pc-select.el
+++ b/lisp/emulation/pc-select.el
@@ -82,11 +82,10 @@
(defgroup pc-select nil
"Emulate pc bindings."
:prefix "pc-select"
- :group 'editing-basics
- :group 'convenience)
+ :group 'emulations)
(defcustom pc-select-override-scroll-error t
- "*Non-nil means don't generate error on scrolling past edge of buffer.
+ "Non-nil means don't generate error on scrolling past edge of buffer.
This variable applies in PC Selection mode only.
The scroll commands normally generate an error if you try to scroll
past the top or bottom of the buffer. This is annoying when selecting
@@ -94,16 +93,19 @@ text with these commands. If you set this variable to non-nil, these
errors are suppressed."
:type 'boolean
:group 'pc-select)
+(define-obsolete-variable-alias 'pc-select-override-scroll-error
+ 'scroll-error-top-bottom
+ "24.1")
(defcustom pc-select-selection-keys-only nil
- "*Non-nil means only bind the basic selection keys when started.
+ "Non-nil means only bind the basic selection keys when started.
Other keys that emulate pc-behavior will be untouched.
This gives mostly Emacs-like behavior with only the selection keys enabled."
:type 'boolean
:group 'pc-select)
(defcustom pc-select-meta-moves-sexps nil
- "*Non-nil means move sexp-wise with Meta key, otherwise move word-wise."
+ "Non-nil means move sexp-wise with Meta key, otherwise move word-wise."
:type 'boolean
:group 'pc-select)
diff --git a/lisp/emulation/tpu-edt.el b/lisp/emulation/tpu-edt.el
index 80c62e1fdf8..a9873e285d8 100644
--- a/lisp/emulation/tpu-edt.el
+++ b/lisp/emulation/tpu-edt.el
@@ -2438,7 +2438,7 @@ If FILE is nil, try to load a default file. The default file names are
;;;### (autoloads (tpu-set-cursor-bound tpu-set-cursor-free tpu-set-scroll-margins
-;;;;;; tpu-cursor-free-mode) "tpu-extras" "tpu-extras.el" "d003e4c2f1291eccc629926bb0f88e17")
+;;;;;; tpu-cursor-free-mode) "tpu-extras" "tpu-extras.el" "fe5b7795d6b6720a98b805ee47a08bdf")
;;; Generated autoloads from tpu-extras.el
(autoload 'tpu-cursor-free-mode "tpu-extras" "\
diff --git a/lisp/emulation/tpu-extras.el b/lisp/emulation/tpu-extras.el
index b4d6afdff6b..7fcd6489786 100644
--- a/lisp/emulation/tpu-extras.el
+++ b/lisp/emulation/tpu-extras.el
@@ -6,6 +6,7 @@
;; Author: Rob Riepel <riepel@networking.stanford.edu>
;; Maintainer: Rob Riepel <riepel@networking.stanford.edu>
;; Keywords: emulations
+;; Package: tpu-edt
;; This file is part of GNU Emacs.
@@ -275,36 +276,41 @@ Prefix argument serves as repeat count."
;;; Movement by paragraph
+;; Cf edt-with-position.
+(defmacro tpu-with-position (&rest body)
+ "Execute BODY with some position-related variables bound."
+ `(let* ((left nil)
+ (beg (tpu-current-line))
+ (height (window-height))
+ (top-percent
+ (if (zerop tpu-top-scroll-margin) 10 tpu-top-scroll-margin))
+ (bottom-percent
+ (if (zerop tpu-bottom-scroll-margin) 15 tpu-bottom-scroll-margin))
+ (top-margin (/ (* height top-percent) 100))
+ (bottom-up-margin (1+ (/ (* height bottom-percent) 100)))
+ (bottom-margin (max beg (- height bottom-up-margin 1)))
+ (top (save-excursion (move-to-window-line top-margin) (point)))
+ (bottom (save-excursion (move-to-window-line bottom-margin) (point)))
+ (far (save-excursion
+ (goto-char bottom)
+ (point-at-bol (1- height)))))
+ ,@body))
+
(defun tpu-paragraph (num)
"Move to the next paragraph in the current direction.
A repeat count means move that many paragraphs."
(interactive "p")
- (let* ((left nil)
- (beg (tpu-current-line))
- (height (window-height))
- (top-percent
- (if (= 0 tpu-top-scroll-margin) 10 tpu-top-scroll-margin))
- (bottom-percent
- (if (= 0 tpu-bottom-scroll-margin) 15 tpu-bottom-scroll-margin))
- (top-margin (/ (* height top-percent) 100))
- (bottom-up-margin (+ 1 (/ (* height bottom-percent) 100)))
- (bottom-margin (max beg (- height bottom-up-margin 1)))
- (top (save-excursion (move-to-window-line top-margin) (point)))
- (bottom (save-excursion (move-to-window-line bottom-margin) (point)))
- (far (save-excursion
- (goto-char bottom) (forward-line (- height 2)) (point))))
- (cond (tpu-advance
- (tpu-next-paragraph num)
- (cond((> (point) far)
- (setq left (save-excursion (forward-line height)))
- (if (= 0 left) (recenter top-margin)
- (recenter (- left bottom-up-margin))))
- (t
- (and (> (point) bottom) (recenter bottom-margin)))))
- (t
- (tpu-previous-paragraph num)
- (and (< (point) top) (recenter (min beg top-margin)))))))
-
+ (tpu-with-position
+ (if tpu-advance
+ (progn
+ (tpu-next-paragraph num)
+ (if (> (point) far)
+ (if (zerop (setq left (save-excursion (forward-line height))))
+ (recenter top-margin)
+ (recenter (- left bottom-up-margin)))
+ (and (> (point) bottom) (recenter bottom-margin))))
+ (tpu-previous-paragraph num)
+ (and (< (point) top) (recenter (min beg top-margin))))))
;;; Movement by page
@@ -312,32 +318,17 @@ A repeat count means move that many paragraphs."
"Move to the next page in the current direction.
A repeat count means move that many pages."
(interactive "p")
- (let* ((left nil)
- (beg (tpu-current-line))
- (height (window-height))
- (top-percent
- (if (= 0 tpu-top-scroll-margin) 10 tpu-top-scroll-margin))
- (bottom-percent
- (if (= 0 tpu-bottom-scroll-margin) 15 tpu-bottom-scroll-margin))
- (top-margin (/ (* height top-percent) 100))
- (bottom-up-margin (+ 1 (/ (* height bottom-percent) 100)))
- (bottom-margin (max beg (- height bottom-up-margin 1)))
- (top (save-excursion (move-to-window-line top-margin) (point)))
- (bottom (save-excursion (move-to-window-line bottom-margin) (point)))
- (far (save-excursion
- (goto-char bottom) (forward-line (- height 2)) (point))))
- (cond (tpu-advance
- (forward-page num)
- (cond((> (point) far)
- (setq left (save-excursion (forward-line height)))
- (if (= 0 left) (recenter top-margin)
- (recenter (- left bottom-up-margin))))
- (t
- (and (> (point) bottom) (recenter bottom-margin)))))
- (t
- (backward-page num)
- (and (< (point) top) (recenter (min beg top-margin)))))))
-
+ (tpu-with-position
+ (if tpu-advance
+ (progn
+ (forward-page num)
+ (if (> (point) far)
+ (if (zerop (setq left (save-excursion (forward-line height))))
+ (recenter top-margin)
+ (recenter (- left bottom-up-margin)))
+ (and (> (point) bottom) (recenter bottom-margin))))
+ (backward-page num)
+ (and (< (point) top) (recenter (min beg top-margin))))))
;;; Scrolling
@@ -366,31 +357,16 @@ A repeat count means scroll that many sections."
(defun tpu-search-internal (pat &optional quiet)
"Search for a string or regular expression."
- (let* ((left nil)
- (beg (tpu-current-line))
- (height (window-height))
- (top-percent
- (if (= 0 tpu-top-scroll-margin) 10 tpu-top-scroll-margin))
- (bottom-percent
- (if (= 0 tpu-bottom-scroll-margin) 15 tpu-bottom-scroll-margin))
- (top-margin (/ (* height top-percent) 100))
- (bottom-up-margin (+ 1 (/ (* height bottom-percent) 100)))
- (bottom-margin (max beg (- height bottom-up-margin 1)))
- (top (save-excursion (move-to-window-line top-margin) (point)))
- (bottom (save-excursion (move-to-window-line bottom-margin) (point)))
- (far (save-excursion
- (goto-char bottom) (forward-line (- height 2)) (point))))
- (tpu-search-internal-core pat quiet)
- (if tpu-searching-forward
- (cond((> (point) far)
- (setq left (save-excursion (forward-line height)))
- (if (= 0 left) (recenter top-margin)
- (recenter (- left bottom-up-margin))))
- (t
- (and (> (point) bottom) (recenter bottom-margin))))
- (and (< (point) top) (recenter (min beg top-margin))))))
-
-
+ (tpu-with-position
+ (tpu-search-internal-core pat quiet)
+ (if tpu-searching-forward
+ (progn
+ (if (> (point) far)
+ (if (zerop (setq left (save-excursion (forward-line height))))
+ (recenter top-margin)
+ (recenter (- left bottom-up-margin)))
+ (and (> (point) bottom) (recenter bottom-margin))))
+ (and (< (point) top) (recenter (min beg top-margin))))))
;; Advise the newline, newline-and-indent, and do-auto-fill functions.
(defadvice newline (around tpu-respect-bottom-scroll-margin activate disable)
@@ -462,5 +438,4 @@ A repeat count means scroll that many sections."
;; generated-autoload-file: "tpu-edt.el"
;; End:
-;; arch-tag: 89676fa4-33ec-48cb-9135-6f3bf230ab1a
;;; tpu-extras.el ends here
diff --git a/lisp/emulation/tpu-mapper.el b/lisp/emulation/tpu-mapper.el
index 0b246c012ed..6bba1a3c1af 100644
--- a/lisp/emulation/tpu-mapper.el
+++ b/lisp/emulation/tpu-mapper.el
@@ -6,6 +6,7 @@
;; Author: Rob Riepel <riepel@networking.stanford.edu>
;; Maintainer: Rob Riepel <riepel@networking.stanford.edu>
;; Keywords: emulations
+;; Package: tpu-edt
;; This file is part of GNU Emacs.
diff --git a/lisp/emulation/vip.el b/lisp/emulation/vip.el
index 3349d096b95..dcbf9ce2ad8 100644
--- a/lisp/emulation/vip.el
+++ b/lisp/emulation/vip.el
@@ -91,12 +91,12 @@
"How to reexecute last destructive command. Value is list (M-COM VAL COM).")
(defcustom vip-shift-width 8
- "*The number of columns shifted by > and < command."
+ "The number of columns shifted by > and < command."
:type 'integer
:group 'vip)
(defcustom vip-re-replace nil
- "*If t then do regexp replace, if nil then do string replace."
+ "If t then do regexp replace, if nil then do string replace."
:type 'boolean
:group 'vip)
@@ -116,12 +116,12 @@
"For use by \";\" command.")
(defcustom vip-search-wrap-around t
- "*If t, search wraps around."
+ "If t, search wraps around."
:type 'boolean
:group 'vip)
(defcustom vip-re-search nil
- "*If t, search is reg-exp search, otherwise vanilla search."
+ "If t, search is reg-exp search, otherwise vanilla search."
:type 'boolean
:group 'vip)
@@ -132,22 +132,22 @@
"If t, search is forward.")
(defcustom vip-case-fold-search nil
- "*If t, search ignores cases."
+ "If t, search ignores cases."
:type 'boolean
:group 'vip)
(defcustom vip-re-query-replace nil
- "*If t then do regexp replace, if nil then do string replace."
+ "If t then do regexp replace, if nil then do string replace."
:type 'boolean
:group 'vip)
(defcustom vip-open-with-indent nil
- "*If t, indent when open a new line."
+ "If t, indent when open a new line."
:type 'boolean
:group 'vip)
(defcustom vip-help-in-insert-mode nil
- "*If t then C-h is bound to help-command in insert mode.
+ "If t then C-h is bound to help-command in insert mode.
If nil then it is bound to `delete-backward-char'."
:type 'boolean
:group 'vip)
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index 317b5760caa..a4df2941b1c 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -4,6 +4,7 @@
;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
+;; Package: viper
;; This file is part of GNU Emacs.
@@ -41,7 +42,7 @@
(defvar quail-current-str)
(defvar mark-even-if-inactive)
(defvar init-message)
-(defvar initial)
+(defvar viper-initial)
(defvar undo-beg-posn)
(defvar undo-end-posn)
@@ -2064,23 +2065,22 @@ Undo previous insertion and inserts new."
(funcall hook)
))
-;; Thie is a temp hook that uses free variables init-message and initial.
+;; This is a temp hook that uses free variables init-message and viper-initial.
;; A dirty feature, but it is the simplest way to have it do the right thing.
-;; The INIT-MESSAGE and INITIAL vars come from the scope set by
+;; The INIT-MESSAGE and VIPER-INITIAL vars come from the scope set by
;; viper-read-string-with-history
(defun viper-minibuffer-standard-hook ()
(if (stringp init-message)
(viper-tmp-insert-at-eob init-message))
- (if (stringp initial)
- (progn
- ;; don't wait if we have unread events or in kbd macro
- (or unread-command-events
- executing-kbd-macro
- (sit-for 840))
- (if (fboundp 'minibuffer-prompt-end)
- (delete-region (minibuffer-prompt-end) (point-max))
- (erase-buffer))
- (insert initial))))
+ (when (stringp viper-initial)
+ ;; don't wait if we have unread events or in kbd macro
+ (or unread-command-events
+ executing-kbd-macro
+ (sit-for 840))
+ (if (fboundp 'minibuffer-prompt-end)
+ (delete-region (minibuffer-prompt-end) (point-max))
+ (erase-buffer))
+ (insert viper-initial)))
(defsubst viper-minibuffer-real-start ()
(if (fboundp 'minibuffer-prompt-end)
@@ -2179,10 +2179,10 @@ problems."
;;; Reading string with history
-(defun viper-read-string-with-history (prompt &optional initial
+(defun viper-read-string-with-history (prompt &optional viper-initial
history-var default keymap
init-message)
- ;; Read string, prompting with PROMPT and inserting the INITIAL
+ ;; Read string, prompting with PROMPT and inserting the VIPER-INITIAL
;; value. Uses HISTORY-VAR. DEFAULT is the default value to accept if the
;; input is an empty string.
;; Default value is displayed until the user types something in the
@@ -2205,14 +2205,14 @@ problems."
temp-msg)
(setq keymap (or keymap minibuffer-local-map)
- initial (or initial "")
+ viper-initial (or viper-initial "")
temp-msg (if default
(format "(default %s) " default)
""))
(setq viper-incomplete-ex-cmd nil)
(setq val (read-from-minibuffer prompt
- (concat temp-msg initial val padding)
+ (concat temp-msg viper-initial val padding)
keymap nil history-var))
(setq minibuffer-setup-hook nil
padding (viper-array-to-string (this-command-keys))
@@ -3498,11 +3498,8 @@ controlled by the sign of prefix numeric value."
(if (and (eolp) (not (bolp))) (forward-char -1))
(if (not (looking-at "[][(){}]"))
(setq anchor-point (point)))
- (save-excursion
- (beginning-of-line)
- (setq beg-lim (point))
- (end-of-line)
- (setq end-lim (point)))
+ (setq beg-lim (point-at-bol)
+ end-lim (point-at-eol))
(cond ((re-search-forward "[][(){}]" end-lim t)
(backward-char) )
((re-search-backward "[][(){}]" beg-lim t))
@@ -4247,7 +4244,7 @@ Null string will repeat previous search."
(setq viper-use-register nil)))
(if (and (bolp) viper-ex-style-editing)
(ding))
- (delete-backward-char val t)))
+ (delete-char (- val) t)))
(defun viper-del-backward-char-in-insert ()
@@ -4256,7 +4253,7 @@ Null string will repeat previous search."
(if (and viper-ex-style-editing (bolp))
(beep 1)
;; don't put on kill ring
- (delete-backward-char 1 nil)))
+ (delete-char -1 nil)))
(defun viper-del-backward-char-in-replace ()
@@ -4269,14 +4266,14 @@ cursor move past the beginning of line."
(cond (viper-delete-backwards-in-replace
(cond ((not (bolp))
;; don't put on kill ring
- (delete-backward-char 1 nil))
+ (delete-char -1 nil))
(viper-ex-style-editing
(beep 1))
((bobp)
(beep 1))
(t
;; don't put on kill ring
- (delete-backward-char 1 nil))))
+ (delete-char -1 nil))))
(viper-ex-style-editing
(if (bolp)
(beep 1)
@@ -4344,7 +4341,7 @@ cursor move past the beginning of line."
(insert-before-markers "@") ; put placeholder after the TAB
(untabify (viper-replace-start) (point))
;; del @, don't put on kill ring
- (delete-backward-char 1)
+ (delete-char -1)
(viper-set-replace-overlay-glyphs
viper-replace-region-start-delimiter
@@ -4622,12 +4619,10 @@ One can use `` and '' to temporarily jump 1 step back."
(progn
(if (eq ?^ (preceding-char))
(setq viper-preserve-indent t))
- (delete-backward-char 1)
+ (delete-char -1)
(setq p (point))
(setq indent nil)))
- (save-excursion
- (beginning-of-line)
- (setq bol (point)))
+ (setq bol (point-at-bol))
(if (re-search-backward "[^ \t]" bol 1) (forward-char))
(delete-region (point) p)
(if indent
@@ -4711,9 +4706,7 @@ One can use `` and '' to temporarily jump 1 step back."
(goto-char pos)
(beginning-of-line)
(if (re-search-backward "[^ \t]" nil t)
- (progn
- (beginning-of-line)
- (setq s (point))))
+ (setq s (point-at-bol)))
(goto-char pos)
(forward-line 1)
(if (re-search-forward "[^ \t]" nil t)
@@ -5092,5 +5085,4 @@ Mail anyway (y or n)? ")
-;; arch-tag: 739a6450-5fda-44d0-88b0-325053d888c2
;;; viper-cmd.el ends here
diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el
index b068bd5ca25..e4cfbe88572 100644
--- a/lisp/emulation/viper-ex.el
+++ b/lisp/emulation/viper-ex.el
@@ -4,6 +4,7 @@
;; 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
+;; Package: viper
;; This file is part of GNU Emacs.
@@ -750,7 +751,7 @@ reversed."
(format "[^\\\\]\\(\\\\\\\\\\)*\\\\%c" c)))
(setq cont nil)
;; we are at an escaped delimiter: unescape it and continue
- (delete-backward-char 2)
+ (delete-char -2)
(insert c)
(if (eolp)
;; if at eol, exit loop and go to next line
diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el
index 1ecff657d2a..f18cd55d7f8 100644
--- a/lisp/emulation/viper-init.el
+++ b/lisp/emulation/viper-init.el
@@ -4,6 +4,7 @@
;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
+;; Package: viper
;; This file is part of GNU Emacs.
@@ -62,9 +63,10 @@
(defun viper-window-display-p ()
(and (viper-device-type) (not (memq (viper-device-type) '(tty stream pc)))))
-(defcustom viper-ms-style-os-p (memq system-type
- '(ms-dos windows-nt windows-95))
- "Tells if Emacs is running under an MS-style OS: ms-dos, windows-nt, W95."
+(defcustom viper-ms-style-os-p
+ (memq system-type (if (featurep 'emacs) '(ms-dos windows-nt)
+ '(ms-dos windows-nt windows-95)))
+ "Non-nil if Emacs is running under an MS-style OS: MS-DOS, or MS-Windows."
:type 'boolean
:tag "Is it Microsoft-made OS?"
:group 'viper-misc)
@@ -783,7 +785,7 @@ Related buffers can be cycled through via :R and :P commands."
;; These two vars control the interaction of jumps performed by ' and `.
;; In this new version, '' doesn't erase the marks set by ``, so one can
-;; use both kinds of jumps interchangeably and without loosing positions
+;; use both kinds of jumps interchangeably and without losing positions
;; inside the lines.
;; Remembers position of the last jump done using ``'.
@@ -995,5 +997,4 @@ on a dumb terminal."
;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun)
;; End:
-;; arch-tag: 4efa2416-1fcb-4690-be10-1a2a0248d250
;;; viper-init.el ends here
diff --git a/lisp/emulation/viper-keym.el b/lisp/emulation/viper-keym.el
index a3dda4e0ceb..79d7505f512 100644
--- a/lisp/emulation/viper-keym.el
+++ b/lisp/emulation/viper-keym.el
@@ -4,6 +4,7 @@
;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
+;; Package: viper
;; This file is part of GNU Emacs.
diff --git a/lisp/emulation/viper-macs.el b/lisp/emulation/viper-macs.el
index d39589f44d7..3af24a46f9b 100644
--- a/lisp/emulation/viper-macs.el
+++ b/lisp/emulation/viper-macs.el
@@ -4,6 +4,7 @@
;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
+;; Package: viper
;; This file is part of GNU Emacs.
diff --git a/lisp/emulation/viper-mous.el b/lisp/emulation/viper-mous.el
index 31acf40028a..69ad062fc28 100644
--- a/lisp/emulation/viper-mous.el
+++ b/lisp/emulation/viper-mous.el
@@ -4,6 +4,7 @@
;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
+;; Package: viper
;; This file is part of GNU Emacs.
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el
index 81485a0390d..70e5466346d 100644
--- a/lisp/emulation/viper-util.el
+++ b/lisp/emulation/viper-util.el
@@ -4,6 +4,7 @@
;; 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
+;; Package: viper
;; This file is part of GNU Emacs.
@@ -76,7 +77,7 @@
(defalias 'viper-int-to-char
(if (featurep 'xemacs) 'int-to-char 'identity))
(defalias 'viper-get-face
- (if (featurep 'xemacs) 'get-face 'internal-get-face))
+ (if (featurep 'xemacs) 'get-face 'facep))
(defalias 'viper-color-defined-p
(if (featurep 'xemacs) 'valid-color-name-p 'x-color-defined-p))
(defalias 'viper-iconify
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el
index e42d49c5bee..9f2247ffc66 100644
--- a/lisp/emulation/viper.el
+++ b/lisp/emulation/viper.el
@@ -8,6 +8,7 @@
;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
;; Keywords: emulations
+;; Version: 3.14.1
;; Yoni Rabkin <yoni@rabkins.net> contacted the maintainer of this
;; file on 20/3/2008, and the maintainer agreed that when a bug is
diff --git a/lisp/emulation/ws-mode.el b/lisp/emulation/ws-mode.el
index 5bad5fa4ec1..0919fbb9d9a 100644
--- a/lisp/emulation/ws-mode.el
+++ b/lisp/emulation/ws-mode.el
@@ -27,158 +27,156 @@
;; This emulates WordStar, with a major mode.
;;; Code:
-
-(defvar wordstar-mode-map nil "")
+(defvar wordstar-C-k-map
+ (let ((map (make-keymap)))
+ (define-key map " " ())
+ (define-key map "0" 'ws-set-marker-0)
+ (define-key map "1" 'ws-set-marker-1)
+ (define-key map "2" 'ws-set-marker-2)
+ (define-key map "3" 'ws-set-marker-3)
+ (define-key map "4" 'ws-set-marker-4)
+ (define-key map "5" 'ws-set-marker-5)
+ (define-key map "6" 'ws-set-marker-6)
+ (define-key map "7" 'ws-set-marker-7)
+ (define-key map "8" 'ws-set-marker-8)
+ (define-key map "9" 'ws-set-marker-9)
+ (define-key map "b" 'ws-begin-block)
+ (define-key map "\C-b" 'ws-begin-block)
+ (define-key map "c" 'ws-copy-block)
+ (define-key map "\C-c" 'ws-copy-block)
+ (define-key map "d" 'save-buffers-kill-emacs)
+ (define-key map "\C-d" 'save-buffers-kill-emacs)
+ (define-key map "f" 'find-file)
+ (define-key map "\C-f" 'find-file)
+ (define-key map "h" 'ws-show-markers)
+ (define-key map "\C-h" 'ws-show-markers)
+ (define-key map "i" 'ws-indent-block)
+ (define-key map "\C-i" 'ws-indent-block)
+ (define-key map "k" 'ws-end-block)
+ (define-key map "\C-k" 'ws-end-block)
+ (define-key map "p" 'ws-print-block)
+ (define-key map "\C-p" 'ws-print-block)
+ (define-key map "q" 'kill-emacs)
+ (define-key map "\C-q" 'kill-emacs)
+ (define-key map "r" 'insert-file)
+ (define-key map "\C-r" 'insert-file)
+ (define-key map "s" 'save-some-buffers)
+ (define-key map "\C-s" 'save-some-buffers)
+ (define-key map "t" 'ws-mark-word)
+ (define-key map "\C-t" 'ws-mark-word)
+ (define-key map "u" 'ws-exdent-block)
+ (define-key map "\C-u" 'keyboard-quit)
+ (define-key map "v" 'ws-move-block)
+ (define-key map "\C-v" 'ws-move-block)
+ (define-key map "w" 'ws-write-block)
+ (define-key map "\C-w" 'ws-write-block)
+ (define-key map "x" 'save-buffers-kill-emacs)
+ (define-key map "\C-x" 'save-buffers-kill-emacs)
+ (define-key map "y" 'ws-delete-block)
+ (define-key map "\C-y" 'ws-delete-block)
+ map)
+ "")
+
+(defvar wordstar-C-o-map
+ (let ((map (make-keymap)))
+ (define-key map " " ())
+ (define-key map "c" 'wordstar-center-line)
+ (define-key map "\C-c" 'wordstar-center-line)
+ (define-key map "b" 'switch-to-buffer)
+ (define-key map "\C-b" 'switch-to-buffer)
+ (define-key map "j" 'justify-current-line)
+ (define-key map "\C-j" 'justify-current-line)
+ (define-key map "k" 'kill-buffer)
+ (define-key map "\C-k" 'kill-buffer)
+ (define-key map "l" 'list-buffers)
+ (define-key map "\C-l" 'list-buffers)
+ (define-key map "m" 'auto-fill-mode)
+ (define-key map "\C-m" 'auto-fill-mode)
+ (define-key map "r" 'set-fill-column)
+ (define-key map "\C-r" 'set-fill-column)
+ (define-key map "\C-u" 'keyboard-quit)
+ (define-key map "wd" 'delete-other-windows)
+ (define-key map "wh" 'split-window-horizontally)
+ (define-key map "wo" 'other-window)
+ (define-key map "wv" 'split-window-vertically)
+ map)
+ "")
+
+(defvar wordstar-C-q-map
+ (let ((map (make-keymap)))
+ (define-key map " " ())
+ (define-key map "0" 'ws-find-marker-0)
+ (define-key map "1" 'ws-find-marker-1)
+ (define-key map "2" 'ws-find-marker-2)
+ (define-key map "3" 'ws-find-marker-3)
+ (define-key map "4" 'ws-find-marker-4)
+ (define-key map "5" 'ws-find-marker-5)
+ (define-key map "6" 'ws-find-marker-6)
+ (define-key map "7" 'ws-find-marker-7)
+ (define-key map "8" 'ws-find-marker-8)
+ (define-key map "9" 'ws-find-marker-9)
+ (define-key map "a" 'ws-query-replace)
+ (define-key map "\C-a" 'ws-query-replace)
+ (define-key map "b" 'ws-goto-block-begin)
+ (define-key map "\C-b" 'ws-goto-block-begin)
+ (define-key map "c" 'end-of-buffer)
+ (define-key map "\C-c" 'end-of-buffer)
+ (define-key map "d" 'end-of-line)
+ (define-key map "\C-d" 'end-of-line)
+ (define-key map "f" 'ws-search)
+ (define-key map "\C-f" 'ws-search)
+ (define-key map "k" 'ws-goto-block-end)
+ (define-key map "\C-k" 'ws-goto-block-end)
+ (define-key map "l" 'ws-undo)
+ (define-key map "\C-l" 'ws-undo)
+ (define-key map "p" 'ws-last-cursorp)
+ (define-key map "\C-p" 'ws-last-cursorp)
+ (define-key map "r" 'beginning-of-buffer)
+ (define-key map "\C-r" 'beginning-of-buffer)
+ (define-key map "s" 'beginning-of-line)
+ (define-key map "\C-s" 'beginning-of-line)
+ (define-key map "\C-u" 'keyboard-quit)
+ (define-key map "w" 'ws-last-error)
+ (define-key map "\C-w" 'ws-last-error)
+ (define-key map "y" 'ws-kill-eol)
+ (define-key map "\C-y" 'ws-kill-eol)
+ (define-key map "\177" 'ws-kill-bol)
+ map)
+ "")
+
+(defvar wordstar-mode-map
+ (let ((map (make-keymap)))
+ (define-key map "\C-a" 'backward-word)
+ (define-key map "\C-b" 'fill-paragraph)
+ (define-key map "\C-c" 'scroll-up)
+ (define-key map "\C-d" 'forward-char)
+ (define-key map "\C-e" 'previous-line)
+ (define-key map "\C-f" 'forward-word)
+ (define-key map "\C-g" 'delete-char)
+ (define-key map "\C-h" 'backward-char)
+ (define-key map "\C-i" 'indent-for-tab-command)
+ (define-key map "\C-j" 'help-for-help)
+ (define-key map "\C-k" wordstar-C-k-map)
+ (define-key map "\C-l" 'ws-repeat-search)
+ (define-key map "\C-n" 'open-line)
+ (define-key map "\C-o" wordstar-C-o-map)
+ (define-key map "\C-p" 'quoted-insert)
+ (define-key map "\C-q" wordstar-C-q-map)
+ (define-key map "\C-r" 'scroll-down)
+ (define-key map "\C-s" 'backward-char)
+ (define-key map "\C-t" 'kill-word)
+ (define-key map "\C-u" 'keyboard-quit)
+ (define-key map "\C-v" 'overwrite-mode)
+ (define-key map "\C-w" 'scroll-down-line)
+ (define-key map "\C-x" 'next-line)
+ (define-key map "\C-y" 'kill-complete-line)
+ (define-key map "\C-z" 'scroll-up-line)
+ map)
+ "")
+
+;; wordstar-C-j-map not yet implemented
(defvar wordstar-C-j-map nil "")
-(defvar wordstar-C-k-map nil "")
-(defvar wordstar-C-o-map nil "")
-(defvar wordstar-C-q-map nil "")
-
-(if wordstar-mode-map
- ()
- (setq wordstar-mode-map (make-keymap))
- ;; (setq wordstar-C-j-map (make-keymap)) ; later, perhaps
- (setq wordstar-C-k-map (make-keymap))
- (setq wordstar-C-o-map (make-keymap))
- (setq wordstar-C-q-map (make-keymap))
-
- (define-key wordstar-mode-map "\C-a" 'backward-word)
- (define-key wordstar-mode-map "\C-b" 'fill-paragraph)
- (define-key wordstar-mode-map "\C-c" 'scroll-up)
- (define-key wordstar-mode-map "\C-d" 'forward-char)
- (define-key wordstar-mode-map "\C-e" 'previous-line)
- (define-key wordstar-mode-map "\C-f" 'forward-word)
- (define-key wordstar-mode-map "\C-g" 'delete-char)
- (define-key wordstar-mode-map "\C-h" 'backward-char)
- (define-key wordstar-mode-map "\C-i" 'indent-for-tab-command)
- (define-key wordstar-mode-map "\C-j" 'help-for-help)
- (define-key wordstar-mode-map "\C-k" wordstar-C-k-map)
- (define-key wordstar-mode-map "\C-l" 'ws-repeat-search)
- (define-key wordstar-mode-map "\C-n" 'open-line)
- (define-key wordstar-mode-map "\C-o" wordstar-C-o-map)
- (define-key wordstar-mode-map "\C-p" 'quoted-insert)
- (define-key wordstar-mode-map "\C-q" wordstar-C-q-map)
- (define-key wordstar-mode-map "\C-r" 'scroll-down)
- (define-key wordstar-mode-map "\C-s" 'backward-char)
- (define-key wordstar-mode-map "\C-t" 'kill-word)
- (define-key wordstar-mode-map "\C-u" 'keyboard-quit)
- (define-key wordstar-mode-map "\C-v" 'overwrite-mode)
- (define-key wordstar-mode-map "\C-w" 'scroll-down-line)
- (define-key wordstar-mode-map "\C-x" 'next-line)
- (define-key wordstar-mode-map "\C-y" 'kill-complete-line)
- (define-key wordstar-mode-map "\C-z" 'scroll-up-line)
-
- ;; wordstar-C-k-map
-
- (define-key wordstar-C-k-map " " ())
- (define-key wordstar-C-k-map "0" 'ws-set-marker-0)
- (define-key wordstar-C-k-map "1" 'ws-set-marker-1)
- (define-key wordstar-C-k-map "2" 'ws-set-marker-2)
- (define-key wordstar-C-k-map "3" 'ws-set-marker-3)
- (define-key wordstar-C-k-map "4" 'ws-set-marker-4)
- (define-key wordstar-C-k-map "5" 'ws-set-marker-5)
- (define-key wordstar-C-k-map "6" 'ws-set-marker-6)
- (define-key wordstar-C-k-map "7" 'ws-set-marker-7)
- (define-key wordstar-C-k-map "8" 'ws-set-marker-8)
- (define-key wordstar-C-k-map "9" 'ws-set-marker-9)
- (define-key wordstar-C-k-map "b" 'ws-begin-block)
- (define-key wordstar-C-k-map "\C-b" 'ws-begin-block)
- (define-key wordstar-C-k-map "c" 'ws-copy-block)
- (define-key wordstar-C-k-map "\C-c" 'ws-copy-block)
- (define-key wordstar-C-k-map "d" 'save-buffers-kill-emacs)
- (define-key wordstar-C-k-map "\C-d" 'save-buffers-kill-emacs)
- (define-key wordstar-C-k-map "f" 'find-file)
- (define-key wordstar-C-k-map "\C-f" 'find-file)
- (define-key wordstar-C-k-map "h" 'ws-show-markers)
- (define-key wordstar-C-k-map "\C-h" 'ws-show-markers)
- (define-key wordstar-C-k-map "i" 'ws-indent-block)
- (define-key wordstar-C-k-map "\C-i" 'ws-indent-block)
- (define-key wordstar-C-k-map "k" 'ws-end-block)
- (define-key wordstar-C-k-map "\C-k" 'ws-end-block)
- (define-key wordstar-C-k-map "p" 'ws-print-block)
- (define-key wordstar-C-k-map "\C-p" 'ws-print-block)
- (define-key wordstar-C-k-map "q" 'kill-emacs)
- (define-key wordstar-C-k-map "\C-q" 'kill-emacs)
- (define-key wordstar-C-k-map "r" 'insert-file)
- (define-key wordstar-C-k-map "\C-r" 'insert-file)
- (define-key wordstar-C-k-map "s" 'save-some-buffers)
- (define-key wordstar-C-k-map "\C-s" 'save-some-buffers)
- (define-key wordstar-C-k-map "t" 'ws-mark-word)
- (define-key wordstar-C-k-map "\C-t" 'ws-mark-word)
- (define-key wordstar-C-k-map "u" 'ws-exdent-block)
- (define-key wordstar-C-k-map "\C-u" 'keyboard-quit)
- (define-key wordstar-C-k-map "v" 'ws-move-block)
- (define-key wordstar-C-k-map "\C-v" 'ws-move-block)
- (define-key wordstar-C-k-map "w" 'ws-write-block)
- (define-key wordstar-C-k-map "\C-w" 'ws-write-block)
- (define-key wordstar-C-k-map "x" 'save-buffers-kill-emacs)
- (define-key wordstar-C-k-map "\C-x" 'save-buffers-kill-emacs)
- (define-key wordstar-C-k-map "y" 'ws-delete-block)
- (define-key wordstar-C-k-map "\C-y" 'ws-delete-block)
-
- ;; wordstar-C-j-map not yet implemented
-
- ;; wordstar-C-o-map
-
- (define-key wordstar-C-o-map " " ())
- (define-key wordstar-C-o-map "c" 'wordstar-center-line)
- (define-key wordstar-C-o-map "\C-c" 'wordstar-center-line)
- (define-key wordstar-C-o-map "b" 'switch-to-buffer)
- (define-key wordstar-C-o-map "\C-b" 'switch-to-buffer)
- (define-key wordstar-C-o-map "j" 'justify-current-line)
- (define-key wordstar-C-o-map "\C-j" 'justify-current-line)
- (define-key wordstar-C-o-map "k" 'kill-buffer)
- (define-key wordstar-C-o-map "\C-k" 'kill-buffer)
- (define-key wordstar-C-o-map "l" 'list-buffers)
- (define-key wordstar-C-o-map "\C-l" 'list-buffers)
- (define-key wordstar-C-o-map "m" 'auto-fill-mode)
- (define-key wordstar-C-o-map "\C-m" 'auto-fill-mode)
- (define-key wordstar-C-o-map "r" 'set-fill-column)
- (define-key wordstar-C-o-map "\C-r" 'set-fill-column)
- (define-key wordstar-C-o-map "\C-u" 'keyboard-quit)
- (define-key wordstar-C-o-map "wd" 'delete-other-windows)
- (define-key wordstar-C-o-map "wh" 'split-window-horizontally)
- (define-key wordstar-C-o-map "wo" 'other-window)
- (define-key wordstar-C-o-map "wv" 'split-window-vertically)
-
- ;; wordstar-C-q-map
- (define-key wordstar-C-q-map " " ())
- (define-key wordstar-C-q-map "0" 'ws-find-marker-0)
- (define-key wordstar-C-q-map "1" 'ws-find-marker-1)
- (define-key wordstar-C-q-map "2" 'ws-find-marker-2)
- (define-key wordstar-C-q-map "3" 'ws-find-marker-3)
- (define-key wordstar-C-q-map "4" 'ws-find-marker-4)
- (define-key wordstar-C-q-map "5" 'ws-find-marker-5)
- (define-key wordstar-C-q-map "6" 'ws-find-marker-6)
- (define-key wordstar-C-q-map "7" 'ws-find-marker-7)
- (define-key wordstar-C-q-map "8" 'ws-find-marker-8)
- (define-key wordstar-C-q-map "9" 'ws-find-marker-9)
- (define-key wordstar-C-q-map "a" 'ws-query-replace)
- (define-key wordstar-C-q-map "\C-a" 'ws-query-replace)
- (define-key wordstar-C-q-map "b" 'ws-goto-block-begin)
- (define-key wordstar-C-q-map "\C-b" 'ws-goto-block-begin)
- (define-key wordstar-C-q-map "c" 'end-of-buffer)
- (define-key wordstar-C-q-map "\C-c" 'end-of-buffer)
- (define-key wordstar-C-q-map "d" 'end-of-line)
- (define-key wordstar-C-q-map "\C-d" 'end-of-line)
- (define-key wordstar-C-q-map "f" 'ws-search)
- (define-key wordstar-C-q-map "\C-f" 'ws-search)
- (define-key wordstar-C-q-map "k" 'ws-goto-block-end)
- (define-key wordstar-C-q-map "\C-k" 'ws-goto-block-end)
- (define-key wordstar-C-q-map "l" 'ws-undo)
- (define-key wordstar-C-q-map "\C-l" 'ws-undo)
- (define-key wordstar-C-q-map "p" 'ws-last-cursorp)
- (define-key wordstar-C-q-map "\C-p" 'ws-last-cursorp)
- (define-key wordstar-C-q-map "r" 'beginning-of-buffer)
- (define-key wordstar-C-q-map "\C-r" 'beginning-of-buffer)
- (define-key wordstar-C-q-map "s" 'beginning-of-line)
- (define-key wordstar-C-q-map "\C-s" 'beginning-of-line)
- (define-key wordstar-C-q-map "\C-u" 'keyboard-quit)
- (define-key wordstar-C-q-map "w" 'ws-last-error)
- (define-key wordstar-C-q-map "\C-w" 'ws-last-error)
- (define-key wordstar-C-q-map "y" 'ws-kill-eol)
- (define-key wordstar-C-q-map "\C-y" 'ws-kill-eol)
- (define-key wordstar-C-q-map "\177" 'ws-kill-bol))
+
(put 'wordstar-mode 'mode-class 'special)
@@ -339,16 +337,6 @@ the distance between the end of the text and `fill-column'."
(+ left-margin
(/ (- fill-column left-margin line-length) 2))))))
-(defun scroll-down-line ()
- "Scroll one line down."
- (interactive)
- (scroll-down 1))
-
-(defun scroll-up-line ()
- "Scroll one line up."
- (interactive)
- (scroll-up 1))
-
;;;;;;;;;;;
;; wordstar special variables: