(list-colors-display): Use with-help-window instead of with-output-to-temp-buffer.
[bpt/emacs.git] / lisp / simple.el
index ebf0a5f..572d7d6 100644 (file)
@@ -633,9 +633,16 @@ column specified by the function `current-left-margin'."
     (newline)
     (save-excursion
       (goto-char pos)
-      ;; Usually indent-according-to-mode should "preserve" point, but it is
-      ;; not guaranteed; e.g. indent-to-left-margin doesn't.
-      (save-excursion (indent-according-to-mode))
+      ;; We are at EOL before the call to indent-according-to-mode, and
+      ;; after it we usually are as well, but not always.  We tried to
+      ;; address it with `save-excursion' but that uses a normal marker
+      ;; whereas we need `move after insertion', so we do the save/restore
+      ;; by hand.
+      (setq pos (copy-marker pos t))
+      (indent-according-to-mode)
+      (goto-char pos)
+      ;; Remove the trailing white-space after indentation because
+      ;; indentation may introduce the whitespace.
       (delete-horizontal-space t))
     (indent-according-to-mode)))
 
@@ -1295,7 +1302,11 @@ makes the search case-sensitive."
   "Puts element of the minibuffer history in the minibuffer.
 The argument NABS specifies the absolute history position."
   (interactive "p")
-  (let ((minimum (if minibuffer-default -1 0))
+  (let ((minimum (if minibuffer-default
+                    (- (if (listp minibuffer-default)
+                           (length minibuffer-default)
+                         1))
+                  0))
        elt minibuffer-returned-to-present)
     (if (and (zerop minibuffer-history-position)
             (null minibuffer-text-before-history))
@@ -1317,8 +1328,10 @@ The argument NABS specifies the absolute history position."
     (goto-char (point-max))
     (delete-minibuffer-contents)
     (setq minibuffer-history-position nabs)
-    (cond ((= nabs -1)
-          (setq elt minibuffer-default))
+    (cond ((< nabs 0)
+          (setq elt (if (listp minibuffer-default)
+                        (nth (1- (abs nabs)) minibuffer-default)
+                      minibuffer-default)))
          ((= nabs 0)
           (setq elt (or minibuffer-text-before-history ""))
           (setq minibuffer-returned-to-present t)
@@ -2548,8 +2561,6 @@ the text which should be made available.
 The second, optional, argument PUSH, has the same meaning as the
 similar argument to `x-set-cut-buffer', which see.")
 
-(make-variable-frame-local 'interprogram-cut-function)
-
 (defvar interprogram-paste-function nil
   "Function to call to get text cut from other programs.
 
@@ -2575,8 +2586,6 @@ most recent string, the function should return nil.  If it is
 difficult to tell whether Emacs or some other program provided the
 current string, it is probably good enough to return nil if the string
 is equal (according to `string=') to the last text Emacs provided.")
-
-(make-variable-frame-local 'interprogram-paste-function)
 \f
 
 
@@ -5828,7 +5837,7 @@ works by saving the value of `buffer-invisibility-spec' and setting it to nil."
 (defconst bad-packages-alist
   ;; Not sure exactly which semantic versions have problems.
   ;; Definitely 2.0pre3, probably all 2.0pre's before this.
-  '((semantic semantic-version "2\\.0pre[1-3]"
+  '((semantic semantic-version "\\`2\\.0pre[1-3]\\'"
               "The version of `semantic' loaded does not work in Emacs 22.
 It can cause constant high CPU load.
 Upgrade to at least Semantic 2.0pre4 (distributed with CEDET 1.0pre4).")