aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Blandy1992-06-10 02:47:07 +0000
committerJim Blandy1992-06-10 02:47:07 +0000
commit492878e483c355e6851d72cb4e395f069cd02964 (patch)
tree2baa750cf47f09df16d5c89e719e4c81e23d67ca
parent4de86b16296516788a3c65d98b13464c4462549a (diff)
downloademacs-492878e483c355e6851d72cb4e395f069cd02964.tar.gz
emacs-492878e483c355e6851d72cb4e395f069cd02964.zip
*** empty log message ***
-rw-r--r--lisp/emulation/vi.el15
-rw-r--r--lisp/startup.el8
-rw-r--r--lisp/subr.el22
-rw-r--r--lisp/sun-fns.el3
-rw-r--r--lisp/telnet.el13
-rw-r--r--lisp/term/x-win.el33
-rw-r--r--lisp/window.el7
7 files changed, 53 insertions, 48 deletions
diff --git a/lisp/emulation/vi.el b/lisp/emulation/vi.el
index fb76742c295..37293e9008f 100644
--- a/lisp/emulation/vi.el
+++ b/lisp/emulation/vi.el
@@ -1077,15 +1077,12 @@ If the optional after-p is given, put after/below the cursor."
1077 (error "Nothing in register %c" reg) 1077 (error "Nothing in register %c" reg)
1078 (if (null reg) (setq reg ?1)) ; the default is the last text killed 1078 (if (null reg) (setq reg ?1)) ; the default is the last text killed
1079 (setq put-text 1079 (setq put-text
1080 (if (and (>= reg ?1) (<= reg ?9)) 1080 (cond
1081 (let ((ring-length (length kill-ring))) 1081 ((and (>= reg ?1) (<= reg ?9))
1082 (setq this-command 'yank) ; So we may yank-pop !! 1082 (setq this-command 'yank) ; So we may yank-pop !!
1083 (nth (% (+ (- reg ?0 1) (- ring-length 1083 (current-kill (- reg ?0 1) 'do-not-rotate))
1084 (length kill-ring-yank-pointer))) 1084 ((stringp (get-register reg)) (get-register reg))
1085 ring-length) kill-ring)) 1085 (t (error "Register %c is not containing text string" reg))))
1086 (if (stringp (get-register reg))
1087 (get-register reg)
1088 (error "Register %c is not containing text string" reg))))
1089 (if (vi-string-end-with-nl-p put-text) ; put back text as lines 1086 (if (vi-string-end-with-nl-p put-text) ; put back text as lines
1090 (if after-p 1087 (if after-p
1091 (progn (next-line 1) (beginning-of-line)) 1088 (progn (next-line 1) (beginning-of-line))
diff --git a/lisp/startup.el b/lisp/startup.el
index 0afe3d934e8..067ecc28745 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -132,13 +132,7 @@ directory name of the directory where the `.emacs' file was looked for.")
132 (setq default-directory 132 (setq default-directory
133 (file-name-as-directory value)))))) 133 (file-name-as-directory value))))))
134 '("PWD" "HOME"))) 134 '("PWD" "HOME")))
135 (let ((tail directory-abbrev-alist)) 135 (setq default-directory (abbreviate-file-name default-directory))
136 (while tail
137 (if (string-match (car (car tail)) default-directory)
138 (setq default-directory
139 (concat (cdr (car tail))
140 (substring default-directory (match-end 0)))))
141 (setq tail (cdr tail))))
142 (unwind-protect 136 (unwind-protect
143 (command-line) 137 (command-line)
144 (run-hooks 'emacs-startup-hook) 138 (run-hooks 'emacs-startup-hook)
diff --git a/lisp/subr.el b/lisp/subr.el
index 05395c26c97..de97d76b426 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -1,12 +1,11 @@
1;;; subr.el --- basic lisp subroutines for Emacs 1;;; subr.el --- basic lisp subroutines for Emacs
2 2;;; Copyright (C) 1985, 1986, 1992 Free Software Foundation, Inc.
3;; Copyright (C) 1985, 1986 Free Software Foundation, Inc.
4 3
5;; This file is part of GNU Emacs. 4;; This file is part of GNU Emacs.
6 5
7;; GNU Emacs is free software; you can redistribute it and/or modify 6;; GNU Emacs is free software; you can redistribute it and/or modify
8;; it under the terms of the GNU General Public License as published by 7;; it under the terms of the GNU General Public License as published by
9;; the Free Software Foundation; either version 1, or (at your option) 8;; the Free Software Foundation; either version 2, or (at your option)
10;; any later version. 9;; any later version.
11 10
12;; GNU Emacs is distributed in the hope that it will be useful, 11;; GNU Emacs is distributed in the hope that it will be useful,
@@ -19,12 +18,15 @@
19;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20 19
21 20
22(defun one-window-p (&optional arg) 21(defun one-window-p (&optional nomini)
23 "Returns non-nil if there is only one window. 22 "Returns non-nil if there is only one window.
24Optional arg NOMINI non-nil means don't count the minibuffer 23Optional arg NOMINI non-nil means don't count the minibuffer
25even if it is active." 24even if it is active."
26 (eq (selected-window) 25 (let ((base-window (selected-window)))
27 (next-window (selected-window) (if arg 'arg)))) 26 (if (and nomini (eq base-window (minibuffer-window)))
27 (setq base-window (next-window base-window)))
28 (eq base-window
29 (next-window base-window (if nomini 'arg)))))
28 30
29(defun walk-windows (proc &optional minibuf all-screens) 31(defun walk-windows (proc &optional minibuf all-screens)
30 "Cycle through all visible windows, calling PROC for each one. 32 "Cycle through all visible windows, calling PROC for each one.
@@ -202,10 +204,10 @@ The normal global definition of the character C-x indirects to this keymap.")
202(fset 'ctl-x-4-prefix ctl-x-4-map) 204(fset 'ctl-x-4-prefix ctl-x-4-map)
203(define-key ctl-x-map "4" 'ctl-x-4-prefix) 205(define-key ctl-x-map "4" 'ctl-x-4-prefix)
204 206
205(defvar ctl-x-3-map (make-sparse-keymap) 207(defvar ctl-x-5-map (make-sparse-keymap)
206 "Keymap for screen commands.") 208 "Keymap for screen commands.")
207(fset 'ctl-x-3-prefix ctl-x-3-map) 209(fset 'ctl-x-5-prefix ctl-x-5-map)
208(define-key ctl-x-map "3" 'ctl-x-3-prefix) 210(define-key ctl-x-map "5" 'ctl-x-5-prefix)
209 211
210 212
211(defun run-hooks (&rest hooklist) 213(defun run-hooks (&rest hooklist)
@@ -349,5 +351,3 @@ and then modifies one entry in it."
349instead of having to write (function (lambda ...)) or '(lambda ...), the 351instead of having to write (function (lambda ...)) or '(lambda ...), the
350latter of which won't get byte-compiled." 352latter of which won't get byte-compiled."
351 (` (function (lambda (,@ cdr))))) 353 (` (function (lambda (,@ cdr)))))
352
353;;; subr.el ends here
diff --git a/lisp/sun-fns.el b/lisp/sun-fns.el
index 00fbcc4715a..95ed1ed50b3 100644
--- a/lisp/sun-fns.el
+++ b/lisp/sun-fns.el
@@ -231,8 +231,7 @@ See mouse-mark-thing for a description of the objects recognized."
231 (if (eq last-command 'yank) 231 (if (eq last-command 'yank)
232 (let ((before (< (point) (mark)))) 232 (let ((before (< (point) (mark))))
233 (delete-region (point) (mark)) 233 (delete-region (point) (mark))
234 (rotate-yank-pointer 1) 234 (insert (current-kill 1))
235 (insert (car kill-ring-yank-pointer))
236 (if before (exchange-point-and-mark))) 235 (if before (exchange-point-and-mark)))
237 (yank)) 236 (yank))
238 (setq this-command 'yank)) 237 (setq this-command 'yank))
diff --git a/lisp/telnet.el b/lisp/telnet.el
index 834885e8df0..ee11af6f63a 100644
--- a/lisp/telnet.el
+++ b/lisp/telnet.el
@@ -1,12 +1,11 @@
1;;; telnet.el --- run a telnet session from within an Emacs buffer 1;;; telnet.el --- run a telnet session from within an Emacs buffer
2 2;;; Copyright (C) 1985, 1988, 1992 Free Software Foundation, Inc.
3;; Copyright (C) 1985, 1988 Free Software Foundation, Inc.
4 3
5;; This file is part of GNU Emacs. 4;; This file is part of GNU Emacs.
6 5
7;; GNU Emacs is free software; you can redistribute it and/or modify 6;; GNU Emacs is free software; you can redistribute it and/or modify
8;; it under the terms of the GNU General Public License as published by 7;; it under the terms of the GNU General Public License as published by
9;; the Free Software Foundation; either version 1, or (at your option) 8;; the Free Software Foundation; either version 2, or (at your option)
10;; any later version. 9;; any later version.
11 10
12;; GNU Emacs is distributed in the hope that it will be useful, 11;; GNU Emacs is distributed in the hope that it will be useful,
@@ -29,6 +28,7 @@
29;; manner 28;; manner
30 29
31(require 'comint) 30(require 'comint)
31
32(defvar telnet-new-line "\r") 32(defvar telnet-new-line "\r")
33(defvar telnet-mode-map nil) 33(defvar telnet-mode-map nil)
34(defvar telnet-prompt-pattern "^[^#$%>]*[#$%>] *") 34(defvar telnet-prompt-pattern "^[^#$%>]*[#$%>] *")
@@ -120,6 +120,7 @@ rejecting one login and prompting for the again for a username and password.")
120 (set-buffer (process-buffer proc)) 120 (set-buffer (process-buffer proc))
121 (goto-char (process-mark proc)) 121 (goto-char (process-mark proc))
122 (let ((now (point))) 122 (let ((now (point)))
123 ;; Insert STRING, omitting all C-m characters.
123 (let ((index 0) c-m) 124 (let ((index 0) c-m)
124 (while (setq c-m (string-match "\C-m" string index)) 125 (while (setq c-m (string-match "\C-m" string index))
125 (insert-before-markers (substring string index c-m)) 126 (insert-before-markers (substring string index c-m))
@@ -137,7 +138,11 @@ rejecting one login and prompting for the again for a username and password.")
137 138
138(defun telnet-send-input () 139(defun telnet-send-input ()
139 (interactive) 140 (interactive)
140 (comint-send-input telnet-new-line telnet-remote-echoes)) 141; (comint-send-input telnet-new-line telnet-remote-echoes)
142 (comint-send-input)
143 (if telnet-remote-echoes
144 (delete-region comint-last-input-start
145 comint-last-input-end)))
141 146
142;;;###autoload 147;;;###autoload
143(defun telnet (arg) 148(defun telnet (arg)
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index 368e333d5cc..3f6cefe0a6f 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -437,25 +437,36 @@ This returns ARGS with the arguments that have been processed removed."
437(x-open-connection (or x-display-name 437(x-open-connection (or x-display-name
438 (setq x-display-name (getenv "DISPLAY")))) 438 (setq x-display-name (getenv "DISPLAY"))))
439 439
440;; xterm.c depends on using interrupt-driven input, but we don't want 440;;; xterm.c depends on using interrupt-driven input, but we don't want
441;; the fcntls to apply to the terminal, so we do this after opening 441;;; the fcntls to apply to the terminal, so we do this after opening
442;; the display. 442;;; the display.
443(set-input-mode t nil t) 443(set-input-mode t nil t)
444 444
445(setq screen-creation-function 'x-create-screen) 445(setq screen-creation-function 'x-create-screen)
446(setq suspend-hook 446(setq suspend-hook
447 '(lambda () 447 '(lambda ()
448 (error "Suspending an emacs running under X makes no sense"))) 448 (error "Suspending an emacs running under X makes no sense")))
449(setq interprogram-cut-function 'x-select-text)
450 449
451;; Make TEXT, a string, the primary and clipboard X selections. 450;;; Make TEXT, a string, the primary and clipboard X selections.
452;; If you are running xclipboard, this means you can effectively 451;;; If you are running xclipboard, this means you can effectively
453;; have a window on a copy of the kill-ring. 452;;; have a window on a copy of the kill-ring.
453;;; Also, set the value of X cut buffer 0, for backward compatibility
454;;; with older X application.
454(defun x-select-text (text) 455(defun x-select-text (text)
455 (if (eq window-system 'x) 456 (x-own-selection text 'cut-buffer0)
456 (progn 457 (x-own-selection text 'clipboard)
457 (x-own-selection text 'clipboard) 458 (x-own-selection text))
458 (x-own-selection text)))) 459
460;;; Return the value of the current X selection. For compatibility
461;;; with older X applications, this checks cut buffer 0 before
462;;; retrieving the value of the primary selection.
463(defun x-cut-buffer-or-selection-value ()
464 (or (x-selection-value 'cut-buffer0)
465 (x-selection-value)))
466
467;;; Arrange for the kill and yank functions to set and check the clipboard.
468(setq interprogram-cut-function 'x-select-text)
469(setq interprogram-paste-function 'x-cut-buffer-or-selection-value)
459 470
460;;; Turn off window-splitting optimization; X is usually fast enough 471;;; Turn off window-splitting optimization; X is usually fast enough
461;;; that this is only annoying. 472;;; that this is only annoying.
diff --git a/lisp/window.el b/lisp/window.el
index e8ed74a9553..25d90e777cf 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -1,12 +1,11 @@
1;;; windows.el --- GNU Emacs window commands aside from those written in C. 1;;; windows.el --- GNU Emacs window commands aside from those written in C.
2 2;;; Copyright (C) 1985, 1989, 1992 Free Software Foundation, Inc.
3;; Copyright (C) 1985, 1989 Free Software Foundation, Inc.
4 3
5;; This file is part of GNU Emacs. 4;; This file is part of GNU Emacs.
6 5
7;; GNU Emacs is free software; you can redistribute it and/or modify 6;; GNU Emacs is free software; you can redistribute it and/or modify
8;; it under the terms of the GNU General Public License as published by 7;; it under the terms of the GNU General Public License as published by
9;; the Free Software Foundation; either version 1, or (at your option) 8;; the Free Software Foundation; either version 2, or (at your option)
10;; any later version. 9;; any later version.
11 10
12;; GNU Emacs is distributed in the hope that it will be useful, 11;; GNU Emacs is distributed in the hope that it will be useful,
@@ -119,7 +118,7 @@ Use with a register previously set with \\[window-config-to-register]."
119 (set-window-configuration (get-register name))) 118 (set-window-configuration (get-register name)))
120 119
121(define-key ctl-x-map "2" 'split-window-vertically) 120(define-key ctl-x-map "2" 'split-window-vertically)
122(define-key ctl-x-map "5" 'split-window-horizontally) 121(define-key ctl-x-map "3" 'split-window-horizontally)
123(define-key ctl-x-map "6" 'window-config-to-register) 122(define-key ctl-x-map "6" 'window-config-to-register)
124(define-key ctl-x-map "7" 'register-to-window-config) 123(define-key ctl-x-map "7" 'register-to-window-config)
125(define-key ctl-x-map "}" 'enlarge-window-horizontally) 124(define-key ctl-x-map "}" 'enlarge-window-horizontally)