aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Paul Wallington2003-07-25 12:18:04 +0000
committerJohn Paul Wallington2003-07-25 12:18:04 +0000
commit1a0d0b6ab1e8107e7453b7a72e1c040d2da191f5 (patch)
tree0cfbafa2a33866754e2b5c60d93d44e0471d9763
parent60f8ea53494c5202476162acb984d968041ad1d5 (diff)
downloademacs-1a0d0b6ab1e8107e7453b7a72e1c040d2da191f5.tar.gz
emacs-1a0d0b6ab1e8107e7453b7a72e1c040d2da191f5.zip
(choose-completion-string): Use `minibufferp';
test `completion-reference-buffer' if `buffer' arg is nil. (push-mark): Use `when' and `unless'. (pop-mark): Use `when'.
-rw-r--r--lisp/simple.el38
1 files changed, 16 insertions, 22 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 8756d3e771a..5ab9d6bba7a 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2574,13 +2574,11 @@ Novice Emacs Lisp programmers often try to use the mark for the wrong
2574purposes. See the documentation of `set-mark' for more information. 2574purposes. See the documentation of `set-mark' for more information.
2575 2575
2576In Transient Mark mode, this does not activate the mark." 2576In Transient Mark mode, this does not activate the mark."
2577 (if (null (mark t)) 2577 (unless (null (mark t))
2578 nil
2579 (setq mark-ring (cons (copy-marker (mark-marker)) mark-ring)) 2578 (setq mark-ring (cons (copy-marker (mark-marker)) mark-ring))
2580 (if (> (length mark-ring) mark-ring-max) 2579 (when (> (length mark-ring) mark-ring-max)
2581 (progn 2580 (move-marker (car (nthcdr mark-ring-max mark-ring)) nil)
2582 (move-marker (car (nthcdr mark-ring-max mark-ring)) nil) 2581 (setcdr (nthcdr (1- mark-ring-max) mark-ring) nil)))
2583 (setcdr (nthcdr (1- mark-ring-max) mark-ring) nil))))
2584 (set-marker (mark-marker) (or location (point)) (current-buffer)) 2582 (set-marker (mark-marker) (or location (point)) (current-buffer))
2585 ;; Now push the mark on the global mark ring. 2583 ;; Now push the mark on the global mark ring.
2586 (if (and global-mark-ring 2584 (if (and global-mark-ring
@@ -2589,11 +2587,9 @@ In Transient Mark mode, this does not activate the mark."
2589 ;; Don't push another one. 2587 ;; Don't push another one.
2590 nil 2588 nil
2591 (setq global-mark-ring (cons (copy-marker (mark-marker)) global-mark-ring)) 2589 (setq global-mark-ring (cons (copy-marker (mark-marker)) global-mark-ring))
2592 (if (> (length global-mark-ring) global-mark-ring-max) 2590 (when (> (length global-mark-ring) global-mark-ring-max)
2593 (progn 2591 (move-marker (car (nthcdr global-mark-ring-max global-mark-ring)) nil)
2594 (move-marker (car (nthcdr global-mark-ring-max global-mark-ring)) 2592 (setcdr (nthcdr (1- global-mark-ring-max) global-mark-ring) nil)))
2595 nil)
2596 (setcdr (nthcdr (1- global-mark-ring-max) global-mark-ring) nil))))
2597 (or nomsg executing-kbd-macro (> (minibuffer-depth) 0) 2593 (or nomsg executing-kbd-macro (> (minibuffer-depth) 0)
2598 (message "Mark set")) 2594 (message "Mark set"))
2599 (if (or activate (not transient-mark-mode)) 2595 (if (or activate (not transient-mark-mode))
@@ -2603,14 +2599,13 @@ In Transient Mark mode, this does not activate the mark."
2603(defun pop-mark () 2599(defun pop-mark ()
2604 "Pop off mark ring into the buffer's actual mark. 2600 "Pop off mark ring into the buffer's actual mark.
2605Does not set point. Does nothing if mark ring is empty." 2601Does not set point. Does nothing if mark ring is empty."
2606 (if mark-ring 2602 (when mark-ring
2607 (progn 2603 (setq mark-ring (nconc mark-ring (list (copy-marker (mark-marker)))))
2608 (setq mark-ring (nconc mark-ring (list (copy-marker (mark-marker))))) 2604 (set-marker (mark-marker) (+ 0 (car mark-ring)) (current-buffer))
2609 (set-marker (mark-marker) (+ 0 (car mark-ring)) (current-buffer)) 2605 (deactivate-mark)
2610 (deactivate-mark) 2606 (move-marker (car mark-ring) nil)
2611 (move-marker (car mark-ring) nil) 2607 (if (null (mark t)) (ding))
2612 (if (null (mark t)) (ding)) 2608 (setq mark-ring (cdr mark-ring))))
2613 (setq mark-ring (cdr mark-ring)))))
2614 2609
2615(defalias 'exchange-dot-and-mark 'exchange-point-and-mark) 2610(defalias 'exchange-dot-and-mark 'exchange-point-and-mark)
2616(defun exchange-point-and-mark (&optional arg) 2611(defun exchange-point-and-mark (&optional arg)
@@ -3988,9 +3983,8 @@ to decide what to delete."
3988 ;; unless it is reading a file name and CHOICE is a directory, 3983 ;; unless it is reading a file name and CHOICE is a directory,
3989 ;; or completion-no-auto-exit is non-nil. 3984 ;; or completion-no-auto-exit is non-nil.
3990 3985
3991 (let ((buffer (or buffer completion-reference-buffer)) 3986 (let* ((buffer (or buffer completion-reference-buffer))
3992 (mini-p (string-match "\\` \\*Minibuf-[0-9]+\\*\\'" 3987 (mini-p (minibufferp buffer)))
3993 (buffer-name buffer))))
3994 ;; If BUFFER is a minibuffer, barf unless it's the currently 3988 ;; If BUFFER is a minibuffer, barf unless it's the currently
3995 ;; active minibuffer. 3989 ;; active minibuffer.
3996 (if (and mini-p 3990 (if (and mini-p