From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.bugs Subject: bug#10998: Allow movements in bookmark-bmenu-search Date: Mon, 01 Oct 2012 09:45:42 +0200 Organization: Emacs Helm Message-ID: <87zk46hbyx.fsf@gmail.com> References: <87r4wy1hdn.fsf@gmail.com> <877grahkso.fsf@floss.red-bean.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1349077616 13830 80.91.229.3 (1 Oct 2012 07:46:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Oct 2012 07:46:56 +0000 (UTC) To: 10998@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 01 09:47:02 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TIaiO-000107-HL for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Oct 2012 09:46:56 +0200 Original-Received: from localhost ([::1]:44003 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIaiJ-0008NX-2z for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 Oct 2012 03:46:51 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIaiA-0008N8-Un for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2012 03:46:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TIai4-0000Qo-Qe for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2012 03:46:42 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:54198) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIai4-0000Qg-Mq for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2012 03:46:36 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1TIaiT-0007Nb-LP for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2012 03:47:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <87r4wy1hdn.fsf@gmail.com> Resent-From: Thierry Volpiatto Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Oct 2012 07:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10998 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.134907759728334 (code B ref -1); Mon, 01 Oct 2012 07:47:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 1 Oct 2012 07:46:37 +0000 Original-Received: from localhost ([127.0.0.1]:35511 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TIai5-0007Mw-3G for submit@debbugs.gnu.org; Mon, 01 Oct 2012 03:46:37 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:57376) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TIai1-0007Mn-Ut for submit@debbugs.gnu.org; Mon, 01 Oct 2012 03:46:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TIahb-0000Ep-9B for submit@debbugs.gnu.org; Mon, 01 Oct 2012 03:46:08 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:53578) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIahb-0000EZ-5O for submit@debbugs.gnu.org; Mon, 01 Oct 2012 03:46:07 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:43977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIahU-0008Jt-VK for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2012 03:46:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TIahQ-0000AE-Il for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2012 03:46:00 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:37890) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TIahQ-00009X-8j for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2012 03:45:56 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TIahT-0007wc-1O for bug-gnu-emacs@gnu.org; Mon, 01 Oct 2012 09:45:59 +0200 Original-Received: from lbe83-2-78-243-104-167.fbx.proxad.net ([78.243.104.167]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 01 Oct 2012 09:45:58 +0200 Original-Received: from thierry.volpiatto by lbe83-2-78-243-104-167.fbx.proxad.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 01 Oct 2012 09:45:58 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 86 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lbe83-2-78-243-104-167.fbx.proxad.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) Cancel-Lock: sha1:PUe43R2i5GanDH0KyolYbqHQDog= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:65062 Archived-At: Karl Fogel writes: > The code has changed somewhat since the original patch -- it now uses > `pcase' instead of `case', for example (and thus `_' instead of `t'), > ever since monnier@iro.umontreal.ca-20120710115154-012cs2xbndtlpvh1. > > Furthermore, in http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10998#11 > Thierry said "the patch sent contain free-variables, it is fixed here" > but there was no new patch attached. It is fixed "here" mean I fixed this on my own version of bookmark but didn't send any patch because no body was interested by this change. It is working with no problem since then. > So, I've adjusted the original patch (see below) and done some light > testing, but I'm not confident enough in this to commit it yet. > Thierry, what were those free variables? Don't remember that was more than one year ago. > And can you test this to make sure it behaves as your original patch > did? I have not anymore this patch. You will find bookmark-extensions.el at: https://github.com/thierryvolpiatto/emacs-bmk-ext.git Install it and try cursor movements to see if it behave like your patch. Here the function: #+BEGIN_SRC lisp (defun bookmark-read-search-input () "Read each keyboard input and add it to `bookmark-search-pattern'." (let ((prompt (propertize "Pattern: " 'face 'minibuffer-prompt)) (tmp-list ()) (index 0)) (while (let ((char (read-key (concat prompt (bookmark-set-cursor-in-prompt bookmark-search-pattern index tmp-list))))) (case char ((?\e ?\r) nil) ; RET or ESC break the search loop. (?\C-g (setq bookmark-quit-flag t) nil) (?\d (with-no-warnings ; Delete last char of pattern with DEL. (pop (nthcdr index tmp-list))) t) ;; Movements in minibuffer. (?\C-b ; backward-char. (setq index (min (1+ index) (length tmp-list))) t) (?\C-f ; forward-char. (setq index (max (1- index) 0)) t) (?\C-a ; move bol. (setq index (length tmp-list)) t) (?\C-e ; move eol. (setq index 0) t) (?\C-k (kill-new (substring bookmark-search-pattern (- (length tmp-list) index))) (setq tmp-list (nthcdr index tmp-list)) (setq index 0) t) (?\C-y (let ((str (car kill-ring))) (loop for char across str do (push char (nthcdr index tmp-list)))) t) (t (if (characterp char) (push char (nthcdr index tmp-list)) (setq unread-command-events (nconc (mapcar 'identity (this-single-command-raw-keys)) unread-command-events)) nil)))) (setq bookmark-search-pattern (apply 'string (reverse tmp-list)))))) #+END_SRC Note: I don't maintain anymore bookmark-extensions.el, only small bugfixes for my personal usage (e.g recently `bookmark-write-file') > I agree with Stefan that this is not an ideal solution, by the way, and > have left a comment in the patch below to that effect. Keep in mind that this is not a real minibuffer. -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997