diff options
Diffstat (limited to 'lisp/emulation')
-rw-r--r-- | lisp/emulation/cua-base.el | 14 | ||||
-rw-r--r-- | lisp/emulation/cua-gmrk.el | 8 | ||||
-rw-r--r-- | lisp/emulation/cua-rect.el | 18 | ||||
-rw-r--r-- | lisp/emulation/edt-mapper.el | 6 | ||||
-rw-r--r-- | lisp/emulation/edt.el | 33 | ||||
-rw-r--r-- | lisp/emulation/tpu-edt.el | 66 | ||||
-rw-r--r-- | lisp/emulation/vi.el | 7 | ||||
-rw-r--r-- | lisp/emulation/vip.el | 13 | ||||
-rw-r--r-- | lisp/emulation/viper-ex.el | 2 | ||||
-rw-r--r-- | lisp/emulation/viper-mous.el | 2 |
10 files changed, 86 insertions, 83 deletions
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el index c6d479b173f..9aa6650810c 100644 --- a/lisp/emulation/cua-base.el +++ b/lisp/emulation/cua-base.el @@ -350,7 +350,7 @@ Must be set prior to enabling CUA." (defcustom cua-check-pending-input t "*If non-nil, don't override prefix key if input pending. -It is rumoured that input-pending-p is unreliable under some window +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) @@ -370,7 +370,7 @@ buffer is NOT modified, until you execute a command that actually modifies it. "*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 +an integer, CUA will look for existing tabs in a region around the rectangle, and only do the conversion if any tabs are already present. The number specifies then number of characters before and after the region marked by the rectangle to search." @@ -568,7 +568,7 @@ a cons (TYPE . COLOR), then both properties are affected." ;;; Low-level Interface (defvar cua-inhibit-cua-keys nil - "Buffer-local variable that may disable the cua keymappings.") + "Buffer-local variable that may disable the CUA keymappings.") (make-variable-buffer-local 'cua-inhibit-cua-keys) ;;; Aux. variables @@ -902,8 +902,8 @@ Activates the mark if a prefix argument is given." (defun cua-repeat-replace-region (arg) "Repeat replacing text of highlighted region with typed text. -Searches for the next streach of text identical to the region last -replaced by typing text over it and replaces it with the same streach +Searches for the next stretch of text identical to the region last +replaced by typing text over it and replaces it with the same stretch of text." (interactive "P") (when cua--last-deleted-region-pos @@ -1331,7 +1331,7 @@ If ARG is the atom `-', scroll upward by nearly full screen." When enabled, using shifted movement keys will activate the region (and highlight the region using `transient-mark-mode'), and typed text replaces the active selection. C-z, C-x, C-c, and C-v will undo, cut, copy, and -paste (in addition to the normal emacs bindings)." +paste (in addition to the normal Emacs bindings)." :global t :group 'cua :set-after '(cua-enable-modeline-indications cua-use-hyper-key) @@ -1394,7 +1394,7 @@ paste (in addition to the normal emacs bindings)." (setq cua--saved-state nil)))) (defun cua-debug () - "Toggle cua debugging." + "Toggle CUA debugging." (interactive) (setq cua--debug (not cua--debug))) diff --git a/lisp/emulation/cua-gmrk.el b/lisp/emulation/cua-gmrk.el index b8874df0f34..68a28e1637a 100644 --- a/lisp/emulation/cua-gmrk.el +++ b/lisp/emulation/cua-gmrk.el @@ -96,7 +96,7 @@ When the global marker is set, CUA cut and copy commands will automatically insert the deleted or copied text before the global marker, even when the global marker is in another buffer. If the global marker isn't set, set the global marker at point in the current -buffer. Otherwise jump to the global marker position and cancel it. +buffer. Otherwise jump to the global marker position and cancel it. With prefix argument, don't jump to global mark when cancelling it." (interactive "P") (unless cua--global-mark-initialized @@ -105,7 +105,7 @@ With prefix argument, don't jump to global mark when cancelling it." (if (not buffer-read-only) (cua--activate-global-mark t) (ding) - (message "Cannot set global mark in read-only buffer.")) + (message "Cannot set global mark in read-only buffer")) (when (not stay) (pop-to-buffer (marker-buffer cua--global-mark-marker)) (goto-char cua--global-mark-marker)) @@ -165,7 +165,7 @@ With prefix argument, don't jump to global mark when cancelling it." (if (equal (marker-buffer cua--global-mark-marker) src-buf) (if (and (< start (marker-position cua--global-mark-marker)) (< (marker-position cua--global-mark-marker) end)) - (message "Can't move region into itself.") + (message "Can't move region into itself") (let ((text (buffer-substring-no-properties start end)) (p1 (copy-marker start)) (p2 (copy-marker end))) @@ -222,7 +222,7 @@ With prefix argument, don't jump to global mark when cancelling it." (setq in-rect t olist nil) (setq olist (cdr olist)))) (if in-rect - (message "Can't move rectangle into itself.") + (message "Can't move rectangle into itself") (let ((text (cua--extract-rectangle))) (cua--delete-rectangle) (goto-char (marker-position cua--global-mark-marker)) diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el index 72fd9195850..19360ac6845 100644 --- a/lisp/emulation/cua-rect.el +++ b/lisp/emulation/cua-rect.el @@ -992,7 +992,7 @@ With prefix argument, the toggle restriction." (defun cua-do-rectangle-padding () (interactive) (if buffer-read-only - (message "Cannot do padding in read-only buffer.") + (message "Cannot do padding in read-only buffer") (cua--rectangle-operation nil nil t t t) (cua--rectangle-set-corners)) (cua--keep-active)) @@ -1098,14 +1098,14 @@ The length of STRING need not be the same as the rectangle width." '(lambda (l r) (cua--rectangle-right (max l (+ l (length string) -1))))))) -(defun cua-fill-char-rectangle (ch) +(defun cua-fill-char-rectangle (character) "Replace CUA rectangle contents with CHARACTER." (interactive "cFill rectangle with character: ") (cua--rectangle-operation 'clear nil t 1 nil '(lambda (s e l r) (delete-region s e) (move-to-column l t) - (insert-char ch (- r l))))) + (insert-char character (- r l))))) (defun cua-replace-in-rectangle (regexp newtext) "Replace REGEXP with NEWTEXT in each line of CUA rectangle." @@ -1137,9 +1137,9 @@ The length of STRING need not be the same as the rectangle width." (t nil))))) (defvar cua--rectangle-seq-format "%d" - "Last format used by cua-sequence-rectangle.") + "Last format used by `cua-sequence-rectangle'.") -(defun cua-sequence-rectangle (first incr fmt) +(defun cua-sequence-rectangle (first incr format) "Resequence each line of CUA rectangle starting from FIRST. The numbers are formatted according to the FORMAT string." (interactive @@ -1150,13 +1150,13 @@ The numbers are formatted according to the FORMAT string." (string-to-number (read-string "Increment: (1) " nil nil "1")) (read-string (concat "Format: (" cua--rectangle-seq-format ") ")))) - (if (= (length fmt) 0) - (setq fmt cua--rectangle-seq-format) - (setq cua--rectangle-seq-format fmt)) + (if (= (length format) 0) + (setq format cua--rectangle-seq-format) + (setq cua--rectangle-seq-format format)) (cua--rectangle-operation 'clear nil t 1 nil '(lambda (s e l r) (delete-region s e) - (insert (format fmt first)) + (insert (format format first)) (setq first (+ first incr))))) (defmacro cua--convert-rectangle-as (command tabify) diff --git a/lisp/emulation/edt-mapper.el b/lisp/emulation/edt-mapper.el index e4943ff4a0a..5f824162676 100644 --- a/lisp/emulation/edt-mapper.el +++ b/lisp/emulation/edt-mapper.el @@ -113,7 +113,6 @@ (sit-for 600) (kill-emacs t))) - ;;; ;;; Decide Emacs Variant, GNU Emacs or XEmacs (aka Lucid Emacs). ;;; Determine Window System, and X Server Vendor (if appropriate). @@ -146,6 +145,11 @@ (defvar edt-return-seq nil) (defvar edt-term nil) +;; To silence the byte-compiler +(eval-when-compile + (defvar EDT-key-name) + (defvar edt-save-function-key-map)) + ;;; ;;; Determine Terminal Type (if appropriate). ;;; diff --git a/lisp/emulation/edt.el b/lisp/emulation/edt.el index 01f0af6f307..2b9a1118603 100644 --- a/lisp/emulation/edt.el +++ b/lisp/emulation/edt.el @@ -175,6 +175,20 @@ :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)) + ;;; ;;; Version Information ;;; @@ -332,6 +346,11 @@ This means that an edt-user.el file was found in the user's `load-path'.") (defvar edt-keys-file nil "User's custom keypad and function keys mappings to emulate LK-201 keyboard.") + +(defvar edt-last-copied-word nil + "Last word that the user copied.") + +(defvar zmacs-region-stays) ;;;; ;;;; EDT Emulation Commands @@ -1621,9 +1640,8 @@ Argument NUM is the percentage into the buffer to move." (defun edt-mark-section-wisely () "Mark the section in a manner consistent with the `major-mode'. -Uses `mark-defun' for emacs-lisp and Lisp, -mark-c-function for C, -mark-fortran-subsystem for fortran, +Uses `mark-defun' for Emacs-Lisp and Lisp, and for Fortran, +`c-mark-function' for C, and `mark-paragraph' for other modes." (interactive) (if edt-select-mode @@ -1631,15 +1649,13 @@ and `mark-paragraph' for other modes." (edt-reset)) (progn (cond ((or (eq major-mode 'emacs-lisp-mode) + (eq major-mode 'fortran-mode) (eq major-mode 'lisp-mode)) (mark-defun) (message "Lisp defun selected")) ((eq major-mode 'c-mode) - (mark-c-function) + (c-mark-function) (message "C function selected")) - ((eq major-mode 'fortran-mode) - (mark-fortran-subprogram) - (message "Fortran subprogram selected")) (t (mark-paragraph) (message "Paragraph selected")))))) @@ -1766,8 +1782,7 @@ Argument NUM is the number of times to duplicate the line." "Display the current time." (interactive) (if edt-x-emacs19-p (setq zmacs-region-stays t)) - (set 'time-string (current-time-string)) - (message "%s" time-string)) + (message "%s" (current-time-string))) ;;; ;;; LEARN diff --git a/lisp/emulation/tpu-edt.el b/lisp/emulation/tpu-edt.el index ec0eef05321..d685bec1e65 100644 --- a/lisp/emulation/tpu-edt.el +++ b/lisp/emulation/tpu-edt.el @@ -307,17 +307,11 @@ ;;; Emacs version identifiers - currently referenced by ;;; ;;; o tpu-mark o tpu-set-mark -;;; o tpu-string-prompt o tpu-regexp-prompt -;;; o tpu-edt-on o tpu-load-xkeys -;;; o tpu-update-mode-line o mode line section +;;; o mode line section o tpu-load-xkeys ;;; -(defconst tpu-emacs19-p (not (string-lessp emacs-version "19")) - "Non-nil if we are running Lucid Emacs or version 19.") - -(defconst tpu-lucid-emacs19-p - (and tpu-emacs19-p (string-match "Lucid" emacs-version)) - "Non-nil if we are running Lucid Emacs version 19.") - +(defconst tpu-lucid-emacs-p + (string-match "Lucid" emacs-version) + "Non-nil if we are running Lucid Emacs.") ;;; ;;; Global Keymaps @@ -341,10 +335,10 @@ GOLD is the ASCII 7-bit escape sequence <ESC>OP.") "Maps the function keys on the VT100 keyboard preceded by GOLD-SS3.") (defvar tpu-global-map nil "TPU-edt global keymap.") -(defvar tpu-original-global-map (copy-keymap global-map) +(defvar tpu-original-global-map global-map "Original global keymap.") -(and tpu-lucid-emacs19-p +(and tpu-lucid-emacs-p (defvar minibuffer-local-ns-map (make-sparse-keymap) "Hack to give Lucid Emacs the same maps as ordinary Emacs.")) @@ -463,13 +457,12 @@ GOLD is the ASCII 7-bit escape sequence <ESC>OP.") (defun tpu-update-mode-line nil "Make sure mode-line in the current buffer reflects all changes." (setq tpu-mark-flag (if transient-mark-mode "" (if (tpu-mark) " @" " "))) - (cond (tpu-emacs19-p (force-mode-line-update)) - (t (set-buffer-modified-p (buffer-modified-p)) (sit-for 0)))) + (force-mode-line-update)) -(cond (tpu-lucid-emacs19-p +(cond (tpu-lucid-emacs-p (add-hook 'zmacs-deactivate-region-hook 'tpu-update-mode-line) (add-hook 'zmacs-activate-region-hook 'tpu-update-mode-line)) - (tpu-emacs19-p + (t (add-hook 'activate-mark-hook 'tpu-update-mode-line) (add-hook 'deactivate-mark-hook 'tpu-update-mode-line))) @@ -542,26 +535,25 @@ Otherwise sets the tpu-match markers to nil and returns nil." (defun tpu-caar (thingy) (car (car thingy))) (defun tpu-cadr (thingy) (car (cdr thingy))) +(defvar zmacs-regions) + (defun tpu-mark nil "TPU-edt version of the mark function. Return the appropriate value of the mark for the current version of Emacs." - (cond (tpu-lucid-emacs19-p (mark (not zmacs-regions))) - (tpu-emacs19-p (and mark-active (mark (not transient-mark-mode)))) - (t (mark)))) + (cond (tpu-lucid-emacs-p (mark (not zmacs-regions))) + (t (and mark-active (mark (not transient-mark-mode)))))) (defun tpu-set-mark (pos) "TPU-edt version of the `set-mark' function. Sets the mark at POS and activates the region according to the current version of Emacs." (set-mark pos) - (and tpu-lucid-emacs19-p pos (zmacs-activate-region))) + (and tpu-lucid-emacs-p pos (zmacs-activate-region))) (defun tpu-string-prompt (prompt history-symbol) "Read a string with PROMPT." - (if tpu-emacs19-p - (read-from-minibuffer prompt nil nil nil history-symbol) - (read-string prompt))) + (read-from-minibuffer prompt nil nil nil history-symbol)) (defvar tpu-last-answer nil "Most recent response to tpu-y-or-n-p.") @@ -1118,9 +1110,7 @@ kills modified buffers without asking." (defun tpu-regexp-prompt (prompt) "Read a string, adding 'RE' to the prompt if tpu-regexp-p is set." (let ((re-prompt (concat (if tpu-regexp-p "RE ") prompt))) - (if tpu-emacs19-p - (read-from-minibuffer re-prompt nil nil nil 'tpu-regexp-prompt-hist) - (read-string re-prompt)))) + (read-from-minibuffer re-prompt nil nil nil 'tpu-regexp-prompt-hist))) (defun tpu-search-highlight nil (if (tpu-check-match) @@ -2017,8 +2007,6 @@ Accepts a prefix argument for the number of tpu-pan-columns to scroll." ;;; ;;; Define keymaps ;;; -(define-key global-map "\e[" CSI-map) ; CSI map -(define-key global-map "\eO" SS3-map) ; SS3 map (define-key SS3-map "P" GOLD-map) ; GOLD map (define-key GOLD-map "\e[" GOLD-CSI-map) ; GOLD-CSI map (define-key GOLD-map "\eO" GOLD-SS3-map) ; GOLD-SS3 map @@ -2276,24 +2264,12 @@ Accepts a prefix argument for the number of tpu-pan-columns to scroll." ;;; -;;; Repeat complex command map additions to make arrows work -;;; -(cond ((boundp 'repeat-complex-command-map) - (define-key repeat-complex-command-map "\e[A" 'previous-complex-command) - (define-key repeat-complex-command-map "\e[B" 'next-complex-command) - (define-key repeat-complex-command-map "\eOA" 'previous-complex-command) - (define-key repeat-complex-command-map "\eOB" 'next-complex-command))) - - -;;; ;;; Minibuffer map additions to make KP_enter = RET ;;; (define-key minibuffer-local-map "\eOM" 'exit-minibuffer) (define-key minibuffer-local-ns-map "\eOM" 'exit-minibuffer) (define-key minibuffer-local-completion-map "\eOM" 'exit-minibuffer) (define-key minibuffer-local-must-match-map "\eOM" 'minibuffer-complete-and-exit) -(and (boundp 'repeat-complex-command-map) - (define-key repeat-complex-command-map "\eOM" 'exit-minibuffer)) ;;; @@ -2407,10 +2383,10 @@ If FILE is nil, try to load a default file. The default file names are (setq file (expand-file-name file))) (tpu-xkeys-file (setq file (expand-file-name tpu-xkeys-file))) - (tpu-lucid-emacs19-p + (tpu-lucid-emacs-p (setq file (convert-standard-filename (expand-file-name "~/.tpu-lucid-keys")))) - (tpu-emacs19-p + (t (setq file (convert-standard-filename (expand-file-name "~/.tpu-keys"))) (and (not (file-exists-p file)) @@ -2503,6 +2479,10 @@ If FILE is nil, try to load a default file. The default file names are (setq-default page-delimiter "\f") (setq-default truncate-lines t) (setq scroll-step 1) + (setq tpu-original-global-map global-map) + (setq global-map (copy-keymap global-map)) + (define-key global-map "\e[" CSI-map) + (define-key global-map "\eO" SS3-map) (setq tpu-edt-mode t)))) (defun tpu-edt-off nil @@ -2516,7 +2496,7 @@ If FILE is nil, try to load a default file. The default file names are (setq-default page-delimiter "^\f") (setq-default truncate-lines nil) (setq scroll-step 0) - (setq global-map (copy-keymap tpu-original-global-map)) + (setq global-map tpu-original-global-map) (use-global-map global-map) (setq tpu-edt-mode nil)))) diff --git a/lisp/emulation/vi.el b/lisp/emulation/vi.el index d6b7c2728b2..559d1677347 100644 --- a/lisp/emulation/vi.el +++ b/lisp/emulation/vi.el @@ -314,7 +314,7 @@ command extensions.") (put 'mark-defun 'point-moving-unit 'region) (put 'mark-whole-buffer 'point-moving-unit 'region) (put 'mark-end-of-sentence 'point-moving-unit 'region) -(put 'mark-c-function 'point-moving-unit 'region) +(put 'c-mark-function 'point-moving-unit 'region) ;;; (defvar vi-mark-alist nil @@ -637,7 +637,8 @@ insert state." "Go to ARGth line." (interactive "P") (if (null (vi-raw-numeric-prefix arg)) - (end-of-buffer) + (with-no-warnings + (end-of-buffer)) (goto-line (vi-prefix-numeric-value arg)))) (defun vi-beginning-of-buffer () @@ -1384,7 +1385,7 @@ l(ines)." ((char-equal region ?b) (mark-whole-buffer)) ((char-equal region ?p) (mark-paragraph)) ((char-equal region ?P) (mark-page arg)) - ((char-equal region ?f) (mark-c-function)) + ((char-equal region ?f) (c-mark-function)) ((char-equal region ?w) (mark-word arg)) ((char-equal region ?e) (mark-end-of-sentence arg)) ((char-equal region ?l) (vi-mark-lines arg)) diff --git a/lisp/emulation/vip.el b/lisp/emulation/vip.el index 7584436e20a..6caa12179c0 100644 --- a/lisp/emulation/vip.el +++ b/lisp/emulation/vip.el @@ -1112,9 +1112,10 @@ the query replace mode will toggle between string replace and regexp replace." (replace-match (vip-read-string (format "Replace regexp \"%s\" with: " str)) nil nil)) - (replace-string - str - (vip-read-string (format "Replace \"%s\" with: " str))))))) + (with-no-warnings + (replace-string + str + (vip-read-string (format "Replace \"%s\" with: " str)))))))) ;; basic cursor movement. j, k, l, m commands. @@ -2830,7 +2831,8 @@ a token has type \(command, address, end-mark\) and value." (skip-chars-forward " \t") (if (looking-at "[\n|]") (error "Missing rhs")) (set-mark (point)) - (end-of-buffer) + (with-no-warnings + (end-of-buffer)) (backward-char 1) (setq string (buffer-substring (mark) (point)))) (if (not (lookup-key ex-map char)) @@ -2900,7 +2902,8 @@ a token has type \(command, address, end-mark\) and value." (setq file (buffer-substring (point) (mark))))) (if variant (shell-command command t) - (insert-file file)))) + (with-no-warnings + (insert-file file))))) (defun ex-set () (eval (list 'setq diff --git a/lisp/emulation/viper-ex.el b/lisp/emulation/viper-ex.el index c29e0e26ba5..4b1f06f1e9a 100644 --- a/lisp/emulation/viper-ex.el +++ b/lisp/emulation/viper-ex.el @@ -58,7 +58,7 @@ (require 'viper-util) (defgroup viper-ex nil - "Viper support for Ex commands" + "Viper support for Ex commands." :prefix "ex-" :group 'viper) diff --git a/lisp/emulation/viper-mous.el b/lisp/emulation/viper-mous.el index 250f7cf5a53..ec3f3ee8225 100644 --- a/lisp/emulation/viper-mous.el +++ b/lisp/emulation/viper-mous.el @@ -52,7 +52,7 @@ (defgroup viper-mouse nil - "Support for Viper special mouse-bound commands" + "Support for Viper special mouse-bound commands." :prefix "viper-" :group 'viper) |