On 2011-04-29 22:52 +0800, Roland Winkler wrote: > Why do you need the sit-for? Is this code not running sequentially?
Without the sit-for, if I limit the *BBDB* buffer (`S 1') to a record A that is not in the first screen (for example record number 100 should suffice), then switch to display all records, you will see that search-forward does not find that record A. I have no idea why that fails. I can reliably reproduce this on GNU Emacs 23.3.50.1 (x86_64-apple-darwin10.7.0, Carbon Version 1.6.0 AppKit 1038.35) of 2011-04-27. > Also, I would not search for the name. Each displayed record > includes a marker with the buffer position where it begins. So you > can right go to this position. (Check the variable bbdb-records in > the *BBDB* buffer.) Thanks for this. I didn't know about it. But somehow I still need the sit-for. This is the patch I am using now: diff --git a/lisp/bbdb-com.el b/lisp/bbdb-com.el index 7ce8898d..aa20e6bf 100644 --- a/lisp/bbdb-com.el +++ b/lisp/bbdb-com.el @@ -1399,7 +1399,11 @@ (defun bbdb-delete-records (records &optional noprompt) (defun bbdb-display-all-records (&optional layout) "Show all records." (interactive (list (bbdb-layout-prefix))) - (bbdb-display-records (bbdb-records) layout)) + (let ((current (ignore-errors (bbdb-current-record)))) + (bbdb-display-records (bbdb-records) layout) + (when (setq current (assq current bbdb-records)) + (sit-for 0) + (goto-char (nth 2 current))))) (defun bbdb-change-records-layout (records layout) (dolist (record records) > Yet I am not sure I understand the overall benefit of this change. > If someone wants to look through all his/her records, why should > point be at some particular record? While I do not use > bbdb-display-all-records very often, I guess I'd find myself jumping > to the beginning of the buffer each time I have invoked this > command. I put bbdb in displaying all records most of the time. Quite often I just use C-s to move to a specific record. It takes time to get to a record. I could imagine how annoying if `C-x n w' always move point to the beginning of buffer. Similarly annoying if bbdb goes from displaying some records to all records and move point to the first record. > Possibly such a feature is more suited for someone's personal bbdb > init file. Or am I missing something wonderful? > > Roland Leo ------------------------------------------------------------------------------ WhatsUp Gold - Download Free Network Management Software The most intuitive, comprehensive, and cost-effective network management toolset available today. Delivers lowest initial acquisition cost and overall TCO of any competing solution. http://p.sf.net/sfu/whatsupgold-sd _______________________________________________ bbdb-info@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bbdb-info BBDB Home Page: http://bbdb.sourceforge.net/