]> code.delx.au - gnu-emacs/blobdiff - lisp/replace.el
*** empty log message ***
[gnu-emacs] / lisp / replace.el
index ea1bd53e688764b0837c6281542cfdd9f46565cc..bb72acdf2cf6c8635b03945777ea660f778597bd 100644 (file)
@@ -88,7 +88,7 @@ is highlighted lazily using isearch lazy highlighting (see
 (defun query-replace-descr (string)
   (mapconcat 'isearch-text-char-description string ""))
 
-(defun query-replace-read-from (string regexp-flag)
+(defun query-replace-read-from (prompt regexp-flag)
   "Query and return the `from' argument of a query-replace operation.
 The return value can also be a pair (FROM . TO) indicating that the user
 wants to replace FROM with TO."
@@ -107,10 +107,10 @@ wants to replace FROM with TO."
                                      query-replace-from-history-variable))))
              (read-from-minibuffer
               (if (and lastto lastfrom)
-                  (format "%s (default %s -> %s): " string
+                  (format "%s (default %s -> %s): " prompt
                           (query-replace-descr lastfrom)
                           (query-replace-descr lastto))
-                (format "%s: " string))
+                (format "%s: " prompt))
               nil nil nil
               query-replace-from-history-variable
               nil t t))))
@@ -173,22 +173,22 @@ the original string if not."
     to))
 
 
-(defun query-replace-read-to (from string regexp-flag)
+(defun query-replace-read-to (from prompt regexp-flag)
   "Query and return the `to' argument of a query-replace operation."
   (query-replace-compile-replacement
    (save-excursion
      (read-from-minibuffer
-      (format "%s %s with: " string (query-replace-descr from))
+      (format "%s %s with: " prompt (query-replace-descr from))
       nil nil nil
       query-replace-to-history-variable from t t))
    regexp-flag))
 
-(defun query-replace-read-args (string regexp-flag &optional noerror)
+(defun query-replace-read-args (prompt regexp-flag &optional noerror)
   (unless noerror
     (barf-if-buffer-read-only))
-  (let* ((from (query-replace-read-from string regexp-flag))
+  (let* ((from (query-replace-read-from prompt regexp-flag))
         (to (if (consp from) (prog1 (cdr from) (setq from (car from)))
-              (query-replace-read-to from string regexp-flag))))
+              (query-replace-read-to from prompt regexp-flag))))
     (list from to current-prefix-arg)))
 
 (defun query-replace (from-string to-string &optional delimited start end)
@@ -907,7 +907,7 @@ If the value is nil, don't highlight the buffer names specially."
               (input
                (read-from-minibuffer
                 (if default
-                    (format "List lines matching regexp (default `%s'): "
+                    (format "List lines matching regexp (default %s): "
                             (query-replace-descr default))
                   "List lines matching regexp: ")
                 nil
@@ -1125,15 +1125,22 @@ See also `multi-occur'."
                    (let* ((out-line
                            (concat
                             ;; Using 7 digits aligns tabs properly.
-                            (apply #'propertize (format "%7d:" lines)
+                            (apply #'propertize (format "%7d" lines)
                                    (append
                                     (when prefix-face
                                       `(font-lock-face prefix-face))
-                                    '(occur-prefix t)))
+                                    `(occur-prefix t mouse-face highlight
+                                      occur-target ,marker follow-link t
+                                      help-echo "mouse-2: go to this occurrence")))
+                            ":"
                             ;; We don't put `mouse-face' on the newline,
                             ;; because that loses.  And don't put it
                             ;; on context lines to reduce flicker.
-                            (propertize curstring 'mouse-face 'highlight)
+                            (propertize curstring 'mouse-face 'highlight
+                                        'occur-target marker
+                                        'follow-link t
+                                        'help-echo
+                                        "mouse-2: go to this occurrence")
                             "\n"))
                           (data
                            (if (= nlines 0)
@@ -1154,10 +1161,7 @@ See also `multi-occur'."
                        (let ((beg (point))
                              (end (progn (insert data) (point))))
                          (unless (= nlines 0)
-                           (insert "-------\n"))
-                         (add-text-properties
-                          beg end
-                          `(occur-target ,marker help-echo "mouse-2: go to this occurrence")))))
+                           (insert "-------\n")))))
                    (goto-char endpt))
                  (if endpt
                      (progn