summaryrefslogtreecommitdiff
path: root/lisp/simple.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2005-01-22 21:39:38 +0000
committerMiles Bader <miles@gnu.org>2005-01-22 21:39:38 +0000
commit18643d1d412928c57690271c8b7a65e50503441f (patch)
treea9303ce501314fc316c20ca29928b2fa168d0421 /lisp/simple.el
parentcfa4901a57cc9920eec0401d8b33abac7d3f8e5b (diff)
parentddff82cf89b20912729a1483da3f28608b44115a (diff)
downloademacs-18643d1d412928c57690271c8b7a65e50503441f.tar.gz
emacs-18643d1d412928c57690271c8b7a65e50503441f.tar.bz2
emacs-18643d1d412928c57690271c8b7a65e50503441f.zip
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-4
Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-41 - miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-46 Update from CVS * miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-47 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-4 Merge from emacs--cvs-trunk--0 * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-5 Update from CVS: exi/gnus-faq.texi ([4.1]): Typo. * miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-6 Update from CVS
Diffstat (limited to 'lisp/simple.el')
-rw-r--r--lisp/simple.el31
1 files changed, 26 insertions, 5 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 77bdb47e250..c54c67ea8ac 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1,7 +1,7 @@
;;; simple.el --- basic editing commands for Emacs
;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-;; 2000, 2001, 2002, 2003, 2004
+;; 2000, 2001, 2002, 2003, 2004, 2005
;; Free Software Foundation, Inc.
;; Maintainer: FSF
@@ -647,13 +647,13 @@ If BACKWARD-ONLY is non-nil, only delete spaces before point."
(skip-chars-backward " \t")
(constrain-to-field nil orig-pos)))))
-(defun just-one-space (n)
+(defun just-one-space (&optional n)
"Delete all spaces and tabs around point, leaving one space (or N spaces)."
(interactive "*p")
(let ((orig-pos (point)))
(skip-chars-backward " \t")
(constrain-to-field nil orig-pos)
- (dotimes (i n)
+ (dotimes (i (or n 1))
(if (= (following-char) ?\ )
(forward-char 1)
(insert ?\ )))
@@ -3179,10 +3179,31 @@ Outline mode sets this."
(or (memq prop buffer-invisibility-spec)
(assq prop buffer-invisibility-spec)))))
+;; Perform vertical scrolling of tall images if necessary.
+(defun line-move (arg &optional noerror to-end)
+ (if auto-window-vscroll
+ (let ((forward (> arg 0))
+ (pvis (pos-visible-in-window-p (window-start) nil t)))
+ (if (and pvis (null (nth 2 pvis))
+ (> (nth (if forward 4 3) pvis) 0))
+ (set-window-vscroll nil
+ (if forward
+ (+ (window-vscroll nil t)
+ (min (nth 4 pvis)
+ (* (frame-char-height) arg)))
+ (max 0
+ (- (window-vscroll nil t)
+ (min (nth 3 pvis)
+ (* (frame-char-height) (- arg))))))
+ t)
+ (set-window-vscroll nil 0)
+ (line-move-1 arg noerror to-end)))
+ (line-move-1 arg noerror to-end)))
+
;; This is the guts of next-line and previous-line.
;; Arg says how many lines to move.
;; The value is t if we can move the specified number of lines.
-(defun line-move (arg &optional noerror to-end)
+(defun line-move-1 (arg &optional noerror to-end)
;; Don't run any point-motion hooks, and disregard intangibility,
;; for intermediate positions.
(let ((inhibit-point-motion-hooks t)
@@ -4001,7 +4022,7 @@ when it is off screen)."
(setq matching-paren
(let ((syntax (syntax-after blinkpos)))
(and (consp syntax)
- (eq (car syntax) 4)
+ (eq (logand (car syntax) 255) 4)
(cdr syntax)))
mismatch
(or (null matching-paren)