From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: C-f in isearch's non-incremental minibuffer edit Date: Sun, 17 Apr 2005 18:02:30 -0400 Message-ID: <87y8bh83ti.fsf-monnier+emacs@gnu.org> References: <87br8e6gt8.fsf-monnier+emacs@gnu.org> <87k6n22lvd.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1113775439 23788 80.91.229.2 (17 Apr 2005 22:03:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 17 Apr 2005 22:03:59 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 18 00:03:58 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DNHrk-0008Hz-GT for ged-emacs-devel@m.gmane.org; Mon, 18 Apr 2005 00:03:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DNHtD-0003Cf-HP for ged-emacs-devel@m.gmane.org; Sun, 17 Apr 2005 18:05:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DNHsa-000328-Ja for emacs-devel@gnu.org; Sun, 17 Apr 2005 18:04:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DNHsJ-0002tI-Rz for emacs-devel@gnu.org; Sun, 17 Apr 2005 18:04:21 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DNHsJ-0002t7-Pg for emacs-devel@gnu.org; Sun, 17 Apr 2005 18:04:19 -0400 Original-Received: from [209.226.175.4] (helo=tomts16-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DNHrx-0003G5-5M; Sun, 17 Apr 2005 18:03:57 -0400 Original-Received: from alfajor ([67.71.116.254]) by tomts16-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050417220230.XMOE27508.tomts16-srv.bellnexxia.net@alfajor>; Sun, 17 Apr 2005 18:02:30 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id 2646FD739B; Sun, 17 Apr 2005 18:02:30 -0400 (EDT) Original-To: rms@gnu.org In-Reply-To: (Richard Stallman's message of "Sun, 17 Apr 2005 15:19:59 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:36068 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:36068 >>>>> "Richard" == Richard Stallman writes: >> Could you tell me, at the level of user-visible behavior, how its >> currently differs from the usual history functionality? > No. It basically works the same, although maybe it doesn't skip > things in quite the same order. > Could you show me that patch again? The code you're removing > must have had some motivation. It might not be a good motivation, > but we can't judge it without seeing what it was. Here you go, Stefan --- orig/lisp/isearch.el +++ mod/lisp/isearch.el @@ -405,12 +403,6 @@ (let ((map (make-sparse-keymap))) (set-keymap-parent map minibuffer-local-map) (define-key map "\r" 'isearch-nonincremental-exit-minibuffer) - (define-key map "\M-n" 'isearch-ring-advance-edit) - (define-key map [next] 'isearch-ring-advance-edit) - (define-key map [down] 'isearch-ring-advance-edit) - (define-key map "\M-p" 'isearch-ring-retreat-edit) - (define-key map [prior] 'isearch-ring-retreat-edit) - (define-key map [up] 'isearch-ring-retreat-edit) (define-key map "\M-\t" 'isearch-complete-edit) (define-key map "\C-s" 'isearch-forward-exit-minibuffer) (define-key map "\C-r" 'isearch-reverse-exit-minibuffer) @@ -937,8 +903,6 @@ \\[isearch-nonincremental-exit-minibuffer] to do one nonincremental search. \\[isearch-forward-exit-minibuffer] to resume isearching forward. \\[isearch-reverse-exit-minibuffer] to resume isearching backward. -\\[isearch-ring-advance-edit] to replace the search string with the next item in the search ring. -\\[isearch-ring-retreat-edit] to replace the search string with the previous item in the search ring. \\[isearch-complete-edit] to complete the search string using the search ring. \\ If first char entered is \\[isearch-yank-word-or-char], then do word search instead." @@ -1024,12 +1024,12 @@ (isearch-unread e)) (setq cursor-in-echo-area nil) (setq isearch-new-string - (let (junk-ring) (read-from-minibuffer (isearch-message-prefix nil isearch-nonincremental) isearch-string minibuffer-local-isearch-map nil - 'junk-ring nil t)) + (if isearch-regexp 'regexp-search-ring 'search-ring) + nil t) isearch-new-message (mapconcat 'isearch-text-char-description isearch-new-string ""))) @@ -1860,49 +1890,6 @@ (interactive) (isearch-ring-adjust nil)) -(defun isearch-ring-advance-edit (n) - "Insert the next element of the search history into the minibuffer. -With prefix arg N, insert the Nth element." - (interactive "p") - (let* ((yank-pointer-name (if isearch-regexp - 'regexp-search-ring-yank-pointer - 'search-ring-yank-pointer)) - (yank-pointer (eval yank-pointer-name)) - (ring (if isearch-regexp regexp-search-ring search-ring)) - (length (length ring))) - (if (zerop length) - () - (set yank-pointer-name - (setq yank-pointer - (mod (- (or yank-pointer 0) n) - length))) - - (delete-field) - (insert (nth yank-pointer ring)) - (goto-char (point-max))))) - -(defun isearch-ring-retreat-edit (n) - "Insert the previous element of the search history into the minibuffer. -With prefix arg N, insert the Nth element." - (interactive "p") - (isearch-ring-advance-edit (- n))) - -;;(defun isearch-ring-adjust-edit (advance) -;; "Use the next or previous search string in the ring while in minibuffer." -;; (isearch-ring-adjust1 advance) -;; (erase-buffer) -;; (insert isearch-string)) - -;;(defun isearch-ring-advance-edit () -;; (interactive) -;; (isearch-ring-adjust-edit 'advance)) - -;;(defun isearch-ring-retreat-edit () -;; "Retreat to the previous search string in the ring while in the minibuffer." -;; (interactive) -;; (isearch-ring-adjust-edit nil)) - - (defun isearch-complete1 () ;; Helper for isearch-complete and isearch-complete-edit ;; Return t if completion OK, nil if no completion exists.