]> code.delx.au - gnu-emacs/blobdiff - lisp/simple.el
(fancy-splash-screens, normal-splash-screen):
[gnu-emacs] / lisp / simple.el
index 3e089d4e1a801cf06c4a3860a2cb5aa5e21710b1..b2d7ff29257620ecdd3d7b79b8546771daa4837b 100644 (file)
@@ -128,7 +128,7 @@ If no other buffer exists, the buffer `*scratch*' is returned."
   :group 'next-error
   :version "22.1")
 
-(defcustom next-error-highlight 0.1
+(defcustom next-error-highlight 0.5
   "*Highlighting of locations in selected source buffers.
 If number, highlight the locus in `next-error' face for given time in seconds.
 If t, highlight the locus indefinitely until some other locus replaces it.
@@ -141,8 +141,8 @@ If `fringe-arrow', indicate the locus by the fringe arrow."
   :group 'next-error
   :version "22.1")
 
-(defcustom next-error-highlight-no-select 0.1
-  "*Highlighting of locations in non-selected source buffers.
+(defcustom next-error-highlight-no-select 0.5
+  "*Highlighting of locations in `next-error-no-select'.
 If number, highlight the locus in `next-error' face for given time in seconds.
 If t, highlight the locus indefinitely until some other locus replaces it.
 If nil, don't highlight the locus in the source buffer.
@@ -2659,7 +2659,7 @@ The argument is used for internal purposes; do not supply one."
 ;; This is actually used in subr.el but defcustom does not work there.
 (defcustom yank-excluded-properties
   '(read-only invisible intangible field mouse-face help-echo local-map keymap
-    yank-handler follow-link)
+    yank-handler follow-link fontified)
   "*Text properties to discard when yanking.
 The value should be a list of text properties to discard or t,
 which means to discard all text properties."
@@ -3487,49 +3487,51 @@ Outline mode sets this."
          (set-window-vscroll nil (- vs (frame-char-height)) t)))
 
     ;; Move forward (down).
-    (let ((wvis (window-line-visibility)))
-      (when (or (null wvis)
-               (and (consp wvis)
-                    (or (>= (car wvis) (frame-char-height))
-                        (>= (cdr wvis) (frame-char-height)))))
-       (let* ((wend (window-end nil t))
-              (evis (or (pos-visible-in-window-p wend nil t)
-                        (pos-visible-in-window-p (1- wend) nil t)))
-              (rbot (nth 3 evis))
-              (vpos (nth 5 evis))
-              ppos py vs)
-         (cond
-          ;; Last window line should be visible - fail if not.
-          ((null evis)
-           nil)
-          ;; If last line of window is fully visible, move forward.
-          ((null rbot)
-           nil)
-          ;; If cursor is not in the bottom scroll margin, move forward.
-          ((< (setq ppos (posn-at-point)
-                    py (cdr (or (posn-actual-col-row ppos)
-                                (posn-col-row ppos))))
-              (min (- (window-text-height) scroll-margin 1) (1- vpos)))
-           nil)
-          ;; When already vscrolled, we vscroll some more if we can,
-          ;; or clear vscroll and move forward at end of tall image.
-          ((> (setq vs (window-vscroll nil t)) 0)
-           (when (> rbot 0)
-             (set-window-vscroll nil (+ vs (min rbot (frame-char-height))) t)))
-          ;; If cursor just entered the bottom scroll margin, move forward,
-          ;; but also vscroll one line so redisplay wont recenter.
-          ((= py (min (- (window-text-height) scroll-margin 1)
-                      (1- vpos)))
-           (set-window-vscroll nil (frame-char-height) t)
-           (line-move-1 arg noerror to-end)
-           t)
-          ;; If there are lines above the last line, scroll-up one line.
-          ((> vpos 0)
-           (scroll-up 1)
-           t)
-          ;; Finally, start vscroll.
-          (t
-           (set-window-vscroll nil (frame-char-height) t))))))))
+    (let* ((lh (window-line-height -1))
+          (vpos (nth 1 lh))
+          (ypos (nth 2 lh))
+          (rbot (nth 3 lh))
+          ppos py vs)
+      (when (or (null lh)
+               (>= rbot (frame-char-height))
+               (<= ypos (- (frame-char-height))))
+       (unless lh
+         (let ((wend (pos-visible-in-window-p t nil t)))
+           (setq rbot (nth 3 wend)
+                 vpos (nth 5 wend))))
+       (cond
+        ;; If last line of window is fully visible, move forward.
+        ((or (null rbot) (= rbot 0))
+         nil)
+        ;; If cursor is not in the bottom scroll margin, move forward.
+        ((and (> vpos 0)
+              (< (setq py
+                       (or (nth 1 (window-line-height))
+                           (let ((ppos (posn-at-point)))
+                             (cdr (or (posn-actual-col-row ppos)
+                                      (posn-col-row ppos))))))
+                 (min (- (window-text-height) scroll-margin 1) (1- vpos))))
+         nil)
+        ;; When already vscrolled, we vscroll some more if we can,
+        ;; or clear vscroll and move forward at end of tall image.
+        ((> (setq vs (window-vscroll nil t)) 0)
+         (when (> rbot 0)
+           (set-window-vscroll nil (+ vs (min rbot (frame-char-height))) t)))
+        ;; If cursor just entered the bottom scroll margin, move forward,
+        ;; but also vscroll one line so redisplay wont recenter.
+        ((and (> vpos 0)
+              (= py (min (- (window-text-height) scroll-margin 1)
+                         (1- vpos))))
+         (set-window-vscroll nil (frame-char-height) t)
+         (line-move-1 arg noerror to-end)
+         t)
+        ;; If there are lines above the last line, scroll-up one line.
+        ((> vpos 0)
+         (scroll-up 1)
+         t)
+        ;; Finally, start vscroll.
+        (t
+         (set-window-vscroll nil (frame-char-height) t)))))))
 
 
 ;; This is like line-move-1 except that it also performs
@@ -3557,7 +3559,7 @@ Outline mode sets this."
   ;; for intermediate positions.
   (let ((inhibit-point-motion-hooks t)
        (opoint (point))
-       (forward (> arg 0)))
+       (orig-arg arg))
     (unwind-protect
        (progn
          (if (not (memq last-command '(next-line previous-line)))
@@ -3590,14 +3592,27 @@ Outline mode sets this."
                              'end-of-buffer)
                            nil)))
            ;; Move by arg lines, but ignore invisible ones.
-           (let (done)
+           (let (done line-end)
              (while (and (> arg 0) (not done))
                ;; If the following character is currently invisible,
                ;; skip all characters with that same `invisible' property value.
                (while (and (not (eobp)) (line-move-invisible-p (point)))
                  (goto-char (next-char-property-change (point))))
-               ;; Now move a line.
-               (end-of-line)
+               ;; Move a line.
+               ;; We don't use `end-of-line', since we want to escape
+               ;; from field boundaries ocurring exactly at point.
+               (let ((inhibit-field-text-motion t))
+                 (setq line-end (line-end-position)))
+               (goto-char (constrain-to-field line-end (point) t t))
+               ;; When moving a single line, update the goal-column
+               ;; if we couldn't move to the end of line due to a
+               ;; field boundary.  Otherwise we'll get stuck at the
+               ;; original position during the column motion in
+               ;; line-move-finish.
+               (and (/= line-end (point))
+                    (= orig-arg 1)
+                    (setq temporary-goal-column
+                          (max temporary-goal-column (current-column))))
                ;; If there's no invisibility here, move over the newline.
                (cond
                 ((eobp)
@@ -3655,7 +3670,7 @@ Outline mode sets this."
             (beginning-of-line))
            (t
             (line-move-finish (or goal-column temporary-goal-column)
-                              opoint forward))))))
+                              opoint (> orig-arg 0)))))))
 
 (defun line-move-finish (column opoint forward)
   (let ((repeat t))
@@ -3717,7 +3732,7 @@ Outline mode sets this."
        (goto-char opoint)
        (let ((inhibit-point-motion-hooks nil))
          (goto-char
-          (constrain-to-field new opoint nil t
+          (constrain-to-field new opoint t t
                               'inhibit-line-move-field-capture)))
 
        ;; If all this moved us to a different line,