Emacs Lisp code: Easily Search for Text You've Selected |
Tuesday, December 1st, 2015 13:42:54 GMT |
Emacs Lisp |
(Updated at 9:27 AM EST.) I finally ran across a nice, slick way to be able to immediately search for the text I've selected in Emacs.
Most good text editors have something like that feature by default - but not Emacs, which was another maddening nuisance for me until today.
I found two solutions in this StackOverflow page. I prefer this solution, reproduced below.
I prefer the above because it even makes backward searching with C-r work right, not just forward searching with C-s, and acts normal when you search without selecting any text.
Prior to finding the above solutions in this StackOverflow post, the closest thing I had to a solution was the excellent highlight-symbol.el add-on.
Th highlight-symbol.el add-on is still very useful to me. The way I have it set up, I can press a single key - F4 - to search for whatever word (or function name, or whatever - even if it contains dashes and/or underscores) the point is resting inside. I can press Ctrl-F3 to easily replace that text. And I can press F3 to highlight that text throughout a buffer.
But, the highlight-symbol.el add-on doesn't provide a way to search for any arbitrary selected text, since that add-on doesn't require you to select text, nor pay any attention if you do select some text.
I'm still looking for a way to easily replace selected text, and will update this post if/when I find a way.
The original solution I tried only fixes forward searching, and erroneously selects blocks of text if you try to search without selecting any text. The second "search-selection" function from this StackOverflow post, reproduced below, along with the commands I added to my .emacs file to change the keychord C-s to make it use the "search-selection" function instead of "isearch-forward":
▲ Top ▼ Bottom △ TOC ↓ Down Up ↑
Emacs Lisp code: Right-Click to Highlight and Select Name - Sort of Like Notepad++ |
Wednesday, December 2nd, 2015 06:47:22 GMT |
Emacs Lisp |
The text (and code) editor Notepad++ has a nice feature where all you have to do to temporarily highlight a name (such as a variable name, function name, command name, or other words) everywhere is double-click on it.
Emacs doesn't do that out of the box, and I didn't find a way to make Emacs behave exactly like Notepad++.
But, I like the below behavior more in some ways anyway.
Sorry, I don't know how to get rid of the "Wrong type argument: syntax-table-p, nil" error message. But it seems to work fine despite that error message.
And the above code does interfere with whatever right-clicking is supposed to do by default. But the original default behavior of right-click was rather dangerous and useless-seeming - unexpectedly selecting blocks of text and often deleting any text that was already selected - so I'm glad to be rid of that, whatever that was.
The highlighting persists forever until you either right-click on the name again, or run the (highlight-symbol) function in some other way, such as clicking on the name and pressing F3 - the key I've bound to (highlight-symbol).
Right-clicking not only highlights the name, but also selects (or "marks", in Emacs jargon) some, most, or all of the name under your cursor (or "point", in Emacs jargon).
If you right-clicked anything other than a dash or underscore, the only thing that gets selected is the word you clicked. So, you can easily select individual words in a function or variable name with dashes or underscores in it - something I never figured out how to do in Notepad++.
However, in Emacs, I don't know how to make it possible to so easily persistently highlight (as opposed to select) just individual words, because highlight-symbol.el pays no attention to what text you have or haven't selected - it just highlights the entire name it detects where your cursor (point) is.
But, doing a search while using the code from this previous blog post - Emacs Lisp code: Easily Search for Text You've Selected - will let you easily and case-insensitively put a temporary highlight on any arbitrary currently-selected text.
I'm using GNU Emacs 24.5.1. The below requires three add-ons:
Here's all the code I had to add to my .emacs settings file:
After adding the above code and add-ons to your Emacs, it should be possible to right-click on a name to highlight that name everywhere persistently.
If you right-clicked on a dash or underscore in the name, the entire (or almost entire) name gets selected. Excluding any dollar signs at the beginning, to make it easier to select the names of PHP variables without their $ prefix. (But if you ever actually want to also select the dollar sign, a normal left double-click on a PHP variable name, or an underscore inside it, should accomplish that.)
▲ Top ▼ Bottom △ TOC ↓ Down Up ↑
Emacs Lisp code: Mouse-Clickable Search Results in Helm (with some glitches) |
Friday, December 4th, 2015 14:24:50 GMT |
Emacs Lisp |
Helm is one of the most useful add-ons I've found for the GNU Emacs operating system - uh, I mean, text editor - so far.
Helm makes it tremendously easier to find all sorts of things such as files, buffers, function names, variable names, and text within files or buffers. In many Helm modes, you can just type a few letters, and Helm will narrow down your search and instantly display updated results.
Helm also gives you a way to browse and search your "imenu", which is where php-mode puts a list of functions defined in the PHP file (or multifile!) you're currently looking at.
And you can easily go to any of those functions by selecting its name in the Helm search results and pressing Return or Ctrl-j. Or, thanks to the below code, by double-clicking or right-clicking on any item in the Helm search results with your mouse.
That seemed like the sort of thing someone probably already wrote an add-on to fix, so I searched the web, and soon found this post on Reddit:
To my delight, that code worked quite well out of the box. But, it globally overwrote my preferred mouse click settings, so, I had to figure out how to make some custom mouse click settings that would only be in effect while Helm was running.
Even though my final result wasn't very much code in the end, it still took me hours and lots of trial and error to figure out how to do it, and I wasn't sure I ever would figure it out. But somehow, I managed to cobble together the below code, which uses most of the code provided in the abovementioned Reddit post, plus some other code to create a custom minor mode which is supposed to only run when Helm is active.
Since I'm such an Emacs newbie, it would have taken quite a lot longer if I hadn't been able to stand on the shoulders of numerous giants, such as the author of the code in the abovementioned Reddit post, and all the authors of all the web pages and documentation I read that helped me figure out how to do this.
Thanks to everyone!
But, it still makes Emacs and Helm more cozy and intuitive to use.
The below code only requires the Helm add-on, and can just be copied and pasted into your .emacs settings file, probably somewhere after the place in your settings code where you loaded Helm.
While trying to debug the above, I figured out that one glitch I had actually wasn't caused by the above.
I figured out that the Purpose add-on interferes with Helm by somehow making Helm open help text in the wrong window pane - usually Helm's own window pane - which accidentally kills Helm sessions. The only solution to that I found so far was to turn off the Purpose add-on.
By the way, I actually often make small, usually unmentioned edits to my blog posts after I publish them - but this edit seems important to point out because the lack of those backslashes probably could have stopped the code from working properly.
I guess the vanishing backslash problem is another thing I need to fix in my WordsPlatz blog software. WordsPlatz has served me well with scarcely any changes since 2009, but, I actually am still interested in updating it and improving it.
By default, the Helm add-on has no mouse capabilities at all. So, I kept accidentally trying to click Helm results, resulting in nothing happening.
I still haven't figured out how to make the below code not get confused by mouse-wheel scrolling, and there could be other glitches too.
I'm using GNU Emacs 24.5.1. And I'm not sure what version of the Helm add-on - all I know is I downloaded it on Nov. 13, 2015 at 6:22:26 AM EST from GitHub.
Edit, 2:47/3:08 PM EST. Added some missing backslashes to the above code. And changed some wording.
▲ Top ▼ Bottom △ TOC ↓ Down Up ↑
Links: "Lion-Eating Poet in the Stone Den" poem |
Wednesday, December 9th, 2015 18:43:41 GMT |
Languages Chinese |
About 20 minutes ago, I stumbled across this amusing poem in Chinese, written exclusively in characters pronounced "shi" (with different tones):
And here's a blog post I found with an in-depth analysis, at a blog called A Cup of Fine Tea:
▲ Top ▼ Bottom △ TOC ↓ Down Up ↑
Links: Buffalo buffalo, etc. |
Saturday, December 12th, 2015 18:31:41 GMT |
Languages English |
Supposedly this is a grammatically correct English sentence:
Amusing, though a bit hard to believe. But hey, it was in Wikipedia, the encyclopedia that can be edited by anyone, so it must be true. :-)
Even this video makes more sense. :-)
▲ Top ▼ Bottom △ TOC ↓ Down Up ↑
Emacs Add-On: multifiles-apmod.el |
Tuesday, December 15th, 2015 21:12:56 GMT |
Emacs Lisp Add-On |
I finally managed to make most of the modifications and additions I wanted to make to Magnar Sveen's incredibly useful "multifiles.el" add-on for GNU Emacs.
Here's multifiles-apmod.el on GitHub:
(Addition, Jan. 10, 2016, 4:52 PM: Updated to Version 2.0, which partway fixes a really bad glitch I discovered today.)
Addition, 12/21/2015, 2:07 AM EST: Recently figured out and uploaded a slightly better solution to the slowness of my large PHP multifiles - perly-php-mode.el, which is simply perl-mode.el slightly modified to masquerade as php-mode. 12/24/2015, 5:24 AM EST: Released version 1.2.)
Now, my difficulty remembering which files I put whatever things into won't get in my way as much anymore. If I space out and forget something, I can just daydreamily float around until something scrolls by which reminds me. Much more effortless and relaxing than having to click from tab to tab, or try to remember what I named things so I can do searches.
And searching is easier too, with everything apparently being in the same file.
But, I think multifiles-apmod.el and GNU Emacs will already suffice to make it tremendously easier and more comfortable for me to get most any of my projects done.
Hopefully others will find it useful too. Perhaps even non-programmers might like it, such as anyone who likes Scrivener's Scrivenings mode.
I still haven't 100% perfected my Emacs setup, but, it's already mostly more comfortable for me to use than even my previous favorite editors, Notepad++ and Geany.
So, I think this might be the beginning of a golden age or renaissance for my programming hobby (or maybe almost career).
Tremendous thanks to everyone who made this possible!
It's so nice finally being able to mindlessly scroll around my entire projects (at least the smaller projects) all in one page. I don't have to do searches nor even click tabs to get around.
Someday, I'd like to have an even more bizarre code editor with a concept map layout similar to VUE, or something like Code Bubbles (which I still haven't tried yet but which seems really cool, from what I've read/seen).
So, I guess now I can finally return to working on my usual projects again.
▲ Top ▼ Bottom △ TOC ↓ Down Up ↑
How to compile GNU Common Lisp 2.6.12 in Lucid Puppy Linux 5.2.8 |
Sunday, December 27th, 2015 14:39:57 GMT |
Puppy Linux |
I had a tough time compiling GNU Common Lisp 2.6.12 from scratch in Lucid Puppy Linux 5.2.8 version 004.
But, I finally managed to do it. Here's how:
As far as I know, Lucid Puppy 5.2.8 doesn't include Tcl/Tk by default. So, if you want Tcl/Tk, you can download their source code here:
I downloaded version 8.6.4 of both Tcl and Tk.
All I had to do was unzip each source code tarball, open the source code folder, open a terminal window, and put in these three commands:
(Though I actually used the command "new2dir make install" (without quotes) because I wanted to make .pet and .sfs files.)
Above the line which says
(Huge thanks to the author of this post for the solution, because without that post I would have had absolutely no clue at all what to do.)
The above fix makes it so the compilation won't be stopped by these errors:
LD_LIBRARY_PATH=/usr/local/lib
make
Or, if you'd rather just install it without building a .pet or .sfs file, type this:
After all those steps, it should be possible to run GNU Common Lisp simply by typing "
Go to the gcl source code folder, open a terminal prompt, and type:
Then, at the GCL prompt, put in these commands:
(load "gcl-tk/demos/widget.lisp")
That last command will fail if your current working directory isn't the gcl source code folder.
./configure
make
make install
"#include <signal.h>"
(without quotes), add this line:
#include <sys/ucontext.h>
./configure --enable-tkconfig=/usr/local/lib/ --enable-tclconfig=/usr/local/lib/
new2dir make install
make install
/usr/local/bin/gcl
gcl
" (without quotes).
If you have Tcl/Tk, here's how you can try them out with GNU Common Lisp. gcl
(si::tkconnect)
▲ Top ▼ Bottom △ TOC ↓ Down Up ↑
How to compile newLISP in Lucid Puppy Linux 5.2.8 |
Sunday, December 27th, 2015 14:58:21 GMT |
Puppy Linux |
Compiling newLISP 10.6.2 from scratch in Lucid Puppy Linux 5.2.8 wasn't as tough as compiling GNU Common Lisp 2.6.12, but it was still a bit tricky.
I don't know if most typical Linuxes usually already have that or not, but, Lucid Puppy 5.2.8 version 004 doesn't, and newLISP needs it.
(Or "new2dir make install" (without quotes) if you'd like to make a .pet or .sfs file.
This is the line you need to change:
And here's what you change it to:
This command will create the symlink:
./configure
make
make install
./configure
CFLAGS = -fPIC -m32 -Wall -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DSUPPORT_UTF8 -DLINUX -DFFI -I/usr/local/lib/libffi-3.0.13/include
CFLAGS = -fPIC -m32 -Wall -Wno-strict-aliasing -Wno-long-long -c -O2 -g -DREADLINE -DSUPPORT_UTF8 -DLINUX -DFFI -I/usr/local/lib/libffi-3.2.1/include/
make
" (without quotes), and the build should succeed now.
make install
" or "new2dir make install
" (without quotes) to install newLISP.
ln -s /usr/local/lib/libffi.so.6 /usr/lib/libffi.so.6
Now, it should be possible to run newLISP just by typing "newlisp
" (without quotes).
▲ Top ▼ Bottom △ TOC ↓ Down Up ↑
Some thoughts on Lisp |
Sunday, December 27th, 2015 17:12:56 GMT |
Software |
I'm still unsure about whether all the claims about the Lisp programming language being incredibly great, and more powerful, flexible, and overall better than any other language are really true or not.
But, hopefully I'll find out, now that I have GNU Common Lisp and newLISP to play with, in addition to the GNU Emacs editor.
But with much other Emacs Lisp code, I wasn't sure at first if I found Bash or Emacs Lisp more confusing and indecipherable. Fortunately, working on multifiles-apmod.el helped me get increasingly used to Emacs Lisp, and I definitely at least like it more than Bash now.
I really appreciate that Lisp doesn't care what formatting I use. One of the reasons I'm never going to be able to tolerate the Python programming language is because of Python's strict enforcement of some quite irritating rules about formatting.
I usually am pretty consistent with my indentation style, but sometimes for boring but necessary lines of code I don't really need to read to follow what's going on, I like to indent them more deeply just as a signal that those lines are extra-boring and can be ignored. I doubt Python would let me do that.
So, I wonder if it might actually be possible to make Lisp understand the remarkably English-like Inform 7 or HyperTalk?
People shouldn't have to be technical wizards to be able to put their computers to more use.
It's 2015, and by now there ought to be a really great successor to HyperCard (which was originally released in 1987, according to Wikipedia).
Not just a sample, the entire book!!
I haven't read most of it yet, but I assume it will be a great book. I really like his nice, clear writing style, and even back when I was primarily a Windows XP user years ago, I found his articles on Lisp so intriguing that I downloaded Lisp in Windows.
Though back then, I quickly gave up, or just drifted away from it due to being so preoccupied with my PHP projects, and having no idea how to make Lisp do anything as interesting as what I could already do with PHP, or anything interesting at all.
But now that I have so much more programming experience, and switched to Linux (in 2011), and recently managed to customize my Emacs setup so nicely that it has become my favorite editor... hopefully now I have a better chance of being able to figure out Lisp.
Some Emacs Lisp code is very readable. For example, the command (beginning-of-line), which moves your cursor to the beginning of the line. :-)
For me, Lisp is a lot more readable and understandable when I use my preferred indentation style rather than the confusing styles I've seen everywhere else.
Reputedly, Lisp is so flexible that you can create your own languages in it, and redefine the Lisp language itself.
Computers are some of the most powerful, useful tools ever created, and I think it's very regrettable that the unnecessary abstruseness of so many programming languages thwarts many intelligent people from doing much of anything with their computers.
I recently found out that Paul Graham's book On Lisp is legally available for download from his website, for free:
▲ Top ▼ Bottom △ TOC ↓ Down Up ↑
Was able to compile PHP 7.0.1 in Lucid Puppy Linux 5.2.8, but couldn't compile PHP-GTK 2.0.1 to work with PHP 7.0.1 |
Tuesday, December 29th, 2015 06:50:38 GMT |
Puppy Linux |
I finally heard the news that PHP 7.0.1 has been released. So, I decided to see if I could get PHP-GTK 2.0.1 working with it. Alas, no.
I had hardly any trouble compiling PHP 7.0.1 itself. The only problem I had was this old problem, oddly deemed "Not a bug", from 2010:
./configure got stopped with these error messages at the bottom:
The problem was, I had put my PHP source code folder at a path which had a space in it:
I think I encountered this error while compiling PHP in the past, but I forgot yet again that lots of things in Linux have ridiculous incompatibilities with paths containing spaces.
The fix was simply to remove the space, changing the path to this:
"./configure" worked fine after that, and so did "make" and "make install".
If I recall correctly, PHP-GTK 2.0.1 needs the Cairo extension from PECL, and I wasn't able to compile Cairo 0.3.2, despite the fact that it worked with PHP 5.6.13.
This is as far as I got trying to compile Cairo 0.3.2:
And this is as far as I got trying to compile PHP-GTK 2.0.1:
/apmnt/truecrypt62/Hobbiton_Meadow/PHP 7/php-7.0.1/
/apmnt/truecrypt62/Hobbiton_Meadow/PHP7/php-7.0.1/
Here are some details on what stopped me from compiling PHP-GTK 2.0.1 to work with PHP 7.0.1.
So, if I ever manage to finish the PHP-GTK version of Astroblahhh Desktop, it might not be capable, at least for a while, of running on anything much newer than PHP 5.6.13. (Though it might also work with slightly later versions of PHP 5.6 which I haven't yet tried.)
▲ Top ▼ Bottom △ TOC ↓ Down Up ↑
How to compile GNU Guile 2.0.11 in Lucid Puppy Linux 5.2.8 |
Tuesday, December 29th, 2015 13:07:46 GMT |
Puppy Linux |
I apparently managed to compile GNU Guile in Lucid Puppy Linux 5.2.8 version 004 - though doing so was even more difficult than the last few things I compiled.
And I'm not sure the way I did it was a good idea, since I had to do something rather questionable to trick libunistring into acknowledging that my copy of iconv works. I hope this didn't break anything, but I have no idea. So, please be careful.
So, I guess basically I'm fishing around for Lisp-y alternatives to PHP-GTK, just in case I turn out to like Lisp or maybe even Scheme more than PHP.
But maybe in the end I'll just use lisphp with PHP and PHP-GTK. Or maybe I won't even like Lisp enough to do that? I just haven't done enough with any Lisp or Scheme yet to be able to decide.
Also, another factor to take into consideration is, how cross-platform are these Lisp and Scheme-based things? Will they make it as easy as PHP-GTK to make Astroblahhh Desktop capable of working in not only Linux, but also Windows and Macs?
And if I hadn't already had libffi 3.2.1 as a result of compiling newLISP the other day, I probably would have had to install libffi too.
So, the first step is to download the dependencies you need:
But, even upgrading libiconv still didn't fix that problem, so I had to resort to something which I'm hoping was not a bad, dangerous thing to do - I edited libunistring's configure script to make it just assume iconv is working. (I'll explain exactly what I did in a later step.)
I don't know whether or not GNU Guile can use the iconv that comes with Lucid Puppy 5.2.8, so, maybe it's best to upgrade to libiconv 1.14, as I did.
So, step 2 is to download libiconv, if you want to update iconv.
make
make install
(Or "new2dir make install" (without quotes) if you'd like to make a .pet or .sfs file.)
make
make install
(Or "new2dir make install" (without quotes) if you'd like to make a .pet or .sfs file.)
If you decided to upgrade libiconv, unzip the libiconv source code tarball, open the libiconv code folder, open a terminal window, and do these commands:
make
make install
(Or "new2dir make install" (without quotes) if you'd like to make a .pet or .sfs file.)
Then, to stop your system from trying to use the old iconv instead of the new iconv - go to the folder /usr/bin, and rename the file iconv to something else.
In the libunistring source code folder, open the file "configure" with a text editor. Go to line 17639, which says:
Change it to:
If it worked properly, it should say the following starting around line 114 of the stuff printed by ./configure:
If it does say that, then, do these commands:
make install
(Or "new2dir make install" (without quotes) if you'd like to make a .pet or .sfs file.)
./configure
(The first line somehow stops "make" from complaining about not being able to find libunistring.)
And be prepared to wait a long time for it to build. For me, it took more than a half an hour, even on the 3.4 GHz dual core desktop computer I was building it on.
At first it looks like it's going pretty fast and doing lots of stuff, but it seemed to get stuck for a very long time doing something with these files:
And so on. I was a bit worried something went wrong and it was never going to finish, but, all I had to do was wait. And wait, and wait.
(Or, if you want to build an .sfs or .pet file, put "new2dir make install" (without quotes) instead of "make install".)
I don't know if there's a GUI (graphical user interface) somewhere, but, if I find there is, I'll update this post.
To which GNU Guile will respond:
And apparently that creates a variable called $1, containing "4" (the result of adding 2+2).
To which GNU Guile will respond:
($1 equals 4, and 4 plus 1 equals 5.)
I got interested in GNU Guile because it uses the programming language Scheme, which is related to Lisp, and GNU Guile has a component called Guile-Gnome (which I haven't tried to compile yet) which apparently lets you deal with GTK stuff.
How to build GNU Guile in Lucid Puppy Linux 5.2.8 version 004:
./configure
./configure
./configure --prefix=/usr/local
am_cv_func_iconv_works=no
am_cv_func_iconv_works=yes
./configure --prefix=/usr/local
checking for iconv... yes
checking for working iconv... yes
checking how to link with libiconv... /usr/local/lib/libiconv.so -Wl,-rpath -Wl,/usr/local/lib
checking for iconv declaration...
extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for iconv.h... yes
make
LD_LIBRARY_PATH=/usr/local/lib
make
wrote `ice-9/eval.go'
GUILEC ice-9/psyntax-pp.go
wrote `ice-9/psyntax-pp.go'
GUILEC ice-9/boot-9.go
wrote `ice-9/boot-9.go'
GUILEC ice-9/vlist.go
wrote `ice-9/vlist.go'
GUILEC srfi/srfi-1.go
wrote `srfi/srfi-1.go'
GUILEC language/tree-il/peval.go
wrote `language/tree-il/peval.go'
GUILEC language/tree-il/cse.go
make install
Now, it should be possible to run GNU Guile simply by typing "guile" in a terminal.
I don't yet know how to make GNU Guile do anything particularly eye-catching, but, you can make it do some addition by typing something like this:
(+ 2 2)
$1 = 4
And you can use the automatically-created $1 variable in other commands like this:
(+ $1 1)
$2 = 5
How to compile Guile-Gnome 2.16.4 in Lucid Puppy Linux 5.2.8 |
Wednesday, December 30th, 2015 14:39:36 GMT |
Puppy Linux |
It was another difficult process, but I finally managed to build Guile-Gnome for GNU Guile in Lucid Puppy Linux 5.2.8 version 004.
Now, I can actually make GNU Guile create GTK windows! So, perhaps GNU Guile will turn out to be a good substitute for PHP-GTK.
If I can get GNU Guile to work with MySQL and SQLite databases, and also have it output web pages (so I can keep Astroblahhh Desktop's web interface), perhaps a GNU Guile-based Astroblahhh Desktop might be feasible.
I wonder if GNU Guile can work with OrientDB?
However, I'm not sure if I should write the CMS (content management system, for lack of a better term) of my dreams in any very uncommonly used language or platform. PHP is available from most web hosts. Even figuring out how to make the Java-based OrientDB work with my websites seems like it might be difficult, though maybe less difficult than figuring out how to get some form of Lisp or Scheme like GNU Guile working on a web server.
Once again, I had to use some trickery (or guile! Haha, I made a pun) to get past some hopefully mistaken errors. I'll explain more about that below.
I used version 2.16.4.
Here's most of what I needed:
Those are the three easiest things to get. Downloading Guile-Cairo will be explained in step 3.
Fortunately, an at least partway functional copy of an old version of Git exists in the Lucid Puppy Linux DevX SFS file of development tools. The DevX, by the way, is what you need to use to compile software in Lucid Puppy Linux 5.2.8.
My page of Some Puppy Linux Basics explains more about DevX files, and if you need the DevX for Lucid Puppy 5.2.8, it's available at this link:
(If you're using a different version of Puppy than Lucid Puppy 5.2.8, that DevX probably won't work, so you should instead download the DevX released for your Puppy.
Also, if you're not using Lucid Puppy 5.2.8, please bear in mind that the instructions in this blog post might not all apply or work for you, since different Puppy Linux distros, and probably even different versions of the same Puppy distro, can differ quite substantially from each other.)
And here's how to load SFS files.
If it worked, you'll see some text like this:
And there will now be a "guile-cairo" folder in the folder you opened the terminal window from.
make
make install
(Or "new2dir make install" (without quotes) if you'd like to make a .pet or .sfs file.)
make
make install
(Or "new2dir make install" (without quotes) if you'd like to make a .pet or .sfs file.)
export pixman_LIBS="-L/usr/local/lib/ -lpixman-1"
./configure --enable-gobject=yes
make
make install
(Or "new2dir make install" (without quotes) if you'd like to make a .pet or .sfs file.)
If you want to make a .pet or .sfs file, rename the Guile-Cairo folder to something like "guile_cairo-1.10". (Though I'm not sure that's the actual version number. You can use any version number - this rename is just to make it so new2dir won't complain later on about not being in a folder with a version number.)
Next, open the Guile-Cairo folder, open a terminal window, and put in these commands:
make
make install
(Or "new2dir make install" (without quotes) if you'd like to make a .pet or .sfs file.)
If all went well, somewhere in the messages printed by ./configure should be this text:
Go to the folder /usr/local/include/cairo/ and open the file cairo-gobject.h in a text editor.
Delete this line toward the top (line 42 in my cairo-gobject.h):
And delete these three lines near the bottom (starting at line 188 in my cairo-gobject.h):
Then, save the cairo-gobject.h file.
And also, I got an encouraging-looking response when I tried a command I found on this page:
The response was:
Hopefully everything will go smoothly now that Guile-Gnome has no way not to acknowledge that Cairo really does have GObject support.
After doing that, it should be possible to run the example scripts from the Guile-Gtk Overview page, which will create a GTK window containing a button which says "Hello, World!"
I don't know yet how to make GNU Guile automatically find the Guile-Gnome modules.
But, I assume that similar to GNU Emacs, there's probably some sort of config file somewhere which you can put commands in like "(use-modules (gnome-2))" so those commands will be run automatically every time you start GNU Guile.
But, back to the topic of how to build Guile-Gnome in Lucid Puppy Linux 5.2.8 version 004.
git clone git://git.savannah.nongnu.org/guile-cairo.git
# git clone git://git.savannah.nongnu.org/guile-cairo.git
Initialized empty Git repository in /root/guile-cairo/.git/
remote: Counting objects: 830, done.
remote: Compressing objects: 100% (280/280), done.
remote: Total 830 (delta 522), reused 830 (delta 522)
Receiving objects: 100% (830/830), 594.72 KiB | 666 KiB/s, done.
Resolving deltas: 100% (522/522), done.
./configure
./configure
export pixman_CFLAGS="-I/usr/local/include/pixman-1"
./configure --prefix=/usr/local
./configure --prefix=/usr/local/
All available wrappers will be built:
atk cairo corba gconf glib gnome-vfs gtk libglade libgnome libgnomecanvas libgnomeui pango
#if CAIRO_HAS_GOBJECT_FUNCTIONS
#else /* CAIRO_HAS_GOBJECT_FUNCTIONS */
# error Cairo was not compiled with support for GObject
#endif /* CAIRO_HAS_GOBJECT_FUNCTIONS */
I believe that due to the way I compiled Cairo (described above), Cairo really does have GObject support.
pkg-config --libs cairo-gobject
-pthread -L/usr/local/lib -lcairo-gobject -lcairo -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0
make
(use-modules (gnome-2))