# ChangeLog for app-editors/qemacs
-# Copyright 2000-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-editors/qemacs/ChangeLog,v 1.24 2006/12/04 11:26:29 opfer Exp $
+# Copyright 2000-2007 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-editors/qemacs/ChangeLog,v 1.25 2007/02/26 14:19:42 opfer Exp $
+
+*qemacs-0.3.2_pre20070226 (26 Feb 2007)
+
+ 26 Feb 2007; Christian Faulhammer <opfer@gentoo.org>
+ +files/qemacs-0.3.2_pre20070226-Makefile-gentoo.patch,
+ +files/qemacs-0.3.2_pre20070226-make_backup.patch,
+ +files/qemacs-0.3.2_pre20070226-qemacs-datadir.patch,
+ +files/qemacs-0.3.2_pre20070226-tty_utf8.patch,
+ +qemacs-0.3.2_pre20070226.ebuild:
+ version bump: CVS snapshot from upstream to fix bug 144081, reported by DMoL
+ <master_temp@tut.by>
04 Dec 2006; Christian Faulhammer <opfer@gentoo.org>
-files/qemacs-Makefile-gentoo.patch, -files/qemacs-ppc-segfault.patch,
MD5 e7a9a6e25a384848c2b87891e7e7c973 files/qemacs-0.3.1-tty_utf8.patch 952
RMD160 52e1f46ce58112539d188f5c5d8f083cf1f63464 files/qemacs-0.3.1-tty_utf8.patch 952
SHA256 e5819c89327f512b3dfee2f1899e4fa960b67d70299e5f9e5022dde4322a9517 files/qemacs-0.3.1-tty_utf8.patch 952
+AUX qemacs-0.3.2_pre20070226-Makefile-gentoo.patch 1371 RMD160 84ec85b6466f175d60ce6527cd8a4e570a32bd6e SHA1 e3f900404aac4a36d2a667b9ec7e144ae9b6bd4d SHA256 de4f3b478c0437c8bb98397b69d5758196d29bb5c426cc6ca230d049860fd919
+MD5 1c78ea9b6992b7e6b2491a2c26d42fb3 files/qemacs-0.3.2_pre20070226-Makefile-gentoo.patch 1371
+RMD160 84ec85b6466f175d60ce6527cd8a4e570a32bd6e files/qemacs-0.3.2_pre20070226-Makefile-gentoo.patch 1371
+SHA256 de4f3b478c0437c8bb98397b69d5758196d29bb5c426cc6ca230d049860fd919 files/qemacs-0.3.2_pre20070226-Makefile-gentoo.patch 1371
+AUX qemacs-0.3.2_pre20070226-make_backup.patch 2365 RMD160 a03b17a2b937a4d3ade3f82f060b4de9e8e19c18 SHA1 8becc5d38eb2be8a2cc232cbad6fb39334e41791 SHA256 4672e17f605f5440460b09546aa640a138db998aebb5b4c943b808ab40b86520
+MD5 5d65a5fc1b092c7dc095e79cade445ff files/qemacs-0.3.2_pre20070226-make_backup.patch 2365
+RMD160 a03b17a2b937a4d3ade3f82f060b4de9e8e19c18 files/qemacs-0.3.2_pre20070226-make_backup.patch 2365
+SHA256 4672e17f605f5440460b09546aa640a138db998aebb5b4c943b808ab40b86520 files/qemacs-0.3.2_pre20070226-make_backup.patch 2365
+AUX qemacs-0.3.2_pre20070226-qemacs-datadir.patch 4377 RMD160 d6528d7b09f611ee28fe764c9d4b6c8ffa11da0d SHA1 c43fb95bc7b28ba36ef9d6c260bfa2ed170c5b0e SHA256 ff89776e2fff947251d64f435ec7f99b91bd3124acf1151443aee2d51ab1489c
+MD5 ac0c48bac65d0671643d31004c7a1b27 files/qemacs-0.3.2_pre20070226-qemacs-datadir.patch 4377
+RMD160 d6528d7b09f611ee28fe764c9d4b6c8ffa11da0d files/qemacs-0.3.2_pre20070226-qemacs-datadir.patch 4377
+SHA256 ff89776e2fff947251d64f435ec7f99b91bd3124acf1151443aee2d51ab1489c files/qemacs-0.3.2_pre20070226-qemacs-datadir.patch 4377
+AUX qemacs-0.3.2_pre20070226-tty_utf8.patch 1298 RMD160 0082bc3ca8514c9ba9ce8fb591628eb940a145a6 SHA1 96a1d832c4fdaa02281a7222fe9c34cd2b565db7 SHA256 84383cf13c294c29333547b7e7d4cd18cb30303687c3d8cc6024d47a24c9e6aa
+MD5 0f609e0a57af7677b5d8c1af8b7f180f files/qemacs-0.3.2_pre20070226-tty_utf8.patch 1298
+RMD160 0082bc3ca8514c9ba9ce8fb591628eb940a145a6 files/qemacs-0.3.2_pre20070226-tty_utf8.patch 1298
+SHA256 84383cf13c294c29333547b7e7d4cd18cb30303687c3d8cc6024d47a24c9e6aa files/qemacs-0.3.2_pre20070226-tty_utf8.patch 1298
DIST qemacs-0.3.1.tar.gz 809124 RMD160 05eaddf872cbf6c187a63c80ed1eb02a23a1a13d SHA1 70671e905f65c8402af6a9938a12db29c8954710 SHA256 a3db57e09729d8c83be5ff9ab028ece173d8f5f10aaf61ca41f88aecb64996c7
+DIST qemacs-0.3.2_pre20070226.tar.bz2 806174 RMD160 024982b3c62093c6377be2836ee0d5d7c12cd55b SHA1 e909fd36b1eda59f21a7d0cd63b4f0a535b0c0a1 SHA256 0611c5fee1f7c6538fa1c5b4108f1968f5f05eeb9165b84c72d4c6d7dd8556af
EBUILD qemacs-0.3.1-r3.ebuild 3599 RMD160 51333ff1580fa4902a1b2ef92f4efcb2dc49d001 SHA1 a321c569baf74b83df359e4779b3546d642dacc5 SHA256 17c5cac6ed0fd48c81f21f1c371a11a6b28ea7b7ae74a777ab4ea44817dbecc9
MD5 db796b074e069e4880cd4c6985d335c2 qemacs-0.3.1-r3.ebuild 3599
RMD160 51333ff1580fa4902a1b2ef92f4efcb2dc49d001 qemacs-0.3.1-r3.ebuild 3599
SHA256 17c5cac6ed0fd48c81f21f1c371a11a6b28ea7b7ae74a777ab4ea44817dbecc9 qemacs-0.3.1-r3.ebuild 3599
-MISC ChangeLog 3944 RMD160 28878a4b9f01aca713026a71b4ecdd642a9e4c27 SHA1 cb5f6c64c4a440f71966b0d61c0d43a823ae3f35 SHA256 d3df25718dbaaaa870986e4b16190df3a713eae4d1df7d29a86bdcf39e16cb8e
-MD5 b54239154b6934fadbfd9bc373a2e66d ChangeLog 3944
-RMD160 28878a4b9f01aca713026a71b4ecdd642a9e4c27 ChangeLog 3944
-SHA256 d3df25718dbaaaa870986e4b16190df3a713eae4d1df7d29a86bdcf39e16cb8e ChangeLog 3944
+EBUILD qemacs-0.3.2_pre20070226.ebuild 3235 RMD160 e42c069d64eca4440380cf3e969a1020396741eb SHA1 b911410e3186ea73b5a3065742060c8b89ec6d6a SHA256 43e84bf09be0b290cd8e0343ed60825a5fdcf261f35eb87aeffd39e29ad959a7
+MD5 79dbdac8059ee96ac87633313da3aa07 qemacs-0.3.2_pre20070226.ebuild 3235
+RMD160 e42c069d64eca4440380cf3e969a1020396741eb qemacs-0.3.2_pre20070226.ebuild 3235
+SHA256 43e84bf09be0b290cd8e0343ed60825a5fdcf261f35eb87aeffd39e29ad959a7 qemacs-0.3.2_pre20070226.ebuild 3235
+MISC ChangeLog 4395 RMD160 b63db3cbea69205d0a84918a10972cc4b15eb999 SHA1 04c79b7e05496e67cb3b8b3a8180974f0b77fa96 SHA256 417fd67f4397b0caf8bdd562343e36be69fa9465ed6be5882e426b8a11554c63
+MD5 3aabf46b830eec06668426c02443da86 ChangeLog 4395
+RMD160 b63db3cbea69205d0a84918a10972cc4b15eb999 ChangeLog 4395
+SHA256 417fd67f4397b0caf8bdd562343e36be69fa9465ed6be5882e426b8a11554c63 ChangeLog 4395
MISC metadata.xml 158 RMD160 415d172437ca754d24fc5ab186ba8e77934d96e4 SHA1 61f6eff9729cd87a725c2a70c81aca4270a17fc4 SHA256 1393bdef3a74343fdb40a112c7096a1af16f67e7a43413250de28dfe73810eab
MD5 fcd33d07e4ee719b01157946734f4fe8 metadata.xml 158
RMD160 415d172437ca754d24fc5ab186ba8e77934d96e4 metadata.xml 158
MD5 34bcf83006d626e2774e1d2f5ea52450 files/digest-qemacs-0.3.1-r3 238
RMD160 a5537bf978079760d433788b94f476c47072cf51 files/digest-qemacs-0.3.1-r3 238
SHA256 bdd7dbafcad5ff3037b835d5959c2397b0b649f30dad5e0797024185dc836f46 files/digest-qemacs-0.3.1-r3 238
+MD5 3f30fa4c00a2234c228d0e8c48f3a586 files/digest-qemacs-0.3.2_pre20070226 277
+RMD160 eb92b8a221a441c82d896649bdf3e80ad575364f files/digest-qemacs-0.3.2_pre20070226 277
+SHA256 7c91ed001b105cabc8416de6093e0c03758b7e0b9fc3c601a22ddd7927162475 files/digest-qemacs-0.3.2_pre20070226 277
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.5 (GNU/Linux)
+Version: GnuPG v1.4.6 (GNU/Linux)
-iD8DBQFFdAX9NQqtfCuFneMRAlG0AKCUD21VUxRXNyQO/9kvmLhMMJPLrQCfci+o
-dZ8xLycLSdKijDG/CVEwdEw=
-=IwEt
+iD8DBQFF4uxRNQqtfCuFneMRAgk5AJ9uX5iZqXrGR9qsgQ+mAE9X2v2UtACfRHSK
+O0tzyW9vdIkYvLstkKzotAs=
+=RZMn
-----END PGP SIGNATURE-----
--- /dev/null
+MD5 f03330e8aaa80f9efb9214c1ce61c36e qemacs-0.3.2_pre20070226.tar.bz2 806174
+RMD160 024982b3c62093c6377be2836ee0d5d7c12cd55b qemacs-0.3.2_pre20070226.tar.bz2 806174
+SHA256 0611c5fee1f7c6538fa1c5b4108f1968f5f05eeb9165b84c72d4c6d7dd8556af qemacs-0.3.2_pre20070226.tar.bz2 806174
--- /dev/null
+diff -u ../qemacs/Makefile ./Makefile
+--- ../qemacs/Makefile 2007-02-06 18:41:16.000000000 +0100
++++ ./Makefile 2007-02-26 14:03:24.000000000 +0100
+@@ -38,15 +38,6 @@
+ LDFLAGS+= -p
+ endif
+
+-ifdef TARGET_ARCH_X86
+-#CFLAGS+=-fomit-frame-pointer
+-ifeq ($(GCC_MAJOR),2)
+-CFLAGS+=-m386 -malign-functions=0
+-else
+-CFLAGS+=-march=i386 -falign-functions=0
+-endif
+-endif
+-
+ DEFINES=-DHAVE_QE_CONFIG_H
+
+ ########################################################
+@@ -211,15 +202,17 @@
+ rm -f config.h config.mak
+
+ install: $(TARGETS) qe.1 kmaps ligatures
+- install -m 755 qe$(EXE) $(prefix)/bin/qemacs
+- ln -sf qemacs $(prefix)/bin/qe$(EXE)
++ mkdir -p $(DESTDIR)$(prefix)/bin
++ install -m 755 qe $(DESTDIR)$(prefix)/bin/qemacs
++ install -m 755 libqhtml/csstoqe $(DESTDIR)$(prefix)/bin/csstoqe
+ ifdef CONFIG_FFMPEG
+- ln -sf qemacs $(prefix)/bin/ffplay
++ ln -sf qemacs $(DESTDIR)$(prefix)/bin/qemacs-ffplay
+ endif
+- mkdir -p $(prefix)/share/qe
+- install kmaps ligatures $(prefix)/share/qe
+- install qe.1 $(prefix)/man/man1
++ mkdir -p $(DESTDIR)$(prefix)/share/qemacs
++ install -m644 kmaps ligatures $(DESTDIR)$(prefix)/share/qe
++ mkdir -p $(DESTDIR)$(prefix)/share/man/man1
++ install -m644 qe.1 $(DESTDIR)$(prefix)/share/man/man1/qemacs.1
+ ifdef CONFIG_HTML
+- install -m 755 -s html2png$(EXE) $(prefix)/bin
++ install -m 755 -s html2png $(DESTDIR)$(prefix)/bin
+ endif
+
+ TAGS: force
\ No newline at end of file
--- /dev/null
+diff -u ../qemacs/buffer.c ./buffer.c
+--- ../qemacs/buffer.c 2006-12-31 20:34:01.000000000 +0100
++++ ./buffer.c 2007-02-26 15:00:50.000000000 +0100
+@@ -1528,10 +1528,12 @@
+ if (stat(filename, &st) == 0)
+ mode = st.st_mode & 0777;
+
+- /* backup old file if present */
+- strcpy(buf1, filename);
+- strcat(buf1, "~");
+- rename(filename, buf1);
++ /* backup old file if present and make-backup-files is on */
++ if(mbf == 1) {
++ strcpy(buf1, filename);
++ strcat(buf1, "~");
++ rename(filename, buf1);
++ }
+
+ ret = b->data_type->buffer_save(b, filename);
+ if (ret < 0)
+Gemeinsame Unterverzeichnisse: ../qemacs/fonts und ./fonts.
+Gemeinsame Unterverzeichnisse: ../qemacs/libqhtml und ./libqhtml.
+Nur in ../qemacs: Makefile.orig.
+Gemeinsame Unterverzeichnisse: ../qemacs/plugin-example und ./plugin-example.
+diff -u ../qemacs/qe.c ./qe.c
+--- ../qemacs/qe.c 2007-02-26 14:58:27.000000000 +0100
++++ ./qe.c 2007-02-26 15:02:13.000000000 +0100
+@@ -67,6 +67,7 @@
+ int trace_buffer_state;
+ int no_init_file;
+ const char *user_option;
++mbf = 1;
+
+ /* mode handling */
+
+@@ -4816,6 +4817,14 @@
+ do_refresh(qs->first_window);
+ }
+
++static void make_backup_files(EditState *s) {
++ if(mbf == 1) {
++ mbf = 0;
++ } else {
++ mbf = 1;
++ }
++}
++
+ /* compute default path for find/save buffer */
+ static void get_default_path(EditState *s, char *buf, int buf_size)
+ {
+diff -u ../qemacs/qeconfig.h ./qeconfig.h
+--- ../qemacs/qeconfig.h 2007-01-12 16:06:16.000000000 +0100
++++ ./qeconfig.h 2007-02-26 15:03:30.000000000 +0100
+@@ -86,6 +86,7 @@
+ do_changecase_region, 0, "*v")
+ CMDV( KEY_CTRLX(KEY_CTRL('u')), KEY_NONE, "upcase-region",
+ do_changecase_region, 1, "*v")
++ CMD0( KEY_NONE, KEY_NONE, "make-backup-files", make_backup_files)
+
+ /* keyboard macros */
+ CMD0( KEY_CTRLX('('), KEY_NONE, "start-kbd-macro", do_start_macro)
+diff -u ../qemacs/qe.h ./qe.h
+--- ../qemacs/qe.h 2007-01-12 16:06:16.000000000 +0100
++++ ./qe.h 2007-02-26 15:02:41.000000000 +0100
+@@ -1422,6 +1422,8 @@
+ void fill_border(EditState *s, int x, int y, int w, int h, int color);
+ int qe_bitmap_format_to_pix_fmt(int format);
+
++int mbf;
++
+ /* shell.c */
+ EditBuffer *new_shell_buffer(const char *name, const char *path,
+ const char **argv, int is_shell);
+Gemeinsame Unterverzeichnisse: ../qemacs/tests und ./tests.
--- /dev/null
+diff -u ../qemacs/config.eg ./config.eg
+--- ../qemacs/config.eg 2006-12-09 20:02:07.000000000 +0100
++++ ./config.eg 2007-02-26 14:55:51.000000000 +0100
+@@ -1,6 +1,6 @@
+ // Sample qemacs config file
+ //
+-// copy it in ~/.qe/config
++// copy it in ~/.qemacs/config
+ //
+ // You can call any Qemacs command with a C like syntax.
+ //
+Gemeinsame Unterverzeichnisse: ../qemacs/fonts und ./fonts.
+Gemeinsame Unterverzeichnisse: ../qemacs/libqhtml und ./libqhtml.
+diff -u ../qemacs/Makefile ./Makefile
+--- ../qemacs/Makefile 2007-02-26 14:57:04.000000000 +0100
++++ ./Makefile 2007-02-26 14:56:34.000000000 +0100
+@@ -209,7 +209,7 @@
+ ln -sf qemacs $(DESTDIR)$(prefix)/bin/qemacs-ffplay
+ endif
+ mkdir -p $(DESTDIR)$(prefix)/share/qemacs
+- install -m644 kmaps ligatures $(DESTDIR)$(prefix)/share/qe
++ install -m644 kmaps ligatures $(DESTDIR)$(prefix)/share/qemacs
+ mkdir -p $(DESTDIR)$(prefix)/share/man/man1
+ install -m644 qe.1 $(DESTDIR)$(prefix)/share/man/man1/qemacs.1
+ ifdef CONFIG_HTML
+Nur in ../qemacs: Makefile.orig.
+Gemeinsame Unterverzeichnisse: ../qemacs/plugin-example und ./plugin-example.
+diff -u ../qemacs/qe.c ./qe.c
+--- ../qemacs/qe.c 2007-02-06 18:41:16.000000000 +0100
++++ ./qe.c 2007-02-26 14:55:51.000000000 +0100
+@@ -6920,10 +6920,10 @@
+ user_option = user;
+ /* compute resources path */
+ pstrcpy(qs->res_path, sizeof(qs->res_path),
+- CONFIG_QE_PREFIX "/share/qe:" CONFIG_QE_PREFIX "/lib/qe:"
+- "/usr/share/qe:/usr/lib/qe");
++ CONFIG_QE_PREFIX "/share/qemacs:" CONFIG_QE_PREFIX "/lib/qemacs:"
++ "/usr/share/qemacs:/usr/lib/qemacs");
+ if (user) {
+- /* use ~USER/.qe instead of ~/.qe */
++ /* use ~USER/.qemacs instead of ~/.qemacs */
+ /* CG: should get user homedir */
+ snprintf(path, sizeof(path), "/home/%s", user);
+ home_path = path;
+@@ -6933,7 +6933,7 @@
+ if (home_path) {
+ pstrcat(qs->res_path, sizeof(qs->res_path), ":");
+ pstrcat(qs->res_path, sizeof(qs->res_path), home_path);
+- pstrcat(qs->res_path, sizeof(qs->res_path), "/.qe");
++ pstrcat(qs->res_path, sizeof(qs->res_path), "/.qemacs");
+ }
+ }
+
+@@ -6942,7 +6942,7 @@
+ {func_noarg: show_usage}},
+ { "no-init-file", "q", NULL, CMD_OPT_BOOL, "do not load config files",
+ {int_ptr: &no_init_file}},
+- { "user", "u", "USER", CMD_OPT_ARG, "load ~USER/.qe/config instead of your own",
++ { "user", "u", "USER", CMD_OPT_ARG, "load ~USER/.qemacs/config instead of your own",
+ {func_arg: set_user_option}},
+ { "version", "V", NULL, 0, "display version information and exit",
+ {func_noarg: show_version}},
+diff -u ../qemacs/qe-doc.html ./qe-doc.html
+--- ../qemacs/qe-doc.html 2006-12-09 19:37:12.000000000 +0100
++++ ./qe-doc.html 2007-02-26 14:55:51.000000000 +0100
+@@ -519,7 +519,7 @@
+ <h2 class="section"> 4.1 Resource path </h2>
+
+ <p>All resources and configuration files are looked in the following paths:
+-<tt>`/usr/share/qe:/usr/local/share/qe:/usr/lib/qe:/usr/local/lib/qe:~/.qe'</tt>
++<tt>`/usr/share/qemacs:/usr/local/share/qemacs:/usr/lib/qemacs:/usr/local/lib/qemacs:~/.qemacs'</tt>
+ </p>
+ <hr size="6">
+ <a name="SEC16"></a>
+@@ -541,7 +541,7 @@
+ </tr></table>
+ <h2 class="section"> 4.2 Configuration file </h2>
+
+-<p>QEmacs tries to load a configuration file in <tt>`~/.qe/config'</tt>. Each
++<p>QEmacs tries to load a configuration file in <tt>`~/.qemacs/config'</tt>. Each
+ line of the configuration file is a QEmacs command with a C like syntax
+ ('-' in command name can be replaced by '_').
+ </p>
+diff -u ../qemacs/qe-doc.texi ./qe-doc.texi
+--- ../qemacs/qe-doc.texi 2006-12-09 19:37:12.000000000 +0100
++++ ./qe-doc.texi 2007-02-26 14:55:51.000000000 +0100
+@@ -237,11 +237,11 @@
+ @section Resource path
+
+ All resources and configuration files are looked in the following paths:
+-@file{/usr/share/qe:/usr/local/share/qe:/usr/lib/qe:/usr/local/lib/qe:~/.qe}
++@file{/usr/share/qemacs:/usr/local/share/qemacs:/usr/lib/qemacs:/usr/local/lib/qemacs:~/.qemacs}
+
+ @section Configuration file
+
+-QEmacs tries to load a configuration file in @file{~/.qe/config}. Each
++QEmacs tries to load a configuration file in @file{~/.qemacs/config}. Each
+ line of the configuration file is a QEmacs command with a C like syntax
+ ('-' in command name can be replaced by '_').
+
+Gemeinsame Unterverzeichnisse: ../qemacs/tests und ./tests.
--- /dev/null
+Gemeinsame Unterverzeichnisse: ../qemacs/fonts und ./fonts.
+Gemeinsame Unterverzeichnisse: ../qemacs/libqhtml und ./libqhtml.
+Gemeinsame Unterverzeichnisse: ../qemacs/plugin-example und ./plugin-example.
+Gemeinsame Unterverzeichnisse: ../qemacs/tests und ./tests.
+diff -u ../qemacs/tty.c ./tty.c
+--- ../qemacs/tty.c 2007-02-08 00:27:33.000000000 +0100
++++ ./tty.c 2007-02-26 15:07:41.000000000 +0100
+@@ -78,7 +78,6 @@
+ /* input handling */
+ enum InputState input_state;
+ int input_param;
+- int utf8_state;
+ int utf8_index;
+ unsigned char buf[10];
+ char *term_name;
+@@ -374,15 +373,19 @@
+
+ /* charset handling */
+ if (s->charset == &charset_utf8) {
+- if (ts->utf8_state == 0) {
+- const char *p;
+- p = (const char *)ts->buf;
+- ch = utf8_decode(&p);
+- } else {
+- ts->utf8_state = utf8_length[ts->buf[0]] - 1;
+- ts->utf8_index = 0;
+- return;
+- }
++ /* Make sure utf8 input works correctly 20040314 <damm@opensource.se> */
++ ts->utf8_index++;
++
++ if (utf8_length[ts->buf[0]] == ts->utf8_index) {;
++ const char *p;
++ p = (const char *)ts->buf;
++ ch = utf8_decode(&p);
++ ts->utf8_index = 0;
++ }
++ else {
++ return;
++ }
++
+ } else {
+ ch = ts->buf[0];
+ }
--- /dev/null
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-editors/qemacs/qemacs-0.3.2_pre20070226.ebuild,v 1.1 2007/02/26 14:19:42 opfer Exp $
+
+inherit eutils versionator flag-o-matic
+
+DESCRIPTION="Quick Emacs) is a very small but powerful UNIX editor."
+HOMEPAGE="http://fabrice.bellard.free.fr/qemacs/"
+SRC_URI="http://fabrice.bellard.free.fr/qemacs/${P}.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86"
+IUSE="X png unicode xv"
+
+# For those so inclined, the libXv dep can probably
+# be made conditional on the xv USE flag somehow.
+RDEPEND="X? ( || ( x11-libs/libXv virtual/x11 ) )
+ png? ( =media-libs/libpng-1.2* )"
+DEPEND="${RDEPEND}
+ X? ( || ( ( x11-libs/libXft
+ x11-proto/xextproto )
+ virtual/x11 ) )"
+RESTRICT="strip"
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ # Add a patch to install to DESTDIR, make directories during install
+ # and install the binary/man page using the qemacs name to avoid clash
+ # with app-editors/qe.
+ # Also removes forced march setting and align-functions on x86, as
+ # they would override user's CFLAGS..
+ epatch "${FILESDIR}/${P}-Makefile-gentoo.patch"
+ # Change the references to the qe binary to reflect the installed name
+ # qemacs.
+ epatch "${FILESDIR}/${PN}-0.3.1-manpage-ref-fix.patch"
+ # Set the datadir to qemacs, upstream installs in to qe which conflicts
+ # with files installed in app-editors/qe. Currently no breakage
+ # occurs, but it makes sense to change before that happens.
+ epatch "${FILESDIR}/${P}-qemacs-datadir.patch"
+ epatch "${FILESDIR}/${P}-make_backup.patch"
+
+ useq unicode && epatch "${FILESDIR}/${P}-tty_utf8.patch"
+ # Change the manpage to reference a /real/ file instead of just an
+ # approximation. Purely cosmetic!
+ sed -i "s,^/usr/share/doc/qemacs,&-${PVR}," qe.1
+}
+
+src_compile() {
+ # when using any other CFLAGS than -O0, qemacs will segfault on startup, see bug #92011
+ replace-flags -O? -O0
+ econf $(use_enable X x11) \
+ $(use_enable png) \
+ $(use_enable xv) \
+ || die "econf failed"
+ emake -j1 || die
+}
+
+src_test() {
+ # There are some files purporting to be tests in the tarball, however
+ # there is no defined way to use them and I imagine even if there was
+ # it would require user interaction.
+ # The toplevel Makefile calls the test target from the non-existant
+ # tests/Makefile, so just noop to stop errors if maketest is set.
+ :
+}
+
+src_install() {
+ make install DESTDIR="${D}" || die
+ dodoc Changelog README TODO config.eg
+ dohtml *.html
+
+ insinto /usr/share/doc/${PF}/plugin-example/
+ doins plugin-example/*
+
+ # Install headers so users can build their own plugins.
+ insinto /usr/include/qemacs
+ doins cfb.h config.h cutils.h display.h fbfrender.h libfbf.h qe.h \
+ qeconfig.h qestyles.h qfribidi.h
+ cd libqhtml
+ insinto /usr/include/qemacs/libqhtml
+ doins {css{,id},htmlent}.h
+}
+
+pkg_postinst() {
+ einfo "This version of qemacs is not entirely backwards compatible with"
+ einfo "versions prior to 0.3.1-r1."
+ echo
+ einfo "The name of the binary has been changed to qemacs, to fix a name"
+ einfo "clash with app-editors/qe."
+ echo
+ einfo "The location of user config files have been changed to ~/.qemacs, to"
+ einfo "remove some ambiguity."
+}