RE: bbdb-print.el lexical binding breaks bbdb-print-record
On Tue Jul 11 2017 Vincent Belaïche wrote: > Just to mention that the code based on cl-progv which I have > supplied does not work. I don't have any time to investigate why, > so if you want to take my patch, please take the 1st one (that > based on lambda). I believe the purpose of cl-progv is to provide a let binding where the var list is determined at run time. This is achieved by `eval'ing the let form. Yet to deal with lexical bindings, `eval' needs to know the lexical environment (as a 2nd arg for eval) that cl-progv does not provide. Barak's patch has done exactly that and I also used the same approach in bbdb-tex.el. -- 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-print.el lexical binding breaks bbdb-print-record
Hello, Just to mention that the code based on cl-progv which I have supplied does not work. I don't have any time to investigate why, so if you want to take my patch, please take the 1st one (that based on lambda). Vincent. De : Vincent Belaïche Envoyé : jeudi 29 juin 2017 15:05 À : Roland Winkler; BBDB info list Objet : RE: bbdb-print.el lexical binding breaks bbdb-print-record Ooops... there was some mistake in the code based on cl-progv which I supplied. Just to be 100% clear about this alternative solution, it would be as in the attached patch bug-1.diff. V. De : Vincent Belaïche Envoyé : jeudi 29 juin 2017 13:24:53 À : Roland Winkler; BBDB info list Objet : bbdb-print.el lexical binding breaks bbdb-print-record Hello Roland, With lexical binding bbdb-print-record makes a void variable error on address variable. Attached is a fix. I use a lambda expression to make the binding dynmical so that bbdb-print-require can be evalled in the correct context. An alternative fix would have been to use : (cl-progv '(first-letter name organization mail phone address xfields) (list first-letter name organization mail phone address xfields)). Well, to avoid any duplication in this case, it would be better to use some macro like this: (defmacro bbdb-do-cl-progv (&rest l) `(cl-progv (quote ,l) (list ,@l))) and then in bdbd-print-record: (bbdb-do-cl-progv first-letter name organization mail phone address xfields)(list first-letter name organization mail phone address xfields) Anyway, I prefer the lambda trick, I don't like cl-progv and eval. Probably lambdas are more portable to old Emacs versions. Vincent. -- 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/
[BBDB] New branch latex (was: bbdb-print.el lexical binding breaks bbdb-print-record)
> With lexical binding bbdb-print-record makes a void variable error > on address variable. As I told you before, I really didn't like the old / outdated code used in bbdb-print.el, and I didn't want to invest in it anymore. So I created a branch latex in the BBDB repository on savannah that is really a re-write of bbdb-print.el, based on the idea that nowadays LaTeX is the better way to go than plain tex. To avoid confusion, I renamed the file to bbdb-tex.el. I put all this into a branch because I am open for comments and suggestions. Also, there might be bugs I have overlooked. The basic idea underlying bbdb-tex.el is described in the commentary section of this file: ;; Generally, lisp customizations in bbdb-tex are intended to provide control ;; of what appears in the TeX listing. But there are no lisp customization ;; options to control the actual layout that should be handled by LaTeX. ;; BBDB is shipped with one basic LaTeX style file bbdb.sty to handle ;; the TeX macros listed above. You should customize this LaTeX style file ;; to match your taste and / or your needs. Note also that `bbdb-tex-alist' ;; allows you to specify an arbitrary number of rules that may use different ;; style files for the above TeX macros. -- 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-print.el lexical binding breaks bbdb-print-record
Hello Bob, I did not have any problem with the Bbdb Print Tex Path. Certainly because on my machine it was already customized with the usual customization interface (M-x cutomize-variable...) to an existing path. Problably, if not, bbdb-print.el should be robust to that and test if the directory exists to provide a suitable error message. V. De : Bob Newell Envoyé : vendredi 30 juin 2017 06:51:40 À : BBDB info list Objet : Re: bbdb-print.el lexical binding breaks bbdb-print-record I also ran into this a while ago. I did a kludge fix in my initialization: (setq bbdb-print-require t) but of course this makes even blank records print, so it is not exactly recommended for anything other than a quick and sloppy workaround. By the way I also had to do this as I was having a problem with the tex-path being undefined: (setq bbdb-print-tex-path '("/home/bnewell/.emacs.d/elpa/")) and, in addition, the melpa package didn't seem to have the .tex files so I had to fetch the git distribution and copy them over. -- Bob Newell Honolulu, Hawai`i Sent via Linux Mint 17. -- 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/ -- 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-print.el lexical binding breaks bbdb-print-record
I also ran into this a while ago. I did a kludge fix in my initialization: (setq bbdb-print-require t) but of course this makes even blank records print, so it is not exactly recommended for anything other than a quick and sloppy workaround. By the way I also had to do this as I was having a problem with the tex-path being undefined: (setq bbdb-print-tex-path '("/home/bnewell/.emacs.d/elpa/")) and, in addition, the melpa package didn't seem to have the .tex files so I had to fetch the git distribution and copy them over. -- Bob Newell Honolulu, Hawai`i Sent via Linux Mint 17. -- 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-print.el lexical binding breaks bbdb-print-record
I can't find this suggest-v3.x branch which you refer to here: https://github.com/barak/BBDB/branches/all V. De : Barak A. Pearlmutter Envoyé : jeudi 29 juin 2017 15:16 À : Roland Winkler Cc : Vincent Belaïche; BBDB info list Objet : Re: bbdb-print.el lexical binding breaks bbdb-print-record I've also made a fix for this, see github.com/barak/bbdb3 commit 7469e6e which is the tip of branch suggest-v3.x It uses a slightly different mechanism to accomplish similar ends. -- 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-print.el lexical binding breaks bbdb-print-record
Ooops... there was some mistake in the code based on cl-progv which I supplied. Just to be 100% clear about this alternative solution, it would be as in the attached patch bug-1.diff. V. De : Vincent Belaïche Envoyé : jeudi 29 juin 2017 13:24:53 À : Roland Winkler; BBDB info list Objet : bbdb-print.el lexical binding breaks bbdb-print-record Hello Roland, With lexical binding bbdb-print-record makes a void variable error on address variable. Attached is a fix. I use a lambda expression to make the binding dynmical so that bbdb-print-require can be evalled in the correct context. An alternative fix would have been to use : (cl-progv '(first-letter name organization mail phone address xfields) (list first-letter name organization mail phone address xfields)). Well, to avoid any duplication in this case, it would be better to use some macro like this: (defmacro bbdb-do-cl-progv (&rest l) `(cl-progv (quote ,l) (list ,@l))) and then in bdbd-print-record: (bbdb-do-cl-progv first-letter name organization mail phone address xfields)(list first-letter name organization mail phone address xfields) Anyway, I prefer the lambda trick, I don't like cl-progv and eval. Probably lambdas are more portable to old Emacs versions. Vincent. bug-1.diff Description: bug-1.diff -- 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/
bbdb-print.el lexical binding breaks bbdb-print-record
Hello Roland, With lexical binding bbdb-print-record makes a void variable error on address variable. Attached is a fix. I use a lambda expression to make the binding dynmical so that bbdb-print-require can be evalled in the correct context. An alternative fix would have been to use : (cl-progv '(first-letter name organization mail phone address xfields) (list first-letter name organization mail phone address xfields)). Well, to avoid any duplication in this case, it would be better to use some macro like this: (defmacro bbdb-do-cl-progv (&rest l) `(cl-progv (quote ,l) (list ,@l))) and then in bdbd-print-record: (bbdb-do-cl-progv first-letter name organization mail phone address xfields)(list first-letter name organization mail phone address xfields) Anyway, I prefer the lambda trick, I don't like cl-progv and eval. Probably lambdas are more portable to old Emacs versions. Vincent. bug.diff Description: bug.diff -- 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/