diff options
Diffstat (limited to 'lisp/emulation')
-rw-r--r-- | lisp/emulation/cua-base.el | 89 | ||||
-rw-r--r-- | lisp/emulation/cua-gmrk.el | 4 | ||||
-rw-r--r-- | lisp/emulation/cua-rect.el | 11 | ||||
-rw-r--r-- | lisp/emulation/edt-vt100.el | 2 | ||||
-rw-r--r-- | lisp/emulation/edt.el | 39 | ||||
-rw-r--r-- | lisp/emulation/pc-select.el | 107 | ||||
-rw-r--r-- | lisp/emulation/tpu-edt.el | 9 | ||||
-rw-r--r-- | lisp/emulation/vi.el | 2 | ||||
-rw-r--r-- | lisp/emulation/viper-cmd.el | 21 | ||||
-rw-r--r-- | lisp/emulation/viper-ex.el | 6 | ||||
-rw-r--r-- | lisp/emulation/viper-init.el | 19 | ||||
-rw-r--r-- | lisp/emulation/viper-keym.el | 17 | ||||
-rw-r--r-- | lisp/emulation/viper-macs.el | 8 | ||||
-rw-r--r-- | lisp/emulation/viper-mous.el | 4 | ||||
-rw-r--r-- | lisp/emulation/viper-util.el | 8 | ||||
-rw-r--r-- | lisp/emulation/viper.el | 15 |
16 files changed, 159 insertions, 202 deletions
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el index fbb39ee66d3..1f696788869 100644 --- a/lisp/emulation/cua-base.el +++ b/lisp/emulation/cua-base.el @@ -286,7 +286,7 @@ enabled." "*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 +But when the mark was set using \\[cua-set-mark], Transient Mark mode is not turned on." :type 'boolean :group 'cua) @@ -406,8 +406,8 @@ and after the region marked by the rectangle to search." "Global key used to toggle the cua rectangle mark." :set #'(lambda (symbol value) (set symbol value) - (when (and (boundp 'cua--keymaps-initalized) - cua--keymaps-initalized) + (when (and (boundp 'cua--keymaps-initialized) + cua--keymaps-initialized) (define-key cua-global-keymap value 'cua-set-rectangle-mark) (when (boundp 'cua--rectangle-keymap) @@ -583,35 +583,37 @@ a cons (TYPE . COLOR), then both properties are affected." ;;; Rectangle support is in cua-rect.el -(autoload 'cua-set-rectangle-mark "cua-rect" nil t nil) +(autoload 'cua-set-rectangle-mark "cua-rect" + "Start rectangle at mouse click position." t nil) ;; Stub definitions until it is loaded - -(when (not (featurep 'cua-rect)) - (defvar cua--rectangle) - (setq cua--rectangle nil) - (defvar cua--last-killed-rectangle) - (setq cua--last-killed-rectangle nil)) - - +(defvar cua--rectangle) +(defvar cua--last-killed-rectangle) +(unless (featurep 'cua-rect) + (setq cua--rectangle nil + cua--last-killed-rectangle nil)) + +;; All behind cua--rectangle tests. +(declare-function cua-copy-rectangle "cua-rect" (arg)) +(declare-function cua-cut-rectangle "cua-rect" (arg)) +(declare-function cua--rectangle-left "cua-rect" (&optional val)) +(declare-function cua--delete-rectangle "cua-rect" ()) +(declare-function cua--insert-rectangle "cua-rect" + (rect &optional below paste-column line-count)) +(declare-function cua--rectangle-corner "cua-rect" (&optional advance)) +(declare-function cua--rectangle-assert "cua-rect" ()) ;;; Global Mark support is in cua-gmrk.el (autoload 'cua-toggle-global-mark "cua-gmrk" nil t nil) ;; Stub definitions until cua-gmrk.el is loaded - -(when (not (featurep 'cua-gmrk)) - (defvar cua--global-mark-active) +(defvar cua--global-mark-active) +(unless (featurep 'cua-gmrk) (setq cua--global-mark-active nil)) - -(provide 'cua-base) - -(eval-when-compile - (require 'cua-rect) - (require 'cua-gmrk) - ) +(declare-function cua--insert-at-global-mark "cua-gmrk" (str &optional msg)) +(declare-function cua--global-mark-post-command "cua-gmrk" ()) ;;; Low-level Interface @@ -874,6 +876,8 @@ With numeric prefix arg, copy to register 0-9 instead." (if (fboundp 'cua--cancel-rectangle) (cua--cancel-rectangle))) +(declare-function x-clipboard-yank "../term/x-win" ()) + (defun cua-paste (arg) "Paste last cut or copied region or rectangle. An active region is deleted before executing the command. @@ -918,6 +922,7 @@ If global mark is active, copy from register or one character." (cond (regtxt (cond + ;; This being a cons implies cua-rect is loaded? ((consp regtxt) (cua--insert-rectangle regtxt)) ((stringp regtxt) (insert-for-yank regtxt)) (t (message "Unknown data in register %c" cua--register)))) @@ -954,8 +959,8 @@ If global mark is active, copy from register or one character." (defun cua-paste-pop (arg) "Replace a just-pasted text or rectangle with a different text. -See `yank-pop' for details about the default behaviour. For an alternative -behaviour, see `cua-paste-pop-rotate-temporarily'." +See `yank-pop' for details about the default behavior. For an alternative +behavior, see `cua-paste-pop-rotate-temporarily'." (interactive "P") (cond ((eq last-command 'cua--paste-rectangle) @@ -1225,22 +1230,26 @@ If ARG is the atom `-', scroll upward by nearly full screen." ;; Handle shifted cursor keys and other movement commands. ;; If region is not active, region is activated if key is shifted. - ;; If region is active, region is cancelled if key is unshifted (and region not started with C-SPC). - ;; If rectangle is active, expand rectangle in specified direction and ignore the movement. + ;; If region is active, region is cancelled if key is unshifted + ;; (and region not started with C-SPC). + ;; If rectangle is active, expand rectangle in specified direction and + ;; ignore the movement. ((if window-system + ;; Shortcut for window-system, assuming that input-decode-map is empty. (memq 'shift (event-modifiers (aref (this-single-command-raw-keys) 0))) (or + ;; Check if the final key-sequence was shifted. (memq 'shift (event-modifiers (aref (this-single-command-keys) 0))) - ;; See if raw escape sequence maps to a shifted event, e.g. S-up or C-S-home. - (and (boundp 'local-function-key-map) - local-function-key-map - (let ((ev (lookup-key local-function-key-map - (this-single-command-raw-keys)))) - (and (vector ev) - (symbolp (setq ev (aref ev 0))) - (string-match "S-" (symbol-name ev))))))) + ;; If not, maybe the raw key-sequence was mapped by input-decode-map + ;; to a shifted key (and then mapped down to its unshifted form). + (let* ((keys (this-single-command-raw-keys)) + (ev (lookup-key input-decode-map keys))) + (or (and (vector ev) (memq 'shift (event-modifiers (aref ev 0)))) + ;; Or maybe, the raw key-sequence was not an escape sequence + ;; and was shifted (and then mapped down to its unshifted form). + (memq 'shift (event-modifiers (aref keys 0))))))) (unless mark-active (push-mark-command nil t)) (setq cua--last-region-shifted t) @@ -1326,8 +1335,8 @@ If ARG is the atom `-', scroll upward by nearly full screen." (defvar cua--cua-keys-keymap (make-sparse-keymap)) (defvar cua--prefix-override-keymap (make-sparse-keymap)) (defvar cua--prefix-repeat-keymap (make-sparse-keymap)) -(defvar cua--global-mark-keymap (make-sparse-keymap)) ; Initalized when cua-gmrk.el is loaded -(defvar cua--rectangle-keymap (make-sparse-keymap)) ; Initalized when cua-rect.el is loaded +(defvar cua--global-mark-keymap (make-sparse-keymap)) ; Initialized when cua-gmrk.el is loaded +(defvar cua--rectangle-keymap (make-sparse-keymap)) ; Initialized when cua-rect.el is loaded (defvar cua--region-keymap (make-sparse-keymap)) (defvar cua--ena-cua-keys-keymap nil) @@ -1370,7 +1379,7 @@ If ARG is the atom `-', scroll upward by nearly full screen." (and cua--global-mark-active (not (window-minibuffer-p))))) -(defvar cua--keymaps-initalized nil) +(defvar cua--keymaps-initialized nil) (defun cua--shift-control-prefix (prefix arg) ;; handle S-C-x and S-C-c by emulating the fast double prefix function. @@ -1534,9 +1543,9 @@ shifted movement key, set `cua-highlight-region-shift-only'." (setq mark-even-if-inactive t) (setq highlight-nonselected-windows nil) - (unless cua--keymaps-initalized + (unless cua--keymaps-initialized (cua--init-keymaps) - (setq cua--keymaps-initalized t)) + (setq cua--keymaps-initialized t)) (if cua-mode (progn @@ -1600,7 +1609,7 @@ shifted movement key, set `cua-highlight-region-shift-only'." (setq cua--debug (not cua--debug))) -(provide 'cua) +(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 6dc4d179d3d..6211a3c3154 100644 --- a/lisp/emulation/cua-gmrk.el +++ b/lisp/emulation/cua-gmrk.el @@ -27,8 +27,6 @@ ;;; Code: -(provide 'cua-gmrk) - (eval-when-compile (require 'cua-base) (require 'cua-rect) @@ -386,5 +384,7 @@ With prefix argument, don't jump to global mark when cancelling it." (setq cua--global-mark-initialized t)) +(provide 'cua-gmrk) + ;;; arch-tag: 553d8076-a91d-48ae-825d-6cb962a5f67f ;;; cua-gmrk.el ends here diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el index 5c4bc011464..f6b50336815 100644 --- a/lisp/emulation/cua-rect.el +++ b/lisp/emulation/cua-rect.el @@ -33,12 +33,8 @@ ;;; Code: -(provide 'cua-rect) - (eval-when-compile - (require 'cua-base) - (require 'cua-gmrk) -) + (require 'cua-base)) ;;; Rectangle support @@ -1061,6 +1057,9 @@ The text previously in the rectangle is overwritten by the blanks." ;; (setq cua-save-point (point)) )))) +(declare-function cua--cut-rectangle-to-global-mark "cua-gmrk" (as-text)) +(declare-function cua--copy-rectangle-to-global-mark "cua-gmrk" (as-text)) + (defun cua-copy-rectangle-as-text (&optional arg delete) "Copy rectangle, but store as normal text." (interactive "P") @@ -1491,5 +1490,7 @@ With prefix arg, indent to that column." (setq cua--rectangle-initialized t)) +(provide 'cua-rect) + ;;; arch-tag: b730df53-17b9-4a89-bd63-4a71ec196731 ;;; cua-rect.el ends here diff --git a/lisp/emulation/edt-vt100.el b/lisp/emulation/edt-vt100.el index 4e094a5f703..fbe56c2c341 100644 --- a/lisp/emulation/edt-vt100.el +++ b/lisp/emulation/edt-vt100.el @@ -39,6 +39,8 @@ ;; The following functions are called by the EDT screen width commands defined ;; in edt.el. +(declare-function vt100-wide-mode "../term/vt100" (&optional arg)) + (defun edt-set-term-width-80 () "Set terminal width to 80 columns." (vt100-wide-mode -1)) diff --git a/lisp/emulation/edt.el b/lisp/emulation/edt.el index 4a68e258cb1..1674e7a266b 100644 --- a/lisp/emulation/edt.el +++ b/lisp/emulation/edt.el @@ -166,28 +166,23 @@ ;;;; VARIABLES and CONSTANTS ;;;; -;; For backward compatibility to Emacs 19. -(or (fboundp 'defgroup) - (defmacro defgroup (&rest rest))) - (defgroup edt nil "Emacs emulating EDT." :prefix "edt-" :group 'emulations) ;; To silence the byte-compiler -(eval-when-compile - (defvar *EDT-keys*) - (defvar edt-default-global-map) - (defvar edt-last-copied-word) - (defvar edt-learn-macro-count) - (defvar edt-orig-page-delimiter) - (defvar edt-orig-transient-mark-mode) - (defvar edt-rect-start-point) - (defvar edt-user-global-map) - (defvar rect-start-point) - (defvar time-string) - (defvar zmacs-region-stays)) +(defvar *EDT-keys*) +(defvar edt-default-global-map) +(defvar edt-last-copied-word) +(defvar edt-learn-macro-count) +(defvar edt-orig-page-delimiter) +(defvar edt-orig-transient-mark-mode) +(defvar edt-rect-start-point) +(defvar edt-user-global-map) +(defvar rect-start-point) +(defvar time-string) +(defvar zmacs-region-stays) ;;; ;;; Version Information @@ -198,11 +193,6 @@ ;;; User Configurable Variables ;;; -;; For backward compatibility to Emacs 19. -(or (fboundp 'defcustom) - (defmacro defcustom (var value doc &rest ignore) - `(defvar ,var ,value ,doc))) - (defcustom edt-keep-current-page-delimiter nil "*Emacs MUST be restarted for a change in value to take effect! Non-nil leaves Emacs value of `page-delimiter' unchanged within EDT @@ -1628,6 +1618,8 @@ Argument NUM is the percentage into the buffer to move." (indent-region (point) (mark) nil) (fill-region (point) (mark)))) + +(declare-function c-mark-function "cc-cmds" ()) ;;; ;;; MARK SECTION WISELY ;;; @@ -2237,7 +2229,10 @@ Optional argument USER-SETUP non-nil means called from function ;; function edt-setup-extra-default-bindings. (define-prefix-command 'edt-user-gold-map) (fset 'edt-user-gold-map (copy-keymap 'edt-default-gold-map)) - (edt-setup-user-bindings) + ;; This is a function that the user can define for custom bindings. + ;; See etc/edt-user.doc. + (if (fboundp 'edt-setup-user-bindings) + (edt-setup-user-bindings)) (edt-select-user-global-map)) (defun edt-select-default-global-map() diff --git a/lisp/emulation/pc-select.el b/lisp/emulation/pc-select.el index a4e304616da..c35044b70ec 100644 --- a/lisp/emulation/pc-select.el +++ b/lisp/emulation/pc-select.el @@ -135,8 +135,8 @@ restored to their original values when PC Selection mode is toggled off.") (unless pc-select-default-key-bindings (let ((lst - ;; This is to avoid confusion with the delete-selection-mode - ;; On simple displays you cant see that a region is active and + ;; This is to avoid confusion with the delete-selection-mode. + ;; On simple displays you can't see that a region is active and ;; will be deleted on the next keypress IMHO especially for ;; copy-region-as-kill this is confusing. ;; The same goes for exchange-point-and-mark @@ -182,7 +182,7 @@ restored to their original values when PC Selection mode is toggled off.") ([prior] . scroll-down-nomark) ;; Next four lines are from Pete Forman. - ([C-down] . forward-paragraph-nomark) ; KNextPara cDn + ([C-down] . forward-paragraph-nomark) ; KNextPara cDn ([C-up] . backward-paragraph-nomark) ; KPrevPara cUp ([S-C-down] . forward-paragraph-mark) ([S-C-up] . backward-paragraph-mark)))) @@ -281,10 +281,17 @@ and `transient-mark-mode'." ;;;; ;; non-interactive ;;;; -(defun ensure-mark() +(defun pc-select-ensure-mark () ;; make sure mark is active ;; test if it is active, if it isn't, set it and activate it - (or mark-active (set-mark-command nil))) + (or mark-active (set-mark-command nil)) + ;; Remember who activated the mark. + (setq mark-active 'pc-select)) + +(defun pc-select-maybe-deactivate-mark () + ;; maybe switch off mark (only if *we* switched it on) + (when (eq mark-active 'pc-select) + (deactivate-mark))) ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;; forward and mark @@ -294,7 +301,7 @@ and `transient-mark-mode'." "Ensure mark is active; move point right ARG characters (left if ARG negative). On reaching end of buffer, stop and signal error." (interactive "p") - (ensure-mark) + (pc-select-ensure-mark) (forward-char arg)) (defun forward-word-mark (&optional arg) @@ -303,13 +310,13 @@ Normally returns t. If an edge of the buffer is reached, point is left there and nil is returned." (interactive "p") - (ensure-mark) + (pc-select-ensure-mark) (forward-word arg)) (defun forward-line-mark (&optional arg) "Ensure mark is active; move cursor vertically down ARG lines." (interactive "p") - (ensure-mark) + (pc-select-ensure-mark) (forward-line arg) (setq this-command 'forward-line) ) @@ -319,7 +326,7 @@ and nil is returned." With argument, do it that many times. Negative arg -N means move backward across N balanced expressions." (interactive "p") - (ensure-mark) + (pc-select-ensure-mark) (forward-sexp arg)) (defun forward-paragraph-mark (&optional arg) @@ -331,7 +338,7 @@ A line which `paragraph-start' matches either separates paragraphs A paragraph end is the beginning of a line which is not part of the paragraph to which the end of the previous line belongs, or the end of the buffer." (interactive "p") - (ensure-mark) + (pc-select-ensure-mark) (forward-paragraph arg)) (defun next-line-mark (&optional arg) @@ -350,7 +357,7 @@ a semipermanent goal column to which this command always moves. Then it does not try to move vertically. This goal column is stored in `goal-column', which is nil when there is none." (interactive "p") - (ensure-mark) + (pc-select-ensure-mark) (with-no-warnings (next-line arg)) (setq this-command 'next-line)) @@ -359,14 +366,14 @@ in `goal-column', which is nil when there is none." With argument ARG not nil or 1, move forward ARG - 1 lines first. If scan reaches end of buffer, stop there without error." (interactive "p") - (ensure-mark) + (pc-select-ensure-mark) (end-of-line arg) (setq this-command 'end-of-line)) (defun backward-line-mark (&optional arg) "Ensure mark is active; move cursor vertically up ARG lines." (interactive "p") - (ensure-mark) + (pc-select-ensure-mark) (if (null arg) (setq arg 1)) (forward-line (- arg)) @@ -379,7 +386,7 @@ A near full screen is `next-screen-context-lines' less than a full screen. Negative ARG means scroll upward. When calling from a program, supply a number as argument or nil." (interactive "P") - (ensure-mark) + (pc-select-ensure-mark) (cond (pc-select-override-scroll-error (condition-case nil (scroll-down arg) (beginning-of-buffer (goto-char (point-min))))) @@ -395,7 +402,7 @@ of the accessible part of the buffer. Don't use this command in Lisp programs! \(goto-char \(point-max)) is faster and avoids clobbering the mark." (interactive "P") - (ensure-mark) + (pc-select-ensure-mark) (let ((size (- (point-max) (point-min)))) (goto-char (if arg (- (point-max) @@ -427,7 +434,7 @@ Don't use this command in Lisp programs! "Deactivate mark; move point right ARG characters \(left if ARG negative). On reaching end of buffer, stop and signal error." (interactive "p") - (setq mark-active nil) + (pc-select-maybe-deactivate-mark) (forward-char arg)) (defun forward-word-nomark (&optional arg) @@ -436,13 +443,13 @@ Normally returns t. If an edge of the buffer is reached, point is left there and nil is returned." (interactive "p") - (setq mark-active nil) + (pc-select-maybe-deactivate-mark) (forward-word arg)) (defun forward-line-nomark (&optional arg) "Deactivate mark; move cursor vertically down ARG lines." (interactive "p") - (setq mark-active nil) + (pc-select-maybe-deactivate-mark) (forward-line arg) (setq this-command 'forward-line) ) @@ -452,7 +459,7 @@ and nil is returned." With argument, do it that many times. Negative arg -N means move backward across N balanced expressions." (interactive "p") - (setq mark-active nil) + (pc-select-maybe-deactivate-mark) (forward-sexp arg)) (defun forward-paragraph-nomark (&optional arg) @@ -464,7 +471,7 @@ A line which `paragraph-start' matches either separates paragraphs A paragraph end is the beginning of a line which is not part of the paragraph to which the end of the previous line belongs, or the end of the buffer." (interactive "p") - (setq mark-active nil) + (pc-select-maybe-deactivate-mark) (forward-paragraph arg)) (defun next-line-nomark (&optional arg) @@ -483,7 +490,7 @@ a semipermanent goal column to which this command always moves. Then it does not try to move vertically. This goal column is stored in `goal-column', which is nil when there is none." (interactive "p") - (setq mark-active nil) + (pc-select-maybe-deactivate-mark) (with-no-warnings (next-line arg)) (setq this-command 'next-line)) @@ -492,14 +499,14 @@ in `goal-column', which is nil when there is none." With argument ARG not nil or 1, move forward ARG - 1 lines first. If scan reaches end of buffer, stop there without error." (interactive "p") - (setq mark-active nil) + (pc-select-maybe-deactivate-mark) (end-of-line arg) (setq this-command 'end-of-line)) (defun backward-line-nomark (&optional arg) "Deactivate mark; move cursor vertically up ARG lines." (interactive "p") - (setq mark-active nil) + (pc-select-maybe-deactivate-mark) (if (null arg) (setq arg 1)) (forward-line (- arg)) @@ -512,7 +519,7 @@ A near full screen is `next-screen-context-lines' less than a full screen. Negative ARG means scroll upward. When calling from a program, supply a number as argument or nil." (interactive "P") - (setq mark-active nil) + (pc-select-maybe-deactivate-mark) (cond (pc-select-override-scroll-error (condition-case nil (scroll-down arg) (beginning-of-buffer (goto-char (point-min))))) @@ -528,7 +535,7 @@ of the accessible part of the buffer. Don't use this command in Lisp programs! \(goto-char (point-max)) is faster and avoids clobbering the mark." (interactive "P") - (setq mark-active nil) + (pc-select-maybe-deactivate-mark) (let ((size (- (point-max) (point-min)))) (goto-char (if arg (- (point-max) @@ -561,14 +568,14 @@ Don't use this command in Lisp programs! "Ensure mark is active; move point left ARG characters (right if ARG negative). On attempt to pass beginning or end of buffer, stop and signal error." (interactive "p") - (ensure-mark) + (pc-select-ensure-mark) (backward-char arg)) (defun backward-word-mark (&optional arg) "Ensure mark is active; move backward until encountering the end of a word. With argument, do this that many times." (interactive "p") - (ensure-mark) + (pc-select-ensure-mark) (backward-word arg)) (defun backward-sexp-mark (&optional arg) @@ -576,7 +583,7 @@ With argument, do this that many times." With argument, do it that many times. Negative arg -N means move forward across N balanced expressions." (interactive "p") - (ensure-mark) + (pc-select-ensure-mark) (backward-sexp arg)) (defun backward-paragraph-mark (&optional arg) @@ -591,7 +598,7 @@ blank line. See `forward-paragraph' for more information." (interactive "p") - (ensure-mark) + (pc-select-ensure-mark) (backward-paragraph arg)) (defun previous-line-mark (&optional arg) @@ -608,7 +615,7 @@ If you are thinking of using this in a Lisp program, consider using `forward-line' with a negative argument instead. It is usually easier to use and more reliable (no dependence on goal column, etc.)." (interactive "p") - (ensure-mark) + (pc-select-ensure-mark) (with-no-warnings (previous-line arg)) (setq this-command 'previous-line)) @@ -617,7 +624,7 @@ to use and more reliable (no dependence on goal column, etc.)." With argument ARG not nil or 1, move forward ARG - 1 lines first. If scan reaches end of buffer, stop there without error." (interactive "p") - (ensure-mark) + (pc-select-ensure-mark) (beginning-of-line arg)) @@ -627,7 +634,7 @@ A near full screen is `next-screen-context-lines' less than a full screen. Negative ARG means scroll downward. When calling from a program, supply a number as argument or nil." (interactive "P") - (ensure-mark) + (pc-select-ensure-mark) (cond (pc-select-override-scroll-error (condition-case nil (scroll-up arg) (end-of-buffer (goto-char (point-max))))) @@ -643,7 +650,7 @@ of the accessible part of the buffer. Don't use this command in Lisp programs! \(goto-char (p\oint-min)) is faster and avoids clobbering the mark." (interactive "P") - (ensure-mark) + (pc-select-ensure-mark) (let ((size (- (point-max) (point-min)))) (goto-char (if arg (+ (point-min) @@ -663,14 +670,14 @@ Don't use this command in Lisp programs! "Deactivate mark; move point left ARG characters (right if ARG negative). On attempt to pass beginning or end of buffer, stop and signal error." (interactive "p") - (setq mark-active nil) + (pc-select-maybe-deactivate-mark) (backward-char arg)) (defun backward-word-nomark (&optional arg) "Deactivate mark; move backward until encountering the end of a word. With argument, do this that many times." (interactive "p") - (setq mark-active nil) + (pc-select-maybe-deactivate-mark) (backward-word arg)) (defun backward-sexp-nomark (&optional arg) @@ -678,7 +685,7 @@ With argument, do this that many times." With argument, do it that many times. Negative arg -N means move forward across N balanced expressions." (interactive "p") - (setq mark-active nil) + (pc-select-maybe-deactivate-mark) (backward-sexp arg)) (defun backward-paragraph-nomark (&optional arg) @@ -693,7 +700,7 @@ blank line. See `forward-paragraph' for more information." (interactive "p") - (setq mark-active nil) + (pc-select-maybe-deactivate-mark) (backward-paragraph arg)) (defun previous-line-nomark (&optional arg) @@ -706,7 +713,7 @@ The command \\[set-goal-column] can be used to create a semipermanent goal column to which this command always moves. Then it does not try to move vertically." (interactive "p") - (setq mark-active nil) + (pc-select-maybe-deactivate-mark) (with-no-warnings (previous-line arg)) (setq this-command 'previous-line)) @@ -715,7 +722,7 @@ Then it does not try to move vertically." With argument ARG not nil or 1, move forward ARG - 1 lines first. If scan reaches end of buffer, stop there without error." (interactive "p") - (setq mark-active nil) + (pc-select-maybe-deactivate-mark) (beginning-of-line arg)) (defun scroll-up-nomark (&optional arg) @@ -724,7 +731,7 @@ A near full screen is `next-screen-context-lines' less than a full screen. Negative ARG means scroll downward. When calling from a program, supply a number as argument or nil." (interactive "P") - (setq mark-active nil) + (pc-select-maybe-deactivate-mark) (cond (pc-select-override-scroll-error (condition-case nil (scroll-up arg) (end-of-buffer (goto-char (point-max))))) @@ -740,7 +747,7 @@ of the accessible part of the buffer. Don't use this command in Lisp programs! \(goto-char (point-min)) is faster and avoids clobbering the mark." (interactive "P") - (setq mark-active nil) + (pc-select-maybe-deactivate-mark) (let ((size (- (point-max) (point-min)))) (goto-char (if arg (+ (point-min) @@ -968,21 +975,5 @@ but before calling PC Selection mode): (setq pc-select-key-bindings-alist nil pc-select-saved-settings-alist nil)))) - -;;;###autoload -(defcustom pc-selection-mode nil - "Toggle PC Selection mode. -Change mark behavior to emulate Motif, MAC or MS-Windows cut and paste style, -and cursor movement commands. -This mode enables Delete Selection mode and Transient Mark mode. -Setting this variable directly does not take effect; -you must modify it using \\[customize] or \\[pc-selection-mode]." - :set (lambda (symbol value) - (pc-selection-mode (if value 1 -1))) - :initialize 'custom-initialize-default - :type 'boolean - :group 'pc-select - :require 'pc-select) - -;;; arch-tag: 10697b70-ae07-4f3e-ad23-7814a3f418c2 +;; arch-tag: 10697b70-ae07-4f3e-ad23-7814a3f418c2 ;;; pc-select.el ends here diff --git a/lisp/emulation/tpu-edt.el b/lisp/emulation/tpu-edt.el index 425ac450fae..c5ae34e0f07 100644 --- a/lisp/emulation/tpu-edt.el +++ b/lisp/emulation/tpu-edt.el @@ -273,7 +273,6 @@ ;;; Code: -(eval-when-compile (require 'cl)) ;; we use picture-mode functions (require 'picture) @@ -1367,6 +1366,9 @@ The search is performed in the current direction." ;; tpu-search-forward (t) tpu-search-reverse (t) ;; tpu-search-forward-exit (t) tpu-search-backward-exit (t) +(declare-function tpu-emacs-search "tpu-edt") +(declare-function tpu-emacs-rev-search "tpu-edt") + (defun tpu-set-search (&optional arg) "Set the search functions and set the search direction to the current direction. If an argument is specified, don't set the search direction." @@ -2432,7 +2434,10 @@ If FILE is nil, try to load a default file. The default file names are (if (eq tpu-global-map parent) (set-keymap-parent map (keymap-parent parent)) (setq map parent))))) - (ignore-errors (ad-disable-regexp "\\`tpu-")) + ;; Only has an effect if the advice in tpu-extras has been activated. + (condition-case nil + (with-no-warnings (ad-disable-regexp "\\`tpu-")) + (error nil)) (setq tpu-edt-mode nil)) diff --git a/lisp/emulation/vi.el b/lisp/emulation/vi.el index 81ad04b60d9..de7bcffdf0e 100644 --- a/lisp/emulation/vi.el +++ b/lisp/emulation/vi.el @@ -1375,6 +1375,8 @@ The following CHAR will be the name for the command or macro." (setq char (read-char)) (vi-ask-for-info char)))) +(declare-function c-mark-function "cc-cmds" ()) + (defun vi-mark-region (arg region) "Mark region appropriately. The next char REGION is d(efun),s(-exp),b(uffer), p(aragraph), P(age), f(unction in C/Pascal etc.), w(ord), e(nd of sentence), diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 5e13edb9495..8603169819f 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el @@ -27,7 +27,6 @@ ;;; Code: (provide 'viper-cmd) -(require 'advice) ;; Compiler pacifier (defvar viper-minibuffer-current-face) @@ -48,23 +47,6 @@ (defvar initial) (defvar undo-beg-posn) (defvar undo-end-posn) - -;; loading happens only in non-interactive compilation -;; in order to spare non-viperized emacs from being viperized -(if noninteractive - (eval-when-compile - (let ((load-path (cons (expand-file-name ".") load-path))) - (or (featurep 'viper-util) - (load "viper-util.el" nil nil 'nosuffix)) - (or (featurep 'viper-keym) - (load "viper-keym.el" nil nil 'nosuffix)) - (or (featurep 'viper-mous) - (load "viper-mous.el" nil nil 'nosuffix)) - (or (featurep 'viper-macs) - (load "viper-macs.el" nil nil 'nosuffix)) - (or (featurep 'viper-ex) - (load "viper-ex.el" nil nil 'nosuffix)) - ))) ;; end pacifier @@ -3097,6 +3079,9 @@ On reaching beginning of line, stop and signal error." (setq this-command 'next-line) (if com (viper-execute-com 'viper-next-line val com)))) +(declare-function widget-type "wid-edit" (widget)) +(declare-function widget-button-press "wid-edit" (pos &optional event)) +(declare-function viper-set-hooks "viper" ()) (defun viper-next-line-at-bol (arg) "Next line at beginning of line. diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el index caeecd12c8a..ccc06e0b938 100644 --- a/lisp/emulation/viper-ex.el +++ b/lisp/emulation/viper-ex.el @@ -47,12 +47,8 @@ (if noninteractive (eval-when-compile (let ((load-path (cons (expand-file-name ".") load-path))) - (or (featurep 'viper-util) - (load "viper-util.el" nil nil 'nosuffix)) - (or (featurep 'viper-keym) - (load "viper-keym.el" nil nil 'nosuffix)) (or (featurep 'viper-cmd) - (load "viper-cmd.el" nil nil 'nosuffix)) + (load "viper-cmd.el" nil t 'nosuffix)) ))) ;; end pacifier diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el index 1b1e07a0a0c..539a561bb5b 100644 --- a/lisp/emulation/viper-init.el +++ b/lisp/emulation/viper-init.el @@ -26,8 +26,6 @@ ;;; Code: -(provide 'viper-init) - ;; compiler pacifier (defvar mark-even-if-inactive) (defvar quail-mode) @@ -429,15 +427,11 @@ delete the text being replaced, as in standard Vi." "*Cursor color when Viper is in Replace state." :type 'string :group 'viper) -(if (fboundp 'make-variable-frame-local) - (make-variable-frame-local 'viper-replace-overlay-cursor-color)) (defcustom viper-insert-state-cursor-color "Green" "Cursor color when Viper is in insert state." :type 'string :group 'viper) -(if (fboundp 'make-variable-frame-local) - (make-variable-frame-local 'viper-insert-state-cursor-color)) ;; viper-emacs-state-cursor-color doesn't work well. Causes cursor colors to be ;; confused in some cases. So, this var is nulled for now. @@ -446,13 +440,17 @@ delete the text being replaced, as in standard Vi." "Cursor color when Viper is in Emacs state." :type 'string :group 'viper) -(if (fboundp 'make-variable-frame-local) - (make-variable-frame-local 'viper-emacs-state-cursor-color)) ;; internal var, used to remember the default cursor color of emacs frames (defvar viper-vi-state-cursor-color nil) + (if (fboundp 'make-variable-frame-local) - (make-variable-frame-local 'viper-vi-state-cursor-color)) + (mapc 'make-variable-frame-local + '(viper-replace-overlay-cursor-color + viper-insert-state-cursor-color + viper-emacs-state-cursor-color + viper-vi-state-cursor-color))) + (viper-deflocalvar viper-replace-overlay nil "") (put 'viper-replace-overlay 'permanent-local t) @@ -1025,6 +1023,9 @@ Should be set in `~/.viper' file." (setq cursor-type '(bar . 2)))) +(provide 'viper-init) + + ;; Local Variables: ;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun) ;; End: diff --git a/lisp/emulation/viper-keym.el b/lisp/emulation/viper-keym.el index 0e502720f5e..85a94075720 100644 --- a/lisp/emulation/viper-keym.el +++ b/lisp/emulation/viper-keym.el @@ -26,8 +26,6 @@ ;;; Code: -(provide 'viper-keym) - ;; compiler pacifier (defvar viper-always) (defvar viper-current-state) @@ -35,19 +33,13 @@ (defvar viper-expert-level) (defvar viper-ex-style-editing) (defvar viper-ex-style-motion) - -;; loading happens only in non-interactive compilation -;; in order to spare non-viperized emacs from being viperized -(if noninteractive - (eval-when-compile - (let ((load-path (cons (expand-file-name ".") load-path))) - (or (featurep 'viper-util) - (load "viper-util.el" nil nil 'nosuffix)) - ))) ;; end pacifier (require 'viper-util) +(declare-function viper-ex "viper-ex" (arg &optional string)) +(declare-function viper-normalize-minor-mode-map-alist "viper-cmd" ()) +(declare-function viper-set-mode-vars-for "viper-cmd" (state)) ;;; Variables @@ -702,6 +694,9 @@ form ((key . function) (key . function) ... )." alist)) +(provide 'viper-keym) + + ;;; Local Variables: ;;; eval: (put 'viper-deflocalvar 'lisp-indent-hook 'defun) ;;; End: diff --git a/lisp/emulation/viper-macs.el b/lisp/emulation/viper-macs.el index 788feaf86e6..6eb7687c4e6 100644 --- a/lisp/emulation/viper-macs.el +++ b/lisp/emulation/viper-macs.el @@ -39,14 +39,8 @@ (if noninteractive (eval-when-compile (let ((load-path (cons (expand-file-name ".") load-path))) - (or (featurep 'viper-util) - (load "viper-util.el" nil nil 'nosuffix)) - (or (featurep 'viper-keym) - (load "viper-keym.el" nil nil 'nosuffix)) - (or (featurep 'viper-mous) - (load "viper-mous.el" nil nil 'nosuffix)) (or (featurep 'viper-cmd) - (load "viper-cmd.el" nil nil 'nosuffix)) + (load "viper-cmd.el" nil t 'nosuffix)) ))) ;; end pacifier diff --git a/lisp/emulation/viper-mous.el b/lisp/emulation/viper-mous.el index 7a47d321890..dd727cd5f84 100644 --- a/lisp/emulation/viper-mous.el +++ b/lisp/emulation/viper-mous.el @@ -42,10 +42,8 @@ (if noninteractive (eval-when-compile (let ((load-path (cons (expand-file-name ".") load-path))) - (or (featurep 'viper-util) - (load "viper-util.el" nil nil 'nosuffix)) (or (featurep 'viper-cmd) - (load "viper-cmd.el" nil nil 'nosuffix)) + (load "viper-cmd.el" nil t 'nosuffix)) ))) ;; end pacifier diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el index c757eb63aef..87bf5235b81 100644 --- a/lisp/emulation/viper-util.el +++ b/lisp/emulation/viper-util.el @@ -44,12 +44,6 @@ (require 'ring) -(if noninteractive - (eval-when-compile - (let ((load-path (cons (expand-file-name ".") load-path))) - (or (featurep 'viper-init) - (load "viper-init.el" nil nil 'nosuffix)) - ))) ;; end pacifier (require 'viper-init) @@ -380,6 +374,8 @@ +(declare-function viper-forward-Word "viper-cmd" (arg)) + ;;; Support for :e, :r, :w file globbing ;; Glob the file spec. diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el index 65d40e8bad7..bb3e4eb583d 100644 --- a/lisp/emulation/viper.el +++ b/lisp/emulation/viper.el @@ -297,28 +297,15 @@ ;;; Code: -(require 'advice) -(require 'ring) - ;; compiler pacifier (defvar mark-even-if-inactive) (defvar quail-mode) (defvar viper-expert-level) (defvar viper-mode-string) (defvar viper-major-mode-modifier-list) - -;; loading happens only in non-interactive compilation -;; in order to spare non-viperized emacs from being viperized -(if noninteractive - (eval-when-compile - (let ((load-path (cons (expand-file-name ".") load-path))) - (or (featurep 'viper-init) - (load "viper-init.el" nil nil 'nosuffix)) - (or (featurep 'viper-cmd) - (load "viper-cmd.el" nil nil 'nosuffix)) - ))) ;; end pacifier +(require 'advice) (require 'viper-init) (require 'viper-keym) |