Re: [BBDB] ChangeLog 2016-10-02: Use lexical binding

2016-10-22 Thread Stefan Monnier
>> The first solution binds the  variables lexically rather than
>> dynamically.  That means that if those  appear lexically inside
>> the  things will work correctly, but if  calls a function
>> which then refers to  this reference will fail.
> Thank you for the clarification.  The code in bbdb-anniv binds the
> variables lexcially via let which also contains the call of eval.
> So this is fine.

Not sure I understand.  You seem to describe something like

(let ((x1 v1)) ... (eval exp) ...)

in which case the evaluation of `exp' will not have access to `x1'.
What I suggested was

(eval exp `((x1 . ,v1)))

in which case the value of `exp' can contain references to `x1'.
But it's still different from a dynamic-binding of `x1', because

(let ((exp '(+ x1 4)))
  (eval exp `((x1 . 5

will correctly return 9, but

(defun my-f (y) (+ x1 y))
(let ((exp '(my-f 4)))
  (eval exp `((x1 . 5

will signal en error because `x1' is not visible to `my-f' (it's only
visible lexically within `exp').

In many cases, this is perfectly acceptable, in which case it's the
solution I recommend.


Stefan


--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: [BBDB] ChangeLog 2016-10-02: Use lexical binding

2016-10-04 Thread Stefan Monnier
> This variable contains forms that are evaluated using `eval',
> assuming that the variables appearing in this form are bound
> dynamically.  - I believe that old coding schemes like this one,

There are two ways to do that with lexical-binding:
- use (eval  `(( . ,) ( . ,) ...)
  which will not give the exact same behavior but works well in many
  cases (i.e. depends on the code put in diary-date-forms).
- use

(defvar ) (defvar ) ...
(let (( )
  ( )
  ...)
  (eval  t))

  which will preserve backward compatibility.


-- Stefan


--
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: Fixing completion cycles

2012-02-12 Thread Stefan Monnier
> my opinion, the biggest problem that needs to be solved before BBDB 3
> can be released is documentation (a re-write of the info manual).
> That's why so far BBDB 3 is only available from its git repository:
> # git clone git://git.savannah.nongnu.org/bbdb.git

I think a release without documentation would clarify the situation and
might even bring more contributors to fix the documentation problem,


Stefan


--
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: [BBDB] ChangeLog 2011-11-20

2011-11-24 Thread Stefan Monnier
> (defcustom bbdb-dwim-net-address-allow-redundancy nil
[...]
> So now there is
> (defcustom bbdb-mail-avoid-redundancy nil
[...]
> define-obsolete-variable-alias would not be too helpful here.

Agreed.  But it would make a lot of sense to do

   (defcustom bbdb-mail-avoid-redundancy
  (if (boundp 'bbdb-mail-avoid-redundancy)
  http://p.sf.net/sfu/splunk-novd2d
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: [PATCH] Better support for organisation-only records

2011-09-26 Thread Stefan Monnier
> "Direct editing" maybe similar to wdired-mode could be, indeed, a
> great thing. -- Yet as I said: I'll postpone such dreams till BBDB 3
> has been released.

No!  I want it now!
[...starts rolling on the floor screaming...]
Now! now! now! now! now!!


Stefan "Damn adults!"


--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: [PATCH] Better support for organisation-only records

2011-09-25 Thread Stefan Monnier
>> A much fancier solution would be to reimplement bbdb-create from
>> scratch by using something like a form to fill, similar to what
>> customize is using.
> I should add: Such a rather substantial change would have rather low
> priority on my current BBDB agenda. Currently, I consider a proper
> BBDB release more important.

Being able to (more or less) directly edit the *BBDB* buffer would
be great.


Stefan


--
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: function to add new records from email message

2011-08-07 Thread Stefan Monnier
> (local-set-key ":" '(lambda () (interactive)
[...]
>  bbdb/gnus-update-records-p'(lambda ()

Hmm... running for The Useless Use of Quote Award?


Stefan


--
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: TAB should move from field to field

2011-04-25 Thread Stefan Monnier
> If I could add a rider request to this, it would be great to have a
> single key command to copy the field contents to the kill ring (the way
> 'M' does now for the primary mail address). I often need to copy
> people's details to other places, and every time I do I wish I had this…

I'd personally even prefer if fields work as "sexp", so I can just use
M-C-SPC to mark a few fields and then M-w to copy them.
I.e. hooking into forward-sexp-function would suit my fingers.


Stefan


--
Fulfilling the Lean Software Promise
Lean software platforms are now widely adopted and the benefits have been 
demonstrated beyond question. Learn why your peers are replacing JEE 
containers with lightweight application servers - and what you can gain 
from the move. http://p.sf.net/sfu/vmware-sfemails
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Re: Non-nil default value in hook variables

2011-04-14 Thread Stefan Monnier
>> I suggest change all these defcustom instances something like:
>> 
>> (defcustom bbdb-create-hook nil
>> :group 'bbdb
>> :type 'hook)
>> (add-hook 'bbdb-create-hook 'bbdb-creation-date)

> Agreed and thanks, that looks much cleaner!

But then don't define them as defcustom but just defvars since Custom
gets confused by the add-hook.


Stefan


--
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: bbdb-mode-map should inherit from special-mode-map

2011-04-13 Thread Stefan Monnier
>>> +  (when (boundp 'revert-buffer-function)
>>> +(setq revert-buffer-function 'bbdb-revert-buffer))
>> 
>> I recommend to use (set (make-local-variable ) ) when setting
>> a buffer-local variable, even if you know that the variable is
>> automatically buffer-local.  One of the benefits is that you don't need
>> to check `boundp' in that case.

> I check for `boundp' because bbdb might be supposed to work on emacsen
> which may lack `revert-buffer-function'.

I thought so, but if you use `setq' you also need such a check to make
sure the variable has been defined and its make-variable-buffer-local
call happened, otherwise even if the variable is "automatically
buffer-local" the `setq' will modify the variable globally.
That's a good reason to use (set (make-local-variable ) ).

As for whether you need `boundp' to set a variable, I think that's not
the case: if your Emacs doesn't obey this variable, setting it
shouldn't do any harm (it'll just be ignored).


Stefan


--
Forrester Wave Report - Recovery time is now measured in hours and minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and vision.
Read this report now!  http://p.sf.net/sfu/ibm-webcastpromo
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: bbdb-mode-map should inherit from special-mode-map

2011-04-13 Thread Stefan Monnier
> +  (when (boundp 'revert-buffer-function)
> +(setq revert-buffer-function 'bbdb-revert-buffer))

I recommend to use (set (make-local-variable ) ) when setting
a buffer-local variable, even if you know that the variable is
automatically buffer-local.  One of the benefits is that you don't need
to check `boundp' in that case.


Stefan


--
Forrester Wave Report - Recovery time is now measured in hours and minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and vision.
Read this report now!  http://p.sf.net/sfu/ibm-webcastpromo
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: bbdb-complete-name return value

2011-03-05 Thread Stefan Monnier
> I thought that would be easier too, but it's counter-intuitive.

It's only counter intuitive if you think of it (and name it) something
like "score".  So yes, we need another name to make it less
counter-intuitive.  E.g. `completion-penalty'.  And I think it would be
good to make it clear that this is for cycling, so the name could be
`completion-cycle-penalty'.


Stefan


!   (let ((s1 (get-text-property 0 :completion-score c1))
! (s2 (get-text-property 0 :completion-score c2)))
! (cond ((and s1 s2) (< s1 s2))
!   (s1 t)
!   (s2 nil)

BTW, I'd rather use something like

!   (let ((s1 (get-text-property 0 :completion-score c1))
! (s2 (get-text-property 0 :completion-score c2)))
! (cond ((and s1 s2) (cond ((< s1 s2) t)
!  ((> s1 s2) nil)
!  (t (< (length c1) (length c2)
!   (s1 t)
!   (s2 nil)

PS: Please Cc the patch to emacs-devel because I don't read this
bbdb-list as regularly.


--
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: bbdb-complete-name return value

2011-02-28 Thread Stefan Monnier
> The only thing I need to clarify is sorting.  Right now shorter string
> wins.  In the new method, higher score should win.

I think it's easier if lower scores win, so it's consistent with the
current use of `length'.  It's really not a big issue: just negate the
values you put on the property and you're done.


Stefan


--
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: bbdb-complete-name return value

2011-02-27 Thread Stefan Monnier
TZ> Maybe accept the score as a property to the candidate strings and use
TZ> that property, if it exists, instead of the string length?
TZ> That would side-step the current completion mechanism nicely, requiring
TZ> little extra code except in the final sort of candidates.  If the
TZ> strings aren't mangled by the completion mechanism, of course--but I
TZ> don't think they are after a quick scan.

That would work.  It's a quick&simple solution (i.e. generally a good
sign), but it has one drawback: the properties will be often added
without being used, since the list of completions is used not only to
build the *Completions* buffer or to cycle through completions but also
to do TAB completion (often just handled by try-completion, but with
substring completion it instead needs to get the all-completions list
and then weed it out).

So it has a performance downside (which means, it's not the last word in
this respect), but I'd probably accept a patch to add such a feature to
minibuffer.el since the performance impact is only incurred by
completion tables that really use the feature and it's unlikely to be
a serious maintenance problem in the future.


Stefan


--
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: bbdb-complete-name return value

2011-02-13 Thread Stefan Monnier
>> IMO the cycling should only be based on scores.  That would, I think,
>> accomplish all your items and produce less "DWIM but that's not it."

Currently, the cycling code is fairly naive and it uses a fixed ordering
based on string length (shorter first).  Patches to make it more
customizable (by the completion table, not just by the end-user) would
be very welcome (e.g. for file completion, it could first cycle through
VCS-managed files).

> Do you have any thoughts / plans on implementing something like that
> for the generic completion code?

Directly, no.  But adding "hooks" so that the completion table can come
with its own sorting function, yes.


Stefan


--
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: bbdb-complete-name return value

2011-02-13 Thread Stefan Monnier
[ Apparently my messages don't make it to the list because the list
does not accept messages from the Gmane gateway. ]

> - One problem with completion in BBDB can be that if the algorithm
>   isn't optimized enough for its particular problem, it happens too
>   easily that the algorithm offers too many completions, so that
>   identifying the right ones becomes the search for a needle in a
>   haystick - which in the end is of little help.

The normal completion code was designed to handle the case of "many
completion candidates" reasonably well (i.e. by not cycling).
completion-cycle-threshold tries to combine the best of both worlds.

> - Individual completions can be pretty long. Not everybody has a
>   short address . So just a few completions can easily
>   occupy a lot of screen space, which adds to the confusion.

I'm not sure I understand what you're referring to.

> - In the end, BBDB can consider quite many criteria for possibly
>   including an address in the completion set (first names, last
>   names, AKAs, organizations, mail addresses,...). Sometimes I
>   wonder myself: why am I getting this completion here?? (And I am
>   getting very distracted by this kind of stuff...)
>   Of course, this behavior is customizable, but next time you miss
>   the completion you were aiming for...

I think it's important to ensure that the original string appears
somehow in the completion, to avoid such confusions.  That's one of the
basic ideas behind traditional completion.

> (1) Substring completion needs to have some understanding of the
> text that is completed so that completion starting points within
> the full strings are meaningful:

Current `substring' completion does not enjoy this property, but I've
bumped into this need in the past and I agree that there are many cases
where it would be very welcome.  We (c|sh)ould clearly add a such new
completion style that only consider substring matches that start at
a word-boundary.
 
> One could possibly use text properties to mark allowed starting
> points for substring completion in a string like 

We could also just accept CamelCase as a word boundary.  It'd probably
be just as easy to implement.

> (2) The algorithm needs to recognize which lexicographically
> unrelated mail addresses belong to one record so that cycling
> can be based on these entries only:

The generic completion is basically designed to make that very difficult
if not impossible: the user-provided string should appear somehow (the
definition of this somehow depends on the completion style) in the
suggested completions.

> -  and  might be addresses of the same
>   person so that we want to cycle through them

I think you can't do that with the generic completion code, but I also
think this is not actually a feature.  OTOH, the current code shouldn't
have any trouble cycling between

   "Henry Toto" 
and
   "Henry Toto" 

if the user typed "Henry T" or even "H T".

> So if all possible completions were calcluated in advance, the
> completion list could become something like a list of sublists,
> where each sublist means: these different strings should be
> considered for cycling.

The completion table can be a function: there's no need to precompute
all possible completions.

> combines these concepts. Namely, it should be customizable
> whether mail-abbrev expansion is tried first and then the
> completion command tries to use BBDB records for completion;
> or we do these steps in opposite order.

You can use completion-table-in-turn to combine two completion tables
into a new one that only considers the second when the first did not
find any candidates.  This said, this sometimes doesn't interacts too
well with non-prefix completions (these are bugs, tho, so we should be
hopefully able to fix them).


Stefan


--
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: bbdb-complete-name return value

2011-02-10 Thread Stefan Monnier
> In any event, a simple "t" after (run-hooks 'bbdb-complete-mail-hook)
> does the trick, but it probably needs to be changed in some other
> places.

Note also that I've already installed a hack in message.el (at least in
Emacs's trunk) that checks that the buffer really was not modified
before trusting a nil return value from bbdb, to work around
the problem.


Stefan


--
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: bbdb-complete-name return value

2011-02-10 Thread Stefan Monnier
> Currently bbdb-complete-mail (the new name of bbdb-complete-name)
> really has no well-defined return values whatsoever. Would it help
> if it returned non-nil whenever it had done "something"?

Yes, that's generally the expected behavior of completion functions.

> Would this be the right thing??

Since BBDB3 only works on Emacs≥23, its completion could use
completion-at-point-functions and/or completion-in-region.


Stefan


--
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/

Re: bbdb-popup-target-window-size (Re: BBDB 3.x documentation)

2011-02-04 Thread Stefan Monnier
>> Well, my recent discovery was that the variable name change
>> bbdb-popup-target-lines -> bbdb-popup-window-size in BBDB 3.x. They seem
>> to do the same thing (i.e. setting the target number of lines for the
>> bbdb-popup window). The default value was 5 but is now 0.5.

> You are right. I guess the change of the default happened when I
> added the code to use not only absolute line numbers but fractions
> of the window hight.  In general, my personal preference is to use
> the latter. I'll be happy to go back to the old default if that's
> what people prefer.

You can accept both, depending on whether the setting is an integer or
a float.


Stefan


--
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: whenever I expand a bbdb name at To:, trailing whitespace gets added when using the latest emacs

2011-01-20 Thread Stefan Monnier
> Whenever I expand a bbdb name at To:, trailing whitespace gets added
> when using the latest emacs.

It's probably the result of a change I made in message.el's completion
code.  I've seen a few other reports about it, but I can't reproduce it.
Could you give me more details: which version of BBDB are you running,
and which specific keys do you hit (and where) in order to cause
the expansion?


Stefan


--
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Re: BBDB ELPA-style packaging

2011-01-20 Thread Stefan Monnier
>> I'd be OK with providing BBDB3 in a beta form through
>> elpa.gnu.org. As long as the version string states it clearly,
>> which it will. You are likely to get plenty of feedback.
> Feedback is always appreciated!

Talking about feedback: is there some warning/discussion about the
change of format somewhere?  I'm very happy with your BBDB3 overall, but
the change of format is rather inconvenient (I share my bbdb file among
several machines and would prefer to not have to upgrade them all at the
same time).

>> A rewrite is the worst case, where you can't find the original
>> contributor or they are not willing to assign the copyright to the FSF.
> Some pieces of BBDB in their original form are rather old.
> So I exepct that tracking down the original contributor can be
> more difficult.

AFAICT the main problem will be that Jamie is known for refusing to sign
any copyright assignment for the FSF, and he's the original author, so
any code of his that survived will need a rewrite.

> My main question is the legal meaning of "rewrite". (Almost all code
> has been rewritten in one or the other way.)

If the similarity is due to the "API" (e.g. compatibility with user's
custom settings will force you to share variable names), I think that
such similarity is OK, but otherwise, the code should look sufficiently
different that the original author can't say "look they took my code".

> By the way, I already passed on the copyright to FSF for my
> "general" contributions to GNU Emacs.  Is this enough here?
> I'll be happy to do this once more.

For your own code, AFAIK your general assignment can be sufficient under
the condition that you send an email to ass...@gnu.org telling them that
you consider this code to be covered by your assignment (this is because
bbdb is not part of Emacs).

>> That's wonderful.  
> Yes and no  :-)

Hopefully your BBDB revival (and inclusion in the FSF's ELPA) will bring
new blood.  E.g. I've bumped into a few issues in the past but, for lack of
a place where to report them, I never bothered to send a patch.


Stefan


--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


(error "Attempt to split minibuffer window")

2011-01-14 Thread Stefan Monnier
When I invoke M-x bbdb from my minibuffer-only frame, BBDB burps with
the above error.  The Elisp backtrace is:

  split-window(# 0)
  bbdb-pop-up-buffer(t nil)
  bbdb-display-records-internal((...) multi-line nil t nil)
  bbdb-display-records((...) multi-line nil t)
  bbdb("" multi-line)
  call-interactively(bbdb t nil)
  execute-extended-command(nil)
  call-interactively(execute-extended-command nil nil)

This is with the CVS code from nongnu.org.


Stefan


PS: BTW, I suggest the patch below to let users initialize BBDB in their
.emacs with a single `load' (i.e. without messing with load-path
themselves):

--- Makefile.~1.2.~ 2010-12-15 01:24:53.0 -0500
+++ Makefile2011-01-14 21:06:59.0 -0500
@@ -88,6 +88,7 @@
 bbdb-autoloads.el: $(DEPSRCS)
@-$(RM) $@;
@echo "(provide 'bbdb-autoloads)" > $@;
+   @echo "(add-to-list 'load-path (or (file-name-directory load-file-name) 
(car load-path)))\n\n" >> $@;
@echo "" >> $@;
@$(emacs) -batch -l autoload \
--eval '(setq generated-autoload-file "'`pwd`'/$@")' \


--
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
___
bbdb-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/


Minor bug fixes

2003-09-29 Thread Stefan Monnier

The patch below (against the head of the sf.net CVS trunk) fixes
a namespace-pollution bug (`digit' should have been `bbdb-digit'
at least, although the patch fixes it in a different way) and a bug
in the migration query which appears if your `display-buffer' chooses
to display the query in a separate (typically dedicated) frame.
The patch also fixes the docstring to follow the convention that
the first line should be a complete sentence.


Stefan


cvs server: Diffing lisp
Index: lisp/bbdb-migrate.el
===
RCS file: /cvsroot/bbdb/bbdb/lisp/bbdb-migrate.el,v
retrieving revision 1.19
diff -u -r1.19 bbdb-migrate.el
--- lisp/bbdb-migrate.el19 Aug 2002 22:49:12 -  1.19
+++ lisp/bbdb-migrate.el26 Sep 2003 20:36:58 -
@@ -101,9 +101,9 @@
 
 ;;;###autoload
 (defun bbdb-migration-query (ondisk)
-  "Ask if the database is to be migrated.  ONDISK is the version
-number of the database as currently stored on disk.  Returns the
-version for the saved database."
+  "Ask if the database is to be migrated.
+ONDISK is the version number of the database as currently stored on disk.
+Returns the version for the saved database."
   (save-excursion
 (let ((wc (current-window-configuration))
   (buf (get-buffer-create "*BBDB Migration Info*"))
@@ -135,7 +135,11 @@
 (y-or-n-p (concat "Upgrade BBDB to version "
   (format "%d" bbdb-file-format)
   "? ")))
-  (delete-window win)
+  (condition-case nil
+ (delete-window win)
+   ;; The window might be the only one on its frame.  Hopefully, it's
+   ;; a dedicated window and the kill-buffer below will DTRT.
+   (error nil))
   (kill-buffer buf)
   (set-window-configuration wc)
   (if update bbdb-file-format ondisk
Index: lisp/bbdb-snarf.el
===
RCS file: /cvsroot/bbdb/bbdb/lisp/bbdb-snarf.el,v
retrieving revision 1.38
diff -u -r1.38 bbdb-snarf.el
--- lisp/bbdb-snarf.el  7 Mar 2003 22:12:41 -   1.38
+++ lisp/bbdb-snarf.el  26 Sep 2003 20:36:58 -
@@ -37,7 +37,6 @@
 (require 'rfc822)
 (require 'mail-extr)
 
-(defconst digit "[0-9]")
 (defvar bbdb-snarf-phone-regexp
   (concat
"\\(([2-9][0-9][0-9])[-. ]?\\|[2-9][0-9][0-9][-. ]\\)?"
@@ -46,11 +45,12 @@
)
   "regexp to match phones.")
 (defvar bbdb-snarf-zip-regexp
-  (concat
-   "\\<"
-   digit digit digit digit digit
-   "\\(-" digit digit digit digit "\\)?"
-   "\\>$")
+  (let ((digit "[0-9]"))
+(concat
+ "\\<"
+ digit digit digit digit digit
+ "\\(-" digit digit digit digit "\\)?"
+ "\\>$"))
   "regexp matching zip.")
 
 (defcustom bbdb-snarf-web-prop 'www


---
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
___
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/bbdb-info
BBDB Home Page: http://bbdb.sourceforge.net/