Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial import

  • Loading branch information...
commit 450dc858b4d59d83a29d3c3d85685b4d82ad529f 0 parents
@ereslibre authored
Showing with 21,327 additions and 0 deletions.
  1. +1 −0  .Xdefaults
  2. +9 −0 .bash_profile
  3. +7 −0 .bashrc
  4. +86 −0 .emacs
  5. +31 −0 .emacs.d/color-theme-6.6.0/AUTHORS
  6. +71 −0 .emacs.d/color-theme-6.6.0/BUGS
  7. +342 −0 .emacs.d/color-theme-6.6.0/COPYING
  8. +121 −0 .emacs.d/color-theme-6.6.0/ChangeLog
  9. +26 −0 .emacs.d/color-theme-6.6.0/HACKING
  10. +141 −0 .emacs.d/color-theme-6.6.0/Makefile
  11. +39 −0 .emacs.d/color-theme-6.6.0/Makefile.defs
  12. +86 −0 .emacs.d/color-theme-6.6.0/README
  13. 0  .emacs.d/color-theme-6.6.0/build-stamp
  14. +132 −0 .emacs.d/color-theme-6.6.0/color-theme-autoloads.el
  15. BIN  .emacs.d/color-theme-6.6.0/color-theme-autoloads.elc
  16. +15 −0 .emacs.d/color-theme-6.6.0/color-theme-autoloads.in
  17. +1,668 −0 .emacs.d/color-theme-6.6.0/color-theme.el
  18. 0  .emacs.d/color-theme-6.6.0/configure-stamp
  19. +22 −0 .emacs.d/color-theme-6.6.0/themes/color-theme-example.el
  20. +13,539 −0 .emacs.d/color-theme-6.6.0/themes/color-theme-library.el
  21. +212 −0 .emacs.d/dtrt-indent-diag.el
  22. +962 −0 .emacs.d/dtrt-indent.el
  23. +405 −0 .emacs.d/highlight-current-line.el
  24. +194 −0 .emacs.d/maxframe.el
  25. +106 −0 .emacs.d/pastebin.el
  26. +1,179 −0 .emacs.d/zenburn.el
  27. +1,874 −0 .git-completion.bash
  28. +16 −0 .gitconfig
  29. +7 −0 .global-gitignore
  30. +14 −0 .hgrc
  31. +2 −0  .signature
  32. +1 −0  .ssh/id_dsa.pub
  33. +1 −0  .ssh/id_rsa.pub
  34. +4 −0 .xmodmap
  35. +14 −0 .xsession
1  .Xdefaults
@@ -0,0 +1 @@
+Emacs.font: DejaVu Sans Mono-7
9 .bash_profile
@@ -0,0 +1,9 @@
+. $HOME/.bashrc
+
+EDITOR='nano'
+PATH=/usr/local/bin:$PATH
+LC_ALL="es_ES.UTF-8"
+INPUTRC=/etc/inputrc
+HG=/usr/bin/hg
+
+export EDITOR PATH LC_ALL INPUTRC
7 .bashrc
@@ -0,0 +1,7 @@
+source /home/kdevel/.git-completion.bash
+
+alias ls='ls --color=auto'
+PS1='\[\033[01;32m\]\u\[\033[01;34m\] \w\[\033[31m\]$(__git_ps1 " (%s)")\[\033[01;34m\]$\[\033[00m\] '
+
+alias actualiza='yaourt -Syu --aur'
+alias emacs='emacs -nw'
86 .emacs
@@ -0,0 +1,86 @@
+; REQUIREMENTS
+; * maxframe
+; * color-theme
+; * zenburn
+; * yasnippet
+; * xcscope
+; * pastebin
+
+; add load path
+(add-to-list 'load-path "~/.emacs.d")
+(add-to-list 'load-path "~/.emacs.d/erc-5.3")
+(add-to-list 'load-path "~/.emacs.d/color-theme-6.6.0")
+; miscellaneous
+(column-number-mode 1)
+(require 'highlight-current-line)
+(highlight-current-line-on t) ; highlight current line
+; auto detect file coding style
+(require 'dtrt-indent)
+(dtrt-indent-mode 1)
+; enable gui wellness
+(tool-bar-mode nil)
+(menu-bar-mode nil)
+(scroll-bar-mode nil)
+; maximize the window when loading
+;(require 'maxframe)
+;(add-hook 'window-setup-hook 'maximize-frame t)
+; set default font family and size
+;; (custom-set-faces
+;; '(default ((t (:height 68 :family "Monaco")))))
+(custom-set-faces
+ '(default ((t (:height 120 :family "Monaco")))))
+; set some personal data
+(setq user-mail-address "ereslibre@ereslibre.es")
+(setq user-full-name "Rafael Fernández López")
+; make it pretty colors
+(require 'color-theme)
+(color-theme-initialize)
+(color-theme-emacs-nw)
+; (color-theme-xemacs)
+; (color-theme-jsc-light)
+; (require 'zenburn)
+; (color-theme-zenburn)
+(custom-set-variables
+ '(blink-cursor-mode nil)
+ '(c-basic-offset 4)
+ '(inhibit-startup-screen t)
+ '(make-backup-files nil)
+ '(show-paren-mode t)
+ '(transient-mark-mode t))
+(desktop-save-mode 1) ; save the desktop when leaving
+(setq backup-inhibited t)
+(setq auto-save-default nil)
+; some default indentation follows
+(setq c-mode-hook
+ (function (lambda ()
+ (setq indent-tabs-mode nil)
+ (setq c-indent-level 4))))
+(setq objc-mode-hook
+ (function (lambda ()
+ (setq indent-tabs-mode nil)
+ (setq c-indent-level 4))))
+(setq c++-mode-hook
+ (function (lambda ()
+ (setq indent-tabs-mode nil)
+ (setq c-indent-level 4))))
+(setq default-tab-width 4)
+; useful shortcuts
+(global-set-key "\C-l" 'goto-line)
+; set default compile command
+(setq compile-command "cd ~/proyectos/ideallibrary ; ./waf")
+; yasnippet
+(add-to-list 'load-path "/usr/share/emacs/site-lisp/yas")
+(require 'yasnippet)
+(yas/initialize)
+(yas/load-directory "/usr/share/emacs/site-lisp/yas/snippets")
+(yas/load-directory "~/.emacs.d/yasnippet/snippets")
+(add-hook 'yas/after-exit-snippet-hook
+ '(lambda ()
+ (indent-region yas/snippet-beg yas/snippet-end))) ; indent when finishing snippet
+(require 'xcscope) ; xcscope
+; pastebin
+(require 'pastebin)
+(setq pastebin-identity "ereslibre")
+
+(setq auto-mode-alist (append '(("\\.pl$" . prolog-mode))
+ auto-mode-alist))
31 .emacs.d/color-theme-6.6.0/AUTHORS
@@ -0,0 +1,31 @@
+
+ *****************************************
+ AUTHORS
+ *****************************************
+
+NOTE: NEVER send bug reports, help and feature requests directly to the
+ authors !
+
+Original code and ideas by Jonadab the Unsightly One
+
+Current Maintainers:
+ * Xavier Maillard (release manager) <zedek@gnu.org>
+ * Brian Palmer <bpalmer@gmail.com>
+
+Previous maintainers:
+ * (1999 2000) Jonadab the Unsightly One <jonadab@bright.net>
+ * (2000, 2001, 2002, 2003) Alex Schroeder <alex@gnu.org>
+
+Contributors
+
+ * Deepak Goel <deego@glue.umd.edu>
+ * S. Pokrovsky <pok@nbsp.nsk.su> for ideas and discussion
+ * Gordon Messmer <gordon@dragonsdawn.net> for ideas and discussion.
+ * Sriram Karra <karra@cs.utah.edu> for the color-theme-submit stuff.
+ * Olgierd `Kingsajz' Ziolko <kingsajz@rpg.pl> for the spec-filter idea.
+ * Brian Palmer for color-theme-library ideas and code
+
+Note: all the users that contributed their color themes. See CREDITS.themes
+ for a complete listing of them.
+
+Thank you all of you !
71 .emacs.d/color-theme-6.6.0/BUGS
@@ -0,0 +1,71 @@
+This is the list of common problems.
+
+Emacs 20.7: Some faces are created using copy-face; these faces are
+not printed correctly using M-x color-theme-print. They will have
+(nil) in their spec. M-x customize-face has the same problem.
+
+Example:
+
+(copy-face 'bold 'new-bold)
+(color-theme-spec 'bold)
+ => (bold ((t (:bold t))))
+(color-theme-spec 'new-bold)
+ => (new-bold ((t (nil))))
+
+XEmacs 21.1: Some faces are defined using a certain font instead of
+of the correct attribute. They will have (nil) in their spec.
+M-x customize-face has the same problem.
+
+Example:
+
+(color-theme-spec 'bold)
+ => (bold ((t (nil))))
+
+XEmacs 21.2 and up, Emacs 21: Not compatible with the custom-theme
+mode. It should be easy to transform the color-theme source into
+custom-theme source, however.
+
+If you are running XEmacs, then only foreground and background color
+of the default face and only the background color of the text-cursor
+face will used. This is due to the fact that these three pieces of
+information are stored as frame parameters in Emacs.
+
+If you are running XEmacs, variables cannot have a frame-local
+binding. Therefore, if color-theme-is-global is set to nil, the
+variable settings in a color theme are ignored.
+
+Using Emacs and a non-nil value for color-theme-is-global will
+install a new color theme for all frames. Using XEmacs and a non-nil
+value for color-theme-is-global will install a new color theme only
+on those frames that are not using a local color theme.
+
+If your system does not define the color names used, you will get the
+error "undefined color". See the output of `list-colors-display' for
+a list of colors defined on your display.
+
+The :box, :height, and other new attributes will be honored in Emacs
+21, but when you print such a color-theme on Emacs 20 or XEmacs 21,
+the information will get lost. So don't do that. Furthermore,
+customizing these faces may end up showing you a lisp expression
+instead of the real widgets on Emacs 20 or XEmacs 21 because these
+attributes are not understood.
+
+:inverse-video handling differs in Emacs and XEmacs. We therefore do
+away with it. When printing a color-theme, the inverse-video
+attribute should be handled correctly without ever appearing in color
+themes. For maintenance, the following might be usefull for
+query-replace-regexp.
+:background "\([^"]*\)"\(.*\):foreground "\([^"]*\)"\(.*\) :inverse-video t
+:background "\3"\2:foreground "\1"\4
+
+In XEmacs 21.1, some of the face tests don't work. Example:
+(custom-face-bold 'bold) returns nil on my system. A bug report was
+submitted.
+
+Emacs 20 users will loose with new color themes, because these will
+set the colors of the default face only, leaving frame background
+untouched. In Emacs 20, the colors of the default face and of the
+frame could be changed independently. In Emacs 21, this is no longer
+true. New color themes will not be made backwards compatible.
+
+This release was superficially tested with Emacs 21.x/22.x and XEmacs 21.4.
342 .emacs.d/color-theme-6.6.0/COPYING
@@ -0,0 +1,342 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
+
+
121 .emacs.d/color-theme-6.6.0/ChangeLog
@@ -0,0 +1,121 @@
+2006-05-28 Xavier Maillard <zedek@gnu.org>
+
+ * Version 6.6.0 is released
+
+ * Tagged source with RELEASE_6-6-0 for "Back in the business" release
+
+ * HAGKING, BUGS, README: New files.
+
+ * color-theme.el (color-theme-libraries): Changed docstring.
+ (define-color-theme): Reworked macro to properly define themes.
+ (color-theme-initialize): Actually does what expected.
+ (color-theme-theme): Removed this useless variable.
+
+ Removed commentary section (splitted into specific files)
+
+ * Makefile.defs (DEBNAME): Changed default value to reveal all
+ needed informations
+ (LASTUPLOAD): New version.
+ (CVSMODULE, CVSBRANCH, CVSROOT): New variables used to
+ prepare a release.
+
+ * Makefile (dist, dist-prepare, debian,
+ tarball, realease, upload, $TARBALL, $DEBNAME): New targets.
+ (distclean): Delete old build traces (files, package, etc...)
+
+ * debian/control: Changed Maintainer informations.
+
+ * debian/emacsen-startup: Safely load autoloads file or die if tests fail.
+
+ * debian/rules: Fixed bad package construction.
+
+ * debian/emacsen-install: Handle theme files installation correctfully.
+
+2006-05-27 Xavier Maillard <zedek@gnu.org>
+
+ * debian: New directory. Contains all stuff to build a neat and
+ cool color-theme-el Debian package.
+
+ * AUTHORS: New file.
+
+ * color-theme-autoloads.in: Ditto..
+
+ * Makefile.defs: Ditto.
+
+ * Makefile: Ditto.
+
+ * color-theme.el (replace-in-string): New function. Used in define-color-theme
+ (color-theme-directory): New variable.
+ (color-theme-libraries): Changed default value to color-theme
+ official theme directory
+ (color-theme-load-all-themes): New variable.
+ (color-theme-initialize): Load theme files defined either in
+ color-theme-libraries or color-theme-directory.
+
+2006-05-22 Xavier Maillard <zedek@gnu.org>
+
+ * color-theme-library.el: make bytecompiler happy.
+
+ * color-theme.el (color-theme-initialize, color-theme-select)
+ (color-theme-describe, color-theme-install-at-mouse)
+ (color-theme-install-at-point)
+ (color-theme-install-at-point-for-current-frame)
+ (color-theme-print, color-theme-analyze-defun)
+ (color-theme-make-snapshot, color-theme-compare)
+ (color-theme-submit, color-theme-initialize): Added autoload cookies
+
+ * COPYING: New file
+
+2006-05-21 Xavier Maillard <zedek@gnu.org>
+
+ * color-theme.el: Make byte compiler happy.
+ Added autoload cookie on color-theme-install (useless ??)
+ Added eval-when-compile in color-theme-print
+
+2006-05-14 Xavier Maillard <zedek@gnu.org>
+
+ * color-theme.el: Cosmetic changes
+
+ * color-theme-library.el: Ditto (added header, legal notice)
+
+2006-05-11 Xavier Maillard <zedek@gnu.org>
+
+ * color-theme.el (color-theme-xemacs-p): Check for xemacs feature.
+ (color-theme-face-attr-construct): New function. Use it when
+ face-custom-attributes-get is bound. Fixes a bug on M-x
+ color-theme-select.
+
+2006-05-07 Xavier Maillard <zedek@gnu.org>
+
+ * color-theme.el (color-theme-entry-path): New variable used for easymenu definition.
+ We now check which (x)emacs version is used to correctly define our menu.
+ (Fixes a long standing bug)
+
+2006-03-31 Brian Palmer <bpalmer@gmail.com>
+
+ * color-theme-library.el (color-theme-renegade): Added new theme
+ by Dave Benjamin. Thanks Dave.
+
+ * color-theme.el (color-theme-select): Call
+ color-theme-initialized if it has not been called before.
+ (color-theme-initialized): Variable tracking initialization state, used in color-theme-select
+ (color-themes): Added renegade theme by Dave Benjamin. Thanks Dave.
+
+
+2006-01-13 Xavier Maillard <zedek@gnu.org>
+
+ * color-theme.el: Changed copyright header (just to test Gna services)
+
+2006-01-10 Brian Palmer <bpalmer@gmail.com>
+
+ * color-theme-library.el: Added color-theme-library.el, containing
+ the defined themes.
+ * color-theme.el (color-theme-libraries): Customizable variable.
+ * color-theme.el (color-theme-initialize): Load each file
+ specified in color-theme-libraries.
+
+2006-01-10 Brian Palmer <bpalmer@gmail.com>
+
+ * Added color-theme.el 6.5.5 to the repository.
+ * Added ChangeLog to the repository.
+
26 .emacs.d/color-theme-6.6.0/HACKING
@@ -0,0 +1,26 @@
+This file is intented to help any color-theme hacker and particulary
+color-theme release team.
+
+
+To release a new version, please follow these instructions:
+
+1a. Change Makefile.defs (VERSION and LASTUPLOAD)
+
+1b. Verify color-theme.el header file
+
+2. Prepare debian/ directory
+ => control and changelog
+ => check other files
+
+3. Tag the whole source files with:
+
+ cvs tag -c RELEASE-X-X-X
+
+4. Launch the automatic tarball/debian creation:
+
+ make release
+
+5. Pray :)
+
+
+
141 .emacs.d/color-theme-6.6.0/Makefile
@@ -0,0 +1,141 @@
+# -*- Makefile -*-
+
+# Borrowed from many emacs places
+
+include Makefile.defs
+
+SPECIAL =
+UNCOMPILED =
+AUTOLOADFILE = color-theme-autoloads
+TESTING =
+THEMES_DIRECTORY = themes
+THEMES_FILES := $(wildcard $(THEMES_DIRECTORY)/*.el)
+ALLSOURCE := $(wildcard *.el) $(THEMES_FILES)
+SOURCE = $(filter-out $(SPECIAL) $(UNCOMPILED) $(TESTING),$(ALLSOURCE))
+TARGET = $(patsubst %.el,%.elc,$(SPECIAL) $(SOURCE))
+MANUAL = color-theme
+MISC = AUTHORS COPYING ChangeLog Makefile.defs Makefile $(AUTOLOADFILE).in
+#AUTHORS CREDITS HISTORY NEWS README Makefile ChangeLog \
+#ChangeLog.2005 ChangeLog.2004 ChangeLog.2003 ChangeLog.2002 \
+#ChangeLog.2001 servers.pl color-theme-auto.in color-theme.texi
+
+all: lisp #$(MANUAL).info
+
+lisp: clean $(TARGET)
+
+autoloads: $(AUTOLOADFILE).elc
+
+$(AUTOLOADFILE).el: $(AUTOLOADFILE).in #$(TARGET)
+ cp $(AUTOLOADFILE).in $(AUTOLOADFILE).el
+ rm -f $(AUTOLOADFILE).elc
+ @$(EMACS) -q $(SITEFLAG) -batch \
+ -l $(shell pwd | sed -e 's|^/cygdrive/\([a-z]\)|\1:|')/$(AUTOLOADFILE) \
+ -f color-theme-generate-autoloads \
+ $(shell pwd | sed -e 's|^/cygdrive/\([a-z]\)|\1:|')/$(AUTOLOADFILE).el . \
+ $(THEMES_DIRECTORY)
+
+$(AUTOLOADFILE).elc: $(AUTOLOADFILE).el
+ @echo "Byte compiling the autoload file "$<
+ @$(EMACS) -batch -q -f batch-byte-compile $^
+ @echo "*******************************************************************"
+ @echo "Autoloads up to date. Put the following lines in your configuration"
+ @echo "file (~/.emacs for a single user) :"
+ @echo
+ @echo ${patsubst %, "(add-to-list 'load-path \""%"\") ", $(LISPDIRS)}
+ @echo "(require 'color-theme-autoload \""$(AUTOLOADFILE)"\")"
+ @echo
+
+%.elc: %.el
+ @$(EMACS) $(OPTIONCOMPILE) \
+ --eval '(setq load-path (cons "." load-path))' \
+ -f batch-byte-compile $<
+
+%.info: %.texi
+ @echo "No doc yet !"
+# makeinfo $<
+
+%.html: %.texi
+ @echo "No doc yet !"
+# makeinfo --html --no-split $<
+
+doc: $(MANUAL).info $(MANUAL).html
+ @echo "No doc yet !"
+
+clean:
+ -rm -f themes/*.elc
+ -rm -f *~ *.elc $(AUTOLOADFILE).el
+
+realclean: clean
+ -rm -f $(MANUAL).info $(MANUAL).html $(TARGET) $(SPECIAL)
+
+install-info: $(MANUAL).info
+ [ -d $(INFODIR) ] || install -d $(INFODIR)
+ install -m 0644 $(MANUAL).info $(INFODIR)/$(MANUAL)
+ $(INSTALLINFO) $(INFODIR)/$(MANUAL)
+
+install-bin: lisp
+ install -d $(ELISPDIR)
+ install -d $(ELISPDIR)/themes
+ install -m 0644 $(ALLSOURCE) $(TARGET) $(ELISPDIR)
+ install -m 0644 $(THEMES_FILES) $(TARGET) $(ELISPDIR)/themes
+
+install: install-bin install-info
+
+## DO NOT TOUCH THIS !
+## HELPERS FOR MAINTAINER(S)
+distclean:
+ -rm $(MANUAL).info $(MANUAL).html $(TARGET)
+ -rm -Rf ../$(DISTDIR)
+ -rm -f debian/dirs debian/files
+ -rm -rf $(DISTDIR) $(TARBALL)* $(ZIPFILE)* $(DEBNAME)*
+
+dist: distclean Makefile
+ $(MAKE) dist-prepare
+
+# Idea taken from w3m-el
+dist-prepare: CVS/Root CVS/Repository
+ cvs -d $(CVSROOT) -w export -d $(DISTDIR) -r $(CVSBRANCH) $(CVSMODULE)
+ -cvs diff |( cd $(DISTDIR) && patch -p0 )
+
+$(TARBALL): tarball
+$(DEBNAME): debian
+
+tarball: dist
+ find $(DISTDIR) -name .cvsignore | xargs rm -f
+ find $(DISTDIR) -name debian | xargs rm -fr
+ find $(DISTDIR) -type d | xargs chmod 755
+ find $(DISTDIR) -type f | xargs chmod 644
+
+ tar -cf `basename $(TARBALL) .gz` $(DISTDIR)
+ gzip -9 `basename $(TARBALL) .gz`
+ zip -r $(ZIPFILE) $(DISTDIR)
+ gpg --detach $(TARBALL)
+ gpg --detach $(ZIPFILE)
+
+debian: dist
+ (cd $(DISTDIR) && \
+ dpkg-buildpackage -v$(LASTUPLOAD) $(BUILDOPTS) \
+ -us -uc -rfakeroot && \
+ echo "Running lintian ..." && \
+ lintian -i ../$(DEBNAME)*.deb || : && \
+ echo "Done running lintian." && \
+ debsign)
+
+ cp $(DEBNAME)* /var/spool/repo
+ (cd /var/spool/repo && \
+ dpkg-scanpackages . /dev/null | gzip -9 > Packages.gz && \
+ dpkg-scansources . | gzip -9 > Sources.gz)
+
+release: $(DEBNAME) $(TARBALL)
+ rm -rf $(DISTDIR)
+ $(MAKE) upload distclean
+
+upload:
+ (cd /var/spool/repo && echo open perso.nerim.net > upload.lftp ; \
+ echo cd /var/spool/repo >> upload.lftp ; \
+ echo mput * >> upload.lftp ; \
+ echo close >> upload.lftp ; \
+ lftp -f upload.lftp ; \
+ rm -f upload.lftp)
+ (scp $(ZIPFILE)* $(TARBALL)* \
+ zeDek@download.gna.org:/upload/color-theme)
39 .emacs.d/color-theme-6.6.0/Makefile.defs
@@ -0,0 +1,39 @@
+# -*- Makefile -*-
+EMACS = emacs
+SITEFLAG = --no-site-file
+OPTIONCOMPILE = -q --no-site-file --batch
+
+# XEmacs users will probably want the following settings.
+#EMACS = xemacs
+#SITEFLAG = -no-site-file
+
+# Installation options
+# PREFIX is only used here.
+PREFIX = /usr/local
+ELISPDIR = $(PREFIX)/share/emacs/site-lisp/color-theme-el
+INFODIR = $(PREFIX)/info
+
+# Command to use to install the Info dir entry
+# If you're using Debian, uncomment the following line and comment out
+#the above line.
+#INSTALLINFO = install-info --section "Emacs" "emacs" --info-dir=$(INFODIR)
+INSTALLINFO = install-info --info-dir=$(INFODIR)
+
+# Useful only for the maintainer
+PROJECT = color-theme
+VERSION = 6.6.0
+DISTDIR = $(PROJECT)-$(VERSION)
+DEBNAME = $(PROJECT)-el_$(VERSION)
+TARBALL = $(DISTDIR).tar.gz
+ZIPFILE = $(DISTDIR).zip
+
+MANUAL =
+LASTUPLOAD = 6.6.0-2
+BUILDOPTS =
+
+# DO NOT TOUCH THIS
+TAG = $(shell echo RELEASE-$(VERSION) | tr '.' '-')
+CVSMODULE = $(shell cat CVS/Repository)
+CVSBRANCH = $(shell cvs status color-theme.el |grep "Sticky Tag:"|awk '{print $$3}'|sed 's/(none)/HEAD/')
+CVSBRANCH = $(shell echo rel-$(VERSION) | tr '.' '-')
+CVSROOT = $(shell cat CVS/Root)
86 .emacs.d/color-theme-6.6.0/README
@@ -0,0 +1,86 @@
+Sharing your current color setup:
+
+Use `color-theme-submit'. If you have already invested time in
+customizing Emacs faces, please consider sharing your current setup.
+Make sure that color-theme.el is in your `load-path'. Type M-x
+load-library RET color-theme RET to load all the functions. Type M-x
+color-theme-submit RET and mail the result to the maintainer of this
+package (see above for mail addres).
+
+If you want to make sure that all your customization was exported,
+type M-x list-faces-display RET to get a list of all faces currently
+defined. This is the list of faces that `color-theme-print' uses.
+
+Installing a color theme:
+
+Make sure that color-theme.el is in your `load-path'. Type M-x
+load-library RET color-theme RET to load all the functions.
+
+The main function to call is color-theme-select. Type M-x
+color-theme-select RET. That creates a Color Theme Selection
+buffer. Press RET or `i' on a color theme to install it for the
+rest of your session.
+
+If you want to install the color theme as soon as Emacs is started
+up, read the description of the theme you like and remember the
+name of the color theme function. Press `d' on a color theme in
+the Color Theme Selection buffer to read the description. Assuming
+you like the Gnome2 theme, you'll find that the function to use is
+called `color-theme-gnome2'. Add the following to the end of your
+.emacs (removing the leading `;;').
+
+(require 'color-theme)
+(color-theme-gnome2)
+
+Changing menu colors:
+
+In Emacs 21 on X, you can set the menu colors and font using the
+menu face. Example for your .emacs file:
+
+ (set-face-font 'menu "7x14")
+ (set-face-foreground 'menu "white").
+
+If are using X, you can set the menu foreground and background using
+a resource file, usually .Xdefaults or .Xresources. Usually
+.Xdefaults is used when you start your session using a display
+manager such as xdm or gdm. .Xresources is usually used when you
+start X directly via a shell script such as startx. If you set
+Emacs*Background and Emacs*Foreground in such a resource file, the
+foreground and background of Emacs including the menu will be set.
+If your .emacs then loads a color theme, the foreground and
+background are changed -- with the exception of the menu. There is
+no way to manipulate the menu foreground and background color from
+elisp. You can also set more specific menu resources for Emacs in
+the resource file. Here is a sample entry for your resource file:
+
+ Emacs*Background: DarkSlateGray
+ Emacs*Foreground: wheat
+
+Creating your own color theme:
+
+Use M-x customize-face and customize the faces. Make sure to "Set
+for Current Session" -- you don't want to save these using custom!
+When you are done, call M-x color-theme-print to produce the elisp
+code required to recreate your theme. Better yet, use M-x
+color-theme-submit to mail it to the maintainer. That way it will be
+added to future versions of color-theme.el.
+
+For more information on the elisp format of a color theme, start with
+the documentation of `color-theme-install' using C-h f
+color-theme-install.
+
+When your color theme is just a variation of an existing color theme,
+take a look at `color-theme-robin-hood' in order to see an example of
+how to do it. Essentially you want to call all the parent color
+themes before installing your changes. For all but the first parent
+color theme, you need to make sure that `color-theme-is-cumulative'
+is bound to t. If you don't do that, users that set
+`color-theme-is-cumulative' to nil will only install your changes
+without the parent color themes.
+
+Making a color theme work for both Emacs and XEmacs:
+
+Once you have printed the color-theme, you can make sure it looks
+similar in both Emacs and XEmacs by running
+`color-theme-analyze-defun' on the printed theme. This function
+will check for missing faces for the other editor...
0  .emacs.d/color-theme-6.6.0/build-stamp
No changes.
132 .emacs.d/color-theme-6.6.0/color-theme-autoloads.el
@@ -0,0 +1,132 @@
+;;; -*-emacs-lisp-*-
+
+;; Copyright (C) 2002 Free Software Foundation, Inc.
+
+(defvar generated-autoload-file)
+(defvar command-line-args-left)
+(defun color-theme-generate-autoloads ()
+ (interactive)
+ (require 'autoload)
+ (setq generated-autoload-file (car command-line-args-left))
+ (setq command-line-args-left (cdr command-line-args-left))
+ (batch-update-autoloads))
+
+(provide 'color-theme-autoloads)
+;;; Generated autoloads follow (made by autoload.el).
+
+;;;### (autoloads (color-theme-initialize color-theme-submit color-theme-install
+;;;;;; color-theme-compare color-theme-make-snapshot color-theme-analyze-defun
+;;;;;; color-theme-print color-theme-install-at-point-for-current-frame
+;;;;;; color-theme-install-at-mouse color-theme-describe color-theme-select)
+;;;;;; "color-theme" "color-theme.el" (17529 41105))
+;;; Generated autoloads from color-theme.el
+
+(autoload (quote color-theme-select) "color-theme" "\
+Displays a special buffer for selecting and installing a color theme.
+With optional prefix ARG, this buffer will include color theme libraries
+as well. A color theme library is in itself not complete, it must be
+used as part of another color theme to be useful. Thus, color theme
+libraries are mainly useful for color theme authors." t nil)
+
+(autoload (quote color-theme-describe) "color-theme" "\
+Describe color theme listed at point.
+This shows the documentation of the value of text-property color-theme
+at point. The text-property color-theme should be a color theme
+function. See `color-themes'." t nil)
+
+(autoload (quote color-theme-install-at-mouse) "color-theme" "\
+Install color theme clicked upon using the mouse.
+First argument EVENT is used to set point. Then
+`color-theme-install-at-point' is called." t nil)
+
+(autoload (quote color-theme-install-at-point-for-current-frame) "color-theme" "\
+Install color theme at point for current frame only.
+Binds `color-theme-is-global' to nil and calls
+`color-theme-install-at-point'." t nil)
+
+(autoload (quote color-theme-print) "color-theme" "\
+Print the current color theme function.
+
+You can contribute this function to <URL:news:gnu.emacs.sources> or
+paste it into your .emacs file and call it. That should recreate all
+the settings necessary for your color theme.
+
+Example:
+
+ (require 'color-theme)
+ (defun my-color-theme ()
+ \"Color theme by Alex Schroeder, created 2000-05-17.\"
+ (interactive)
+ (color-theme-install
+ '(...
+ ...
+ ...)))
+ (my-color-theme)
+
+If you want to use a specific color theme function, you can call the
+color theme function in your .emacs directly.
+
+Example:
+
+ (require 'color-theme)
+ (color-theme-gnome2)" t nil)
+
+(autoload (quote color-theme-analyze-defun) "color-theme" "\
+Once you have a color-theme printed, check for missing faces.
+This is used by maintainers who receive a color-theme submission
+and want to make sure it follows the guidelines by the color-theme
+author." t nil)
+
+(autoload (quote color-theme-make-snapshot) "color-theme" "\
+Return the definition of the current color-theme.
+The function returned will recreate the color-theme in use at the moment." nil nil)
+
+(autoload (quote color-theme-compare) "color-theme" "\
+Compare two color themes.
+This will print the differences between installing THEME-A and
+installing THEME-B. Note that the order is important: If a face is
+defined in THEME-A and not in THEME-B, then this will not show up as a
+difference, because there is no reset before installing THEME-B. If a
+face is defined in THEME-B and not in THEME-A, then this will show up as
+a difference." t nil)
+
+(autoload (quote color-theme-install) "color-theme" "\
+Install a color theme defined by frame parameters, variables and faces.
+
+The theme is installed for all present and future frames; any missing
+faces are created. See `color-theme-install-faces'.
+
+THEME is a color theme definition. See below for more information.
+
+If you want to install a color theme from your .emacs, use the output
+generated by `color-theme-print'. This produces color theme function
+which you can copy to your .emacs.
+
+A color theme definition is a list:
+\([FUNCTION] FRAME-PARAMETERS VARIABLE-SETTINGS FACE-DEFINITIONS)
+
+FUNCTION is the color theme function which called `color-theme-install'.
+This is no longer used. There was a time when this package supported
+automatic factoring of color themes. This has been abandoned.
+
+FRAME-PARAMETERS is an alist of frame parameters. These are installed
+with `color-theme-install-frame-params'. These are installed last such
+that any changes to the default face can be changed by the frame
+parameters.
+
+VARIABLE-DEFINITIONS is an alist of variable settings. These are
+installed with `color-theme-install-variables'.
+
+FACE-DEFINITIONS is an alist of face definitions. These are installed
+with `color-theme-install-faces'.
+
+If `color-theme-is-cumulative' is nil, a color theme will undo face and
+frame-parameter settings of previous color themes." nil nil)
+
+(autoload (quote color-theme-submit) "color-theme" "\
+Submit your color-theme to the maintainer." t nil)
+
+(autoload (quote color-theme-initialize) "color-theme" "\
+Initialize the color theme package by loading color-theme-libraries." t nil)
+
+;;;***
BIN  .emacs.d/color-theme-6.6.0/color-theme-autoloads.elc
Binary file not shown
15 .emacs.d/color-theme-6.6.0/color-theme-autoloads.in
@@ -0,0 +1,15 @@
+;;; -*-emacs-lisp-*-
+
+;; Copyright (C) 2002 Free Software Foundation, Inc.
+
+(defvar generated-autoload-file)
+(defvar command-line-args-left)
+(defun color-theme-generate-autoloads ()
+ (interactive)
+ (require 'autoload)
+ (setq generated-autoload-file (car command-line-args-left))
+ (setq command-line-args-left (cdr command-line-args-left))
+ (batch-update-autoloads))
+
+(provide 'color-theme-autoloads)
+;;; Generated autoloads follow (made by autoload.el).
1,668 .emacs.d/color-theme-6.6.0/color-theme.el
@@ -0,0 +1,1668 @@
+;;; color-theme.el --- install color themes
+
+;; Copyright (C) 1999, 2000 Jonadab the Unsightly One <jonadab@bright.net>
+;; Copyright (C) 2000, 2001, 2002, 2003 Alex Schroeder <alex@gnu.org>
+;; Copyright (C) 2003, 2004, 2005, 2006 Xavier Maillard <zedek@gnu.org>
+
+;; Version: 6.6.0
+;; Keywords: faces
+;; Author: Jonadab the Unsightly One <jonadab@bright.net>
+;; Maintainer: Xavier Maillard <zedek@gnu.org>
+;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?ColorTheme
+
+;; This file is not (YET) part of GNU Emacs.
+
+;; This is free software; you can redistribute it and/or modify it under
+;; the terms of the GNU General Public License as published by the Free
+;; Software Foundation; either version 2, or (at your option) any later
+;; version.
+;;
+;; This is distributed in the hope that it will be useful, but WITHOUT
+;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+;; for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
+;; MA 02111-1307, USA.
+
+;;; Commentary:
+
+;; Please read README and BUGS files for any relevant help.
+;; Contributors (not themers) should also read HACKING file.
+
+;;; Thanks
+
+;; Deepak Goel <deego@glue.umd.edu>
+;; S. Pokrovsky <pok@nbsp.nsk.su> for ideas and discussion.
+;; Gordon Messmer <gordon@dragonsdawn.net> for ideas and discussion.
+;; Sriram Karra <karra@cs.utah.edu> for the color-theme-submit stuff.
+;; Olgierd `Kingsajz' Ziolko <kingsajz@rpg.pl> for the spec-filter idea.
+;; Brian Palmer for color-theme-library ideas and code
+;; All the users that contributed their color themes.
+
+
+
+;;; Code:
+(eval-when-compile
+ (require 'easymenu)
+ (require 'reporter)
+ (require 'sendmail))
+
+(require 'cl); set-difference is a function...
+
+;; for custom-face-attributes-get or face-custom-attributes-get
+(require 'cus-face)
+(require 'wid-edit); for widget-apply stuff in cus-face.el
+
+(defconst color-theme-maintainer-address "zedek@gnu.org"
+ "Address used by `submit-color-theme'.")
+
+;; Emacs / XEmacs compatibility and workaround layer
+
+(cond ((and (facep 'tool-bar)
+ (not (facep 'toolbar)))
+ (put 'toolbar 'face-alias 'tool-bar))
+ ((and (facep 'toolbar)
+ (not (facep 'tool-bar)))
+ (put 'tool-bar 'face-alias 'toolbar)))
+
+(defvar color-theme-xemacs-p (and (featurep 'xemacs)
+ (string-match "XEmacs" emacs-version))
+ "Non-nil if running XEmacs.")
+
+;; Add this since it appears to miss in emacs-2x
+(or (fboundp 'replace-in-string)
+ (defun replace-in-string (target old new)
+ (replace-regexp-in-string old new target)))
+
+;; face-attr-construct has a problem in Emacs 20.7 and older when
+;; dealing with inverse-video faces. Here is a short test to check
+;; wether you are affected.
+
+;; (set-background-color "wheat")
+;; (set-foreground-color "black")
+;; (setq a (make-face 'a-face))
+;; (face-spec-set a '((t (:background "white" :foreground "black" :inverse-video t))))
+;; (face-attr-construct a)
+;; => (:background "black" :inverse-video t)
+
+;; The expected response is the original specification:
+;; => (:background "white" :foreground "black" :inverse-video t)
+
+;; That's why we depend on cus-face.el functionality.
+
+(cond ((fboundp 'custom-face-attributes-get)
+ (defun color-theme-face-attr-construct (face frame)
+ (if (atom face)
+ (custom-face-attributes-get face frame)
+ (if (and (consp face) (eq (car face) 'quote))
+ (custom-face-attributes-get (cadr face) frame)
+ (custom-face-attributes-get (car face) frame)))))
+ ((fboundp 'face-custom-attributes-get)
+ (defalias 'color-theme-face-attr-construct
+ 'face-custom-attributes-get))
+ (t
+ (defun color-theme-face-attr-construct (&rest ignore)
+ (error "Unable to construct face attributes"))))
+
+(defun color-theme-alist (plist)
+ "Transform PLIST into an alist if it is a plist and return it.
+If the first element of PLIST is a cons cell, we just return PLIST,
+assuming PLIST to be an alist. If the first element of plist is not a
+symbol, this is an error: We cannot distinguish a plist from an ordinary
+list, but a list that doesn't start with a symbol is certainly no plist
+and no alist.
+
+This is used to make sure `default-frame-alist' really is an alist and not
+a plist. In XEmacs, the alist is deprecated; a plist is used instead."
+ (cond ((consp (car plist))
+ plist)
+ ((not (symbolp (car plist)))
+ (error "Wrong type argument: plist, %S" plist))
+ ((featurep 'xemacs)
+ (plist-to-alist plist)))); XEmacs only
+
+;; Customization
+
+(defgroup color-theme nil
+ "Color Themes for Emacs.
+A color theme consists of frame parameter settings, variable settings,
+and face definitions."
+ :version "20.6"
+ :group 'faces)
+
+(defcustom color-theme-legal-frame-parameters "\\(color\\|mode\\)$"
+ "Regexp that matches frame parameter names.
+Only frame parameter names that match this regexp can be changed as part
+of a color theme."
+ :type '(choice (const :tag "Colors only" "\\(color\\|mode\\)$")
+ (const :tag "Colors, fonts, and size"
+ "\\(color\\|mode\\|font\\|height\\|width\\)$")
+ (regexp :tag "Custom regexp"))
+ :group 'color-theme
+ :link '(info-link "(elisp)Window Frame Parameters"))
+
+(defcustom color-theme-legal-variables "\\(color\\|face\\)$"
+ "Regexp that matches variable names.
+Only variables that match this regexp can be changed as part of a color
+theme. In addition to matching this name, the variables have to be user
+variables (see function `user-variable-p')."
+ :type 'regexp
+ :group 'color-theme)
+
+(defcustom color-theme-illegal-faces "^w3-"
+ "Regexp that matches face names forbidden in themes.
+The default setting \"^w3-\" excludes w3 faces since these
+are created dynamically."
+ :type 'regexp
+ :group 'color-theme
+ :link '(info-link "(elisp)Faces for Font Lock")
+ :link '(info-link "(elisp)Standard Faces"))
+
+(defcustom color-theme-illegal-default-attributes '(:family :height :width)
+ "A list of face properties to be ignored when installing faces.
+This prevents Emacs from doing terrible things to your display just because
+a theme author likes weird fonts."
+ :type '(repeat symbol)
+ :group 'color-theme)
+
+(defcustom color-theme-is-global t
+ "*Determines wether a color theme is installed on all frames or not.
+If non-nil, color themes will be installed for all frames.
+If nil, color themes will be installed for the selected frame only.
+
+A possible use for this variable is dynamic binding. Here is a larger
+example to put in your ~/.emacs; it will make the Blue Sea color theme
+the default used for the first frame, and it will create two additional
+frames with different color themes.
+
+setup:
+ \(require 'color-theme)
+ ;; set default color theme
+ \(color-theme-blue-sea)
+ ;; create some frames with different color themes
+ \(let ((color-theme-is-global nil))
+ \(select-frame (make-frame))
+ \(color-theme-gnome2)
+ \(select-frame (make-frame))
+ \(color-theme-standard))
+
+Please note that using XEmacs and and a nil value for
+color-theme-is-global will ignore any variable settings for the color
+theme, since XEmacs doesn't have frame-local variable bindings.
+
+Also note that using Emacs and a non-nil value for color-theme-is-global
+will install a new color theme for all frames. Using XEmacs and a
+non-nil value for color-theme-is-global will install a new color theme
+only on those frames that are not using a local color theme."
+ :type 'boolean
+ :group 'color-theme)
+
+(defcustom color-theme-is-cumulative t
+ "*Determines wether new color themes are installed on top of each other.
+If non-nil, installing a color theme will undo all settings made by
+previous color themes."
+ :type 'boolean
+ :group 'color-theme)
+
+(defcustom color-theme-directory nil
+ "Directory where we can find additionnal themes (personnal).
+Note that there is at least one directory shipped with the official
+color-theme distribution where all contributed themes are located.
+This official selection can't be changed with that variable.
+However, you still can decide to turn it on or off and thus,
+not be shown with all themes but yours."
+ :type '(repeat string)
+ :group 'color-theme)
+
+(defcustom color-theme-libraries (directory-files
+ (concat
+ (file-name-directory (locate-library "color-theme"))
+ "/themes") t "^color-theme")
+ "A list of files, which will be loaded in color-theme-initialize depending
+on `color-theme-load-all-themes' value.
+This allows a user to prune the default color-themes (which can take a while
+to load)."
+ :type '(repeat string)
+ :group 'color-theme)
+
+(defcustom color-theme-load-all-themes t
+ "When t, load all color-theme theme files
+as presented by `color-theme-libraries'. Else
+do not load any of this themes."
+ :type 'boolean
+ :group 'color-theme)
+
+(defcustom color-theme-mode-hook nil
+ "Hook for color-theme-mode."
+ :type 'hook
+ :group 'color-theme)
+
+(defvar color-theme-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map (kbd "RET") 'color-theme-install-at-point)
+ (define-key map (kbd "c") 'list-colors-display)
+ (define-key map (kbd "d") 'color-theme-describe)
+ (define-key map (kbd "f") 'list-faces-display)
+ (define-key map (kbd "i") 'color-theme-install-at-point)
+ (define-key map (kbd "l") 'color-theme-install-at-point-for-current-frame)
+ (define-key map (kbd "p") 'color-theme-print)
+ (define-key map (kbd "q") 'bury-buffer)
+ (define-key map (kbd "?") 'color-theme-describe)
+ (if color-theme-xemacs-p
+ (define-key map (kbd "<button2>") 'color-theme-install-at-mouse)
+ (define-key map (kbd "<mouse-2>") 'color-theme-install-at-mouse))
+ map)
+ "Mode map used for the buffer created by `color-theme-select'.")
+
+(defvar color-theme-initialized nil
+ "Internal variable determining whether color-theme-initialize has been invoked yet")
+
+(defvar color-theme-buffer-name "*Color Theme Selection*"
+ "Name of the color theme selection buffer.")
+
+(defvar color-theme-original-frame-alist nil
+ "nil until one of the color themes has been installed.")
+
+(defvar color-theme-history nil
+ "List of color-themes called, in reverse order")
+
+(defcustom color-theme-history-max-length nil
+ "Max length of history to maintain.
+Two other values are acceptable: t means no limit, and
+nil means that no history is maintained."
+ :type '(choice (const :tag "No history" nil)
+ (const :tag "Unlimited length" t)
+ integer)
+ :group 'color-theme)
+
+(defvar color-theme-counter 0
+ "Counter for every addition to `color-theme-history'.
+This counts how many themes were installed, regardless
+of `color-theme-history-max-length'.")
+
+(defvar color-theme-entry-path (cond
+ ;; Emacs 22.x and later
+ ((lookup-key global-map [menu-bar tools])
+ '("tools"))
+ ;; XEmacs
+ ((featurep 'xemacs)
+ (setq tool-entry '("Tools")))
+ ;; Emacs < 22
+ (t
+ '("Tools")))
+ "Menu tool entry path.")
+
+(defun color-theme-add-to-history (name)
+ "Add color-theme NAME to `color-theme-history'."
+ (setq color-theme-history
+ (cons (list name color-theme-is-cumulative)
+ color-theme-history)
+ color-theme-counter (+ 1 color-theme-counter))
+ ;; Truncate the list if necessary.
+ (when (and (integerp color-theme-history-max-length)
+ (>= (length color-theme-history)
+ color-theme-history-max-length))
+ (setcdr (nthcdr (1- color-theme-history-max-length)
+ color-theme-history)
+ nil)))
+
+;; (let ((l '(1 2 3 4 5)))
+;; (setcdr (nthcdr 2 l) nil)
+;; l)
+
+
+
+;; List of color themes used to create the *Color Theme Selection*
+;; buffer.
+
+(defvar color-themes
+ '((color-theme-aalto-dark "Aalto Dark" "Jari Aalto <jari.aalto@poboxes.com>")
+ (color-theme-aalto-light "Aalto Light" "Jari Aalto <jari.aalto@poboxes.com>")
+ (color-theme-aliceblue "Alice Blue" "Girish Bharadwaj <girishb@gbvsoft.com>")
+ (color-theme-andreas "Andreas" "Andreas Busch <Andreas.Busch@politics.ox.ac.uk>")
+ (color-theme-arjen "Arjen" "Arjen Wiersma <arjen@wiersma.org>")
+ (color-theme-beige-diff "Beige Diff" "Alex Schroeder <alex@gnu.org>" t)
+ (color-theme-bharadwaj "Bharadwaj" "Girish Bharadwaj <girishb@gbvsoft.com>")
+ (color-theme-bharadwaj-slate "Bharadwaj Slate" "Girish Bharadwaj <girishb@gbvsoft.com>")
+ (color-theme-billw "Billw" "Bill White <billw@wolfram.com>")
+ (color-theme-black-on-gray "BlackOnGray" "Sudhir Bhojwani <sbhojwani@altoweb.com>")
+ (color-theme-blippblopp "Blipp Blopp" "Thomas Sicheritz-Ponten<thomas@biopython.org>")
+ (color-theme-simple-1 "Black" "Jonadab <jonadab@bright.net>")
+ (color-theme-blue-erc "Blue ERC" "Alex Schroeder <alex@gnu.org>" t)
+ (color-theme-blue-gnus "Blue Gnus" "Alex Schroeder <alex@gnu.org>" t)
+ (color-theme-blue-mood "Blue Mood" "Nelson Loyola <nloyola@yahoo.com>")
+ (color-theme-blue-sea "Blue Sea" "Alex Schroeder <alex@gnu.org>")
+ (color-theme-calm-forest "Calm Forest" "Artur Hefczyc <kobit@plusnet.pl>")
+ (color-theme-charcoal-black "Charcoal Black" "Lars Chr. Hausmann <jazz@zqz.dk>")
+ (color-theme-goldenrod "Cheap Goldenrod" "Alex Schroeder <alex@gnu.org>")
+ (color-theme-clarity "Clarity and Beauty" "Richard Wellum <rwellum@cisco.com>")
+ (color-theme-classic "Classic" "Frederic Giroud <postcard@worldonline.fr>")
+ (color-theme-comidia "Comidia" "Marcelo Dias de Toledo <mtole@ig.com.br>")
+ (color-theme-jsc-dark "Cooper Dark" "John S Cooper <John.Cooper@eu.citrix.com>")
+ (color-theme-jsc-light "Cooper Light" "John S Cooper <John.Cooper@eu.citrix.com>")
+ (color-theme-jsc-light2 "Cooper Light 2" "John S Cooper <John.Cooper@eu.citrix.com>")
+ (color-theme-dark-blue "Dark Blue" "Chris McMahan <cmcmahan@one.net>")
+ (color-theme-dark-blue2 "Dark Blue 2" "Chris McMahan <cmcmahan@one.net>")
+ (color-theme-dark-green "Dark Green" "eddy_woody@hotmail.com")
+ (color-theme-dark-laptop "Dark Laptop" "Laurent Michel <ldm@cs.brown.edu>")
+ (color-theme-deep-blue "Deep Blue" "Tomas Cerha <cerha@brailcom.org>")
+ (color-theme-digital-ofs1 "Digital OFS1" "Gareth Owen <gowen@gwowen.freeserve.co.uk>")
+ (color-theme-euphoria "Euphoria" "oGLOWo@oGLOWo.cjb.net")
+ (color-theme-feng-shui "Feng Shui" "Walter Higgins <walterh@rocketmail.com>")
+ (color-theme-fischmeister "Fischmeister"
+ "Sebastian Fischmeister <sfischme@nexus.lzk.tuwien.ac.at>")
+ (color-theme-gnome "Gnome" "Jonadab <jonadab@bright.net>")
+ (color-theme-gnome2 "Gnome 2" "Alex Schroeder <alex@gnu.org>")
+ (color-theme-gray1 "Gray1" "Paul Pulli <P.Pulli@motorola.com>")
+ (color-theme-gray30 "Gray30" "Girish Bharadwaj <girishb@gbvsoft.com>")
+ (color-theme-kingsajz "Green Kingsajz" "Olgierd `Kingsajz' Ziolko <kingsajz@rpg.pl>")
+ (color-theme-greiner "Greiner" "Kevin Greiner <kgreiner@mapquest.com>")
+ (color-theme-gtk-ide "GTK IDE" "Gordon Messmer <gordon@dragonsdawn.net>")
+ (color-theme-high-contrast "High Contrast" "Alex Schroeder <alex@gnu.org>")
+ (color-theme-hober "Hober" "Edward O'Connor <ted@oconnor.cx>")
+ (color-theme-infodoc "Infodoc" "Frederic Giroud <postcard@worldonline.fr>")
+ (color-theme-jb-simple "JB Simple" "jeff@dvns.com")
+ (color-theme-jedit-grey "Jedit Grey" "Gordon Messmer <gordon@dragonsdawn.net>")
+ (color-theme-jonadabian "Jonadab" "Jonadab <jonadab@bright.net>")
+ (color-theme-jonadabian-slate "Jonadabian Slate" "Jonadab <jonadab@bright.net>")
+ (color-theme-katester "Katester" "Higgins_Walter@emc.com")
+ (color-theme-late-night "Late Night" "Alex Schroeder <alex@gnu.org>")
+ (color-theme-lawrence "Lawrence" "lawrence mitchell <wence@gmx.li>")
+ (color-theme-lethe "Lethe" "Ivica Loncar <ivica.loncar@srk.fer.hr>")
+ (color-theme-ld-dark "Linh Dang Dark" "Linh Dang <linhd@nortelnetworks.com>")
+ (color-theme-marine "Marine" "Girish Bharadwaj <girishb@gbvsoft.com>")
+ (color-theme-matrix "Matrix" "Walter Higgins <walterh@rocketmail.com>")
+ (color-theme-marquardt "Marquardt" "Colin Marquardt <colin@marquardt-home.de>")
+ (color-theme-midnight "Midnight" "Gordon Messmer <gordon@dragonsdawn.net>")
+ (color-theme-mistyday "Misty Day" "Hari Kumar <Hari.Kumar@mtm.kuleuven.ac.be>")
+ (color-theme-montz "Montz" "Brady Montz <bradym@becomm.com>")
+ (color-theme-oswald "Oswald" "Tom Oswald <toswald@sharplabs.com>")
+ (color-theme-parus "Parus" "Jon K Hellan <hellan@acm.org>")
+ (color-theme-pierson "Pierson" "Dan L. Pierson <dan@sol.control.com>")
+ (color-theme-ramangalahy "Ramangalahy" "Solofo Ramangalahy <solofo@irisa.fr>")
+ (color-theme-raspopovic "Raspopovic" "Pedja Raspopovic <pedja@lsil.com>")
+ (color-theme-renegade "Renegade" "Dave Benjamin <ramen@ramenfest.com>")
+ (color-theme-resolve "Resolve" "Damien Elmes <resolve@repose.cx>")
+ (color-theme-retro-green "Retro Green" "Alex Schroeder <alex@gnu.org>")
+ (color-theme-retro-orange "Retro Orange" "Alex Schroeder <alex@gnu.org>")
+ (color-theme-robin-hood "Robin Hood" "Alex Schroeder <alex@gnu.org>")
+ (color-theme-rotor "Rotor" "Jinwei Shen <shenjw@wam.umd.edu>")
+ (color-theme-ryerson "Ryerson" "Luis Fernandes <elf@ee.ryerson.ca>")
+ (color-theme-salmon-diff "Salmon Diff" "Alex Schroeder <alex@gnu.org>" t)
+ (color-theme-salmon-font-lock "Salmon Font-Lock" "Alex Schroeder <alex@gnu.org>" t)
+ (color-theme-scintilla "Scintilla" "Gordon Messmer <gordon@dragonsdawn.net>")
+ (color-theme-shaman "Shaman" "shaman@interdon.net")
+ (color-theme-sitaramv-nt "Sitaram NT"
+ "Sitaram Venkatraman <sitaramv@loc251.tandem.com>")
+ (color-theme-sitaramv-solaris "Sitaram Solaris"
+ "Sitaram Venkatraman <sitaramv@loc251.tandem.com>")
+ (color-theme-snow "Snow" "Nicolas Rist <Nicolas.Rist@alcatel.de>")
+ (color-theme-snowish "Snowish" "Girish Bharadwaj <girishb@gbvsoft.com>")
+ (color-theme-standard-ediff "Standard Ediff" "Emacs Team, added by Alex Schroeder <alex@gnu.org>" t)
+ (color-theme-standard "Standard Emacs 20" "Emacs Team, added by Alex Schroeder <alex@gnu.org>")
+ (color-theme-emacs-21 "Standard Emacs 21" "Emacs Team, added by Alex Schroeder <alex@gnu.org>")
+ (color-theme-emacs-nw "Standard Emacs 21 No Window" "Emacs Team, added by D. Goel <deego@gnufans.org>")
+ (color-theme-xemacs "Standard XEmacs" "XEmacs Team, added by Alex Schroeder <alex@gnu.org>")
+ (color-theme-subtle-blue "Subtle Blue" "Chris McMahan <cmcmahan@one.net>")
+ (color-theme-subtle-hacker "Subtle Hacker" "Colin Walters <levanti@verbum.org>")
+ (color-theme-taming-mr-arneson "Taming Mr Arneson" "Erik Arneson <erik@aarg.net>")
+ (color-theme-taylor "Taylor" "Art Taylor <reeses@hemisphere.org>")
+ (color-theme-tty-dark "TTY Dark" "O Polite <m2@plusseven.com>")
+ (color-theme-vim-colors "Vim Colors" "Michael Soulier <msoulier@biryani.nssg.mitel.com>")
+ (color-theme-whateveryouwant "Whateveryouwant" "Fabien Penso <penso@linuxfr.org>, color by Scott Jaderholm <scott@jaderholm.com>")
+ (color-theme-wheat "Wheat" "Alex Schroeder <alex@gnu.org>")
+ (color-theme-pok-wob "White On Black" "S. Pokrovsky <pok@nbsp.nsk.su>")
+ (color-theme-pok-wog "White On Grey" "S. Pokrovsky <pok@nbsp.nsk.su>")
+ (color-theme-word-perfect "WordPerfect" "Thomas Gehrlein <Thomas.Gehrlein@t-online.de>")
+ (color-theme-xp "XP" "Girish Bharadwaj <girishb@gbvsoft.com>"))
+ "List of color themes.
+
+Each THEME is itself a three element list (FUNC NAME MAINTAINER &optional LIBRARY).
+
+FUNC is a color theme function which does the setup. The function
+FUNC may call `color-theme-install'. The color theme function may be
+interactive.
+
+NAME is the name of the theme and MAINTAINER is the name and/or email of
+the maintainer of the theme.
+
+If LIBRARY is non-nil, the color theme will be considered a library and
+may not be shown in the default menu.
+
+If you defined your own color theme and want to add it to this list,
+use something like this:
+
+ (add-to-list 'color-themes '(color-theme-gnome2 \"Gnome2\" \"Alex\"))")
+
+;;; Functions
+
+(defun color-theme-backup-original-values ()
+ "Back up the original `default-frame-alist'.
+The values are stored in `color-theme-original-frame-alist' on
+startup."
+ (if (null color-theme-original-frame-alist)
+ (setq color-theme-original-frame-alist
+ (color-theme-filter (frame-parameters (selected-frame))
+ color-theme-legal-frame-parameters))))
+(add-hook 'after-init-hook 'color-theme-backup-original-values)
+
+;;;###autoload
+(defun color-theme-select (&optional arg)
+ "Displays a special buffer for selecting and installing a color theme.
+With optional prefix ARG, this buffer will include color theme libraries
+as well. A color theme library is in itself not complete, it must be
+used as part of another color theme to be useful. Thus, color theme
+libraries are mainly useful for color theme authors."
+ (interactive "P")
+ (unless color-theme-initialized (color-theme-initialize))
+ (switch-to-buffer (get-buffer-create color-theme-buffer-name))
+ (setq buffer-read-only nil)
+ (erase-buffer)
+ ;; recreate the snapshot if necessary
+ (when (or (not (assq 'color-theme-snapshot color-themes))
+ (not (commandp 'color-theme-snapshot)))
+ (fset 'color-theme-snapshot (color-theme-make-snapshot))
+ (setq color-themes (delq (assq 'color-theme-snapshot color-themes)
+ color-themes)
+ color-themes (delq (assq 'bury-buffer color-themes)
+ color-themes)
+ color-themes (append '((color-theme-snapshot
+ "[Reset]" "Undo changes, if possible.")
+ (bury-buffer
+ "[Quit]" "Bury this buffer."))
+ color-themes)))
+ (dolist (theme color-themes)
+ (let ((func (nth 0 theme))
+ (name (nth 1 theme))
+ (author (nth 2 theme))
+ (library (nth 3 theme))
+ (desc))
+ (when (or (not library) arg)
+ (setq desc (format "%-23s %s"
+ (if library (concat name " [lib]") name)
+ author))
+ (put-text-property 0 (length desc) 'color-theme func desc)
+ (put-text-property 0 (length name) 'face 'bold desc)
+ (put-text-property 0 (length name) 'mouse-face 'highlight desc)
+ (insert desc)
+ (newline))))
+ (goto-char (point-min))
+ (setq buffer-read-only t)
+ (set-buffer-modified-p nil)
+ (color-theme-mode))
+
+(when (require 'easymenu)
+ (easy-menu-add-item nil color-theme-entry-path "--")
+ (easy-menu-add-item nil color-theme-entry-path
+ ["Color Themes" color-theme-select t]))
+
+(defun color-theme-mode ()
+ "Major mode to select and install color themes.
+
+Use \\[color-theme-install-at-point] to install a color theme on all frames.
+Use \\[color-theme-install-at-point-for-current-frame] to install a color theme for the current frame only.
+
+The changes are applied on top of your current setup. This is a
+feature.
+
+Some of the themes should be considered extensions to the standard color
+theme: they modify only a limited number of faces and variables. To
+verify the final look of a color theme, install the standard color
+theme, then install the other color theme. This is a feature. It allows
+you to mix several color themes.
+
+Use \\[color-theme-describe] to read more about the color theme function at point.
+If you want to install the color theme permanently, put the call to the
+color theme function into your ~/.emacs:
+
+ \(require 'color-theme)
+ \(color-theme-gnome2)
+
+If you worry about the size of color-theme.el: You are right. Use
+\\[color-theme-print] to print the current color theme and save the resulting buffer
+as ~/.emacs-color-theme. Now you can install only this specific color
+theme in your .emacs:
+
+ \(load-file \"~/.emacs-color-theme\")
+ \(my-color-theme)
+
+The Emacs menu is not affected by color themes within Emacs. Depending
+on the toolkit you used to compile Emacs, you might have to set specific
+X ressources. See the info manual for more information. Here is an
+example ~/.Xdefaults fragment:
+
+ emacs*Background: DarkSlateGray
+ emacs*Foreground: wheat
+
+\\{color-theme-mode-map}
+
+The color themes are listed in `color-themes', which see."
+ (kill-all-local-variables)
+ (setq major-mode 'color-theme-mode)
+ (setq mode-name "Color Themes")
+ (use-local-map color-theme-mode-map)
+ (when (functionp 'goto-address); Emacs
+ (goto-address))
+ (run-hooks 'color-theme-mode-hook))
+
+;;; Commands in Color Theme Selection mode
+
+;;;###autoload
+(defun color-theme-describe ()
+ "Describe color theme listed at point.
+This shows the documentation of the value of text-property color-theme
+at point. The text-property color-theme should be a color theme
+function. See `color-themes'."
+ (interactive)
+ (describe-function (get-text-property (point) 'color-theme)))
+
+;;;###autoload
+(defun color-theme-install-at-mouse (event)
+ "Install color theme clicked upon using the mouse.
+First argument EVENT is used to set point. Then
+`color-theme-install-at-point' is called."
+ (interactive "e")
+ (save-excursion
+ (mouse-set-point event)
+ (color-theme-install-at-point)))
+
+;;;autoload
+(defun color-theme-install-at-point ()
+ "Install color theme at point.
+This calls the value of the text-property `color-theme' at point.
+The text-property `color-theme' should be a color theme function.
+See `color-themes'."
+ (interactive)
+ (let ((func (get-text-property (point) 'color-theme)))
+ ;; install theme
+ (if func
+ (funcall func))
+ ;; If goto-address is being used, remove all overlays in the current
+ ;; buffer and run it again. The face used for the mail addresses in
+ ;; the the color theme selection buffer is based on the variable
+ ;; goto-address-mail-face. Changes in that variable will not affect
+ ;; existing overlays, however, thereby confusing users.
+ (when (functionp 'goto-address); Emacs
+ (dolist (o (overlays-in (point-min) (point-max)))
+ (delete-overlay o))
+ (goto-address))))
+
+;;;###autoload
+(defun color-theme-install-at-point-for-current-frame ()
+ "Install color theme at point for current frame only.
+Binds `color-theme-is-global' to nil and calls
+`color-theme-install-at-point'."
+ (interactive)
+ (let ((color-theme-is-global nil))
+ (color-theme-install-at-point)))
+
+
+
+;; Taking a snapshot of the current color theme and pretty printing it.
+
+(defun color-theme-filter (old-list regexp &optional exclude)
+ "Filter OLD-LIST.
+The resulting list will be newly allocated and contains only elements
+with names matching REGEXP. OLD-LIST may be a list or an alist. If you
+want to filter a plist, use `color-theme-alist' to convert your plist to
+an alist, first.
+
+If the optional argument EXCLUDE is non-nil, then the sense is
+reversed: only non-matching elements will be retained."
+ (let (elem new-list)
+ (dolist (elem old-list)
+ (setq name (symbol-name (if (listp elem) (car elem) elem)))
+ (when (or (and (not exclude)
+ (string-match regexp name))
+ (and exclude
+ (not (string-match regexp name))))
+ ;; Now make sure that if elem is a cons cell, and the cdr of
+ ;; that cons cell is a string, then we need a *new* string in
+ ;; the new list. Having a new cons cell is of no use because
+ ;; modify-frame-parameters will modify this string, thus
+ ;; modifying our color theme functions!
+ (when (and (consp elem)
+ (stringp (cdr elem)))
+ (setq elem (cons (car elem)
+ (copy-sequence (cdr elem)))))
+ ;; Now store elem
+ (setq new-list (cons elem new-list))))
+ new-list))
+
+(defun color-theme-spec-filter (spec)
+ "Filter the attributes in SPEC.
+This makes sure that SPEC has the form ((t (PLIST ...))).
+Only properties not in `color-theme-illegal-default-attributes'
+are included in the SPEC returned."
+ (let ((props (cadar spec))
+ result prop val)
+ (while props
+ (setq prop (nth 0 props)
+ val (nth 1 props)
+ props (nthcdr 2 props))
+ (unless (memq prop color-theme-illegal-default-attributes)
+ (setq result (cons val (cons prop result)))))
+ `((t ,(nreverse result)))))
+
+;; (color-theme-spec-filter '((t (:background "blue3"))))
+;; (color-theme-spec-filter '((t (:stipple nil :background "Black" :foreground "SteelBlue" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :width semi-condensed :family "misc-fixed"))))
+
+(defun color-theme-plist-delete (plist prop)
+ "Delete property PROP from property list PLIST by side effect.
+This modifies PLIST."
+ ;; deal with prop at the start
+ (while (eq (car plist) prop)
+ (setq plist (cddr plist)))
+ ;; deal with empty plist
+ (when plist
+ (let ((lastcell (cdr plist))
+ (l (cddr plist)))
+ (while l
+ (if (eq (car l) prop)
+ (progn
+ (setq l (cddr l))
+ (setcdr lastcell l))
+ (setq lastcell (cdr l)
+ l (cddr l))))))
+ plist)
+
+;; (color-theme-plist-delete '(a b c d e f g h) 'a)
+;; (color-theme-plist-delete '(a b c d e f g h) 'b)
+;; (color-theme-plist-delete '(a b c d e f g h) 'c)
+;; (color-theme-plist-delete '(a b c d e f g h) 'g)
+;; (color-theme-plist-delete '(a b c d c d e f g h) 'c)
+;; (color-theme-plist-delete '(a b c d e f c d g h) 'c)
+
+(if (or (featurep 'xemacs)
+ (< emacs-major-version 21))
+ (defalias 'color-theme-spec-compat 'identity)
+ (defun color-theme-spec-compat (spec)
+ "Filter the attributes in SPEC such that is is never invalid.
+Example: Eventhough :bold works in Emacs, it is not recognized by
+`customize-face' -- and then the face is uncustomizable. This
+function replaces a :bold attribute with the corresponding :weight
+attribute, if there is no :weight, or deletes it. This undoes the
+doings of `color-theme-spec-canonical-font', more or less."
+ (let ((props (cadar spec)))
+ (when (plist-member props :bold)
+ (setq props (color-theme-plist-delete props :bold))
+ (unless (plist-member props :weight)
+ (setq props (plist-put props :weight 'bold))))
+ (when (plist-member props :italic)
+ (setq props (color-theme-plist-delete props :italic))
+ (unless (plist-member props :slant)
+ (setq props (plist-put props :slant 'italic))))
+ `((t ,props)))))
+
+;; (color-theme-spec-compat '((t (:foreground "blue" :bold t))))
+;; (color-theme-spec-compat '((t (:bold t :foreground "blue" :weight extra-bold))))
+;; (color-theme-spec-compat '((t (:italic t :foreground "blue"))))
+;; (color-theme-spec-compat '((t (:slant oblique :italic t :foreground "blue"))))
+
+(defun color-theme-spec-canonical-font (atts)
+ "Add :bold and :italic attributes if necessary."
+ ;; add these to the front of atts -- this will keept the old value for
+ ;; customize-face in Emacs 21.
+ (when (and (memq (plist-get atts :weight)
+ '(ultra-bold extra-bold bold semi-bold))
+ (not (plist-get atts :bold)))
+ (setq atts (cons :bold (cons t atts))))
+ (when (and (not (memq (plist-get atts :slant)
+ '(normal nil)))
+ (not (plist-get atts :italic)))
+ (setq atts (cons :italic (cons t atts))))
+ atts)
+;; (color-theme-spec-canonical-font (color-theme-face-attr-construct 'bold (selected-frame)))
+;; (defface foo '((t (:weight extra-bold))) "foo")
+;; (color-theme-spec-canonical-font (color-theme-face-attr-construct 'foo (selected-frame)))
+;; (face-spec-set 'foo '((t (:weight extra-bold))) nil)
+;; (face-spec-set 'foo '((t (:bold t))) nil)
+;; (face-spec-set 'foo '((t (:bold t :weight extra-bold))) nil)
+
+;; Handle :height according to NEWS file for Emacs 21
+(defun color-theme-spec-resolve-height (old new)
+ "Return the new height given OLD and NEW height.
+OLD is the current setting, NEW is the setting inherited from."
+ (cond ((not old)
+ new)
+ ((integerp old)
+ old)
+ ((and (floatp old)
+ (integerp new))
+ (round (* old new)))
+ ((and (floatp old)
+ (floatp new))
+ (* old new))
+ ((and (functionp old)
+ (integerp new))
+ (round (funcall old new)))
+ ((and (functionp old)
+ (float new))
+ `(lambda (f) (* (funcall ,old f) ,new)))
+ ((and (functionp old)
+ (functionp new))
+ `(lambda (f) (* (funcall ,old (funcall ,new f)))))
+ (t
+ (error "Illegal :height attributes: %S or %S" old new))))
+;; (color-theme-spec-resolve-height 12 1.2)
+;; (color-theme-spec-resolve-height 1.2 1.2)
+;; (color-theme-spec-resolve-height 1.2 12)
+;; (color-theme-spec-resolve-height 1.2 'foo)
+;; (color-theme-spec-resolve-height (lambda (f) (* 2 f)) 5)
+;; (color-theme-spec-resolve-height (lambda (f) (* 2 f)) 2.0)
+;; the following lambda is the result from the above calculation
+;; (color-theme-spec-resolve-height (lambda (f) (* (funcall (lambda (f) (* 2 f)) f) 2.0)) 5)
+
+(defun color-theme-spec-resolve-inheritance (atts)
+ "Resolve all occurences of the :inherit attribute."
+ (let ((face (plist-get atts :inherit)))
+ ;; From the Emacs 21 NEWS file: "Attributes from inherited faces are
+ ;; merged into the face like an underlying face would be." --
+ ;; therefore properties of the inherited face only add missing
+ ;; attributes.
+ (when face
+ ;; remove :inherit face from atts -- this assumes only one
+ ;; :inherit attribute.
+ (setq atts (delq ':inherit (delq face atts)))
+ (let ((more-atts (color-theme-spec-resolve-inheritance
+ (color-theme-face-attr-construct
+ face (selected-frame))))
+ att val)
+ (while more-atts
+ (setq att (car more-atts)
+ val (cadr more-atts)
+ more-atts (cddr more-atts))
+ ;; Color-theme assumes that no value is ever 'unspecified.
+ (cond ((eq att ':height); cumulative effect!
+ (setq atts (plist-put atts
+ ':height
+ (color-theme-spec-resolve-height
+ (plist-get atts att)
+ val))))
+ ;; Default: Only put if it has not been specified before.
+ ((not (plist-get atts att))
+ (setq atts (cons att (cons val atts))))
+
+))))
+ atts))
+;; (color-theme-spec-resolve-inheritance '(:bold t))
+;; (color-theme-spec-resolve-inheritance '(:bold t :foreground "blue"))
+;; (color-theme-face-attr-construct 'font-lock-comment-face (selected-frame))
+;; (color-theme-spec-resolve-inheritance '(:bold t :inherit font-lock-comment-face))
+;; (color-theme-spec-resolve-inheritance '(:bold t :foreground "red" :inherit font-lock-comment-face))
+;; (color-theme-face-attr-construct 'Info-title-2-face (selected-frame))
+;; (color-theme-face-attr-construct 'Info-title-3-face (selected-frame))
+;; (color-theme-face-attr-construct 'Info-title-4-face (selected-frame))
+;; (color-theme-spec-resolve-inheritance '(:inherit Info-title-2-face))
+
+;; The :inverse-video attribute causes Emacs to swap foreground and
+;; background colors, XEmacs does not. Therefore, if anybody chooses
+;; the inverse-video attribute, we 1. swap the colors ourselves in Emacs
+;; and 2. we remove the inverse-video attribute in Emacs and XEmacs.
+;; Inverse-video is only useful on a monochrome tty.
+(defun color-theme-spec-maybe-invert (atts)
+ "Remove the :inverse-video attribute from ATTS.
+If ATTS contains :inverse-video t, remove it and swap foreground and
+background color. Return ATTS."
+ (let ((inv (plist-get atts ':inverse-video)))
+ (if inv
+ (let (result att)
+ (while atts
+ (setq att (car atts)
+ atts (cdr atts))
+ (cond ((and (eq att :foreground) (not color-theme-xemacs-p))
+ (setq result (cons :background result)))
+ ((and (eq att :background) (not color-theme-xemacs-p))
+ (setq result (cons :foreground result)))
+ ((eq att :inverse-video)
+ (setq atts (cdr atts))); this prevents using dolist
+ (t
+ (setq result (cons att result)))))
+ (nreverse result))
+ ;; else
+ atts)))
+;; (color-theme-spec-maybe-invert '(:bold t))
+;; (color-theme-spec-maybe-invert '(:foreground "blue"))
+;; (color-theme-spec-maybe-invert '(:background "red"))
+;; (color-theme-spec-maybe-invert '(:inverse-video t))
+;; (color-theme-spec-maybe-invert '(:inverse-video t :foreground "red"))
+;; (color-theme-spec-maybe-invert '(:inverse-video t :background "red"))
+;; (color-theme-spec-maybe-invert '(:inverse-video t :background "red" :foreground "blue" :bold t))
+;; (color-theme-spec-maybe-invert '(:inverse-video nil :background "red" :foreground "blue" :bold t))
+
+(defun color-theme-spec (face)
+ "Return a list for FACE which has the form (FACE SPEC).
+See `defface' for the format of SPEC. In this case we use only one
+DISPLAY, t, and determine ATTS using `color-theme-face-attr-construct'.
+If ATTS is nil, (nil) is used instead.
+
+If ATTS contains :inverse-video t, we remove it and swap foreground and
+background color using `color-theme-spec-maybe-invert'. We do this
+because :inverse-video is handled differently in Emacs and XEmacs. We
+will loose on a tty without colors, because in that situation,
+:inverse-video means something."
+ (let ((atts
+ (color-theme-spec-canonical-font
+ (color-theme-spec-maybe-invert
+ (color-theme-spec-resolve-inheritance
+ (color-theme-face-attr-construct face (selected-frame)))))))
+ (if atts
+ `(,face ((t ,atts)))
+ `(,face ((t (nil)))))))
+
+(defun color-theme-get-params ()
+ "Return a list of frame parameter settings usable in a color theme.
+Such an alist may be installed by `color-theme-install-frame-params'. The
+frame parameters returned must match `color-theme-legal-frame-parameters'."
+ (let ((params (color-theme-filter (frame-parameters (selected-frame))
+ color-theme-legal-frame-parameters)))
+ (sort params (lambda (a b) (string< (symbol-name (car a))
+ (symbol-name (car b)))))))
+
+(defun color-theme-get-vars ()
+ "Return a list of variable settings usable in a color theme.
+Such an alist may be installed by `color-theme-install-variables'.
+The variable names must match `color-theme-legal-variables', and the
+variable must be a user variable according to `user-variable-p'."
+ (let ((vars)
+ (val))
+ (mapatoms (lambda (v)
+ (and (boundp v)
+ (user-variable-p v)
+ (string-match color-theme-legal-variables
+ (symbol-name v))
+ (setq val (eval v))
+ (add-to-list 'vars (cons v val)))))
+ (sort vars (lambda (a b) (string< (car a) (car b))))))
+
+(defun color-theme-print-alist (alist)
+ "Print ALIST."
+ (insert "\n " (if alist "(" "nil"))
+ (dolist (elem alist)
+ (when (= (preceding-char) ?\))
+ (insert "\n "))
+ (prin1 elem (current-buffer)))
+ (when (= (preceding-char) ?\)) (insert ")")))
+
+(defun color-theme-get-faces ()
+ "Return a list of faces usable in a color theme.
+Such an alist may be installed by `color-theme-install-faces'. The
+faces returned must not match `color-theme-illegal-faces'."
+ (let ((faces (color-theme-filter (face-list) color-theme-illegal-faces t)))
+ ;; default face must come first according to comments in
+ ;; custom-save-faces, the rest is to be sorted by name
+ (cons 'default (sort (delq 'default faces) 'string-lessp))))
+
+(defun color-theme-get-face-definitions ()
+ "Return face settings usable in a color-theme."
+ (let ((faces (color-theme-get-faces)))
+ (mapcar 'color-theme-spec faces)))
+
+(defun color-theme-print-faces (faces)
+ "Print face settings for all faces returned by `color-theme-get-faces'."
+ (when faces
+ (insert "\n "))
+ (dolist (face faces)
+ (when (= (preceding-char) ?\))
+ (insert "\n "))
+ (prin1 face (current-buffer))))
+
+(defun color-theme-reset-faces ()
+ "Reset face settings for all faces returned by `color-theme-get-faces'."
+ (let ((faces (color-theme-get-faces))
+ (face) (spec) (entry)
+ (frame (if color-theme-is-global nil (selected-frame))))
+ (while faces
+ (setq entry (color-theme-spec (car faces)))
+ (setq face (nth 0 entry))
+ (setq spec '((t (nil))))
+ (setq faces (cdr faces))
+ (if (functionp 'face-spec-reset-face)
+ (face-spec-reset-face face frame)
+ (face-spec-set face spec frame)
+ (if color-theme-is-global
+ (put face 'face-defface-spec spec))))))
+
+(defun color-theme-print-theme (func doc params vars faces)
+ "Print a theme into the current buffer.
+FUNC is the function name, DOC the doc string, PARAMS the
+frame parameters, VARS the variable bindings, and FACES
+the list of faces and their specs."
+ (insert "(defun " (symbol-name func) " ()\n"
+ " \"" doc "\"\n"
+ " (interactive)\n"
+ " (color-theme-install\n"
+ " '(" (symbol-name func))
+ ;; alist of frame parameters
+ (color-theme-print-alist params)
+ ;; alist of variables
+ (color-theme-print-alist vars)
+ ;; remaining elements of snapshot: face specs
+ (color-theme-print-faces faces)
+ (insert ")))\n")
+ (insert "(add-to-list 'color-themes '(" (symbol-name func) " "
+ " \"THEME NAME\" \"YOUR NAME\"))")
+ (goto-char (point-min)))
+
+;;;###autoload
+(defun color-theme-print (&optional buf)
+ "Print the current color theme function.
+
+You can contribute this function to <URL:news:gnu.emacs.sources> or
+paste it into your .emacs file and call it. That should recreate all
+the settings necessary for your color theme.
+
+Example:
+
+ \(require 'color-theme)
+ \(defun my-color-theme ()
+ \"Color theme by Alex Schroeder, created 2000-05-17.\"
+ \(interactive)
+ \(color-theme-install
+ '(...
+ ...
+ ...)))
+ \(my-color-theme)
+
+If you want to use a specific color theme function, you can call the
+color theme function in your .emacs directly.
+
+Example:
+
+ \(require 'color-theme)
+ \(color-theme-gnome2)"
+ (interactive)
+ (message "Pretty printing current color theme function...")
+ (switch-to-buffer (if buf
+ buf
+ (get-buffer-create "*Color Theme*")))
+ (unless buf
+ (setq buffer-read-only nil)
+ (erase-buffer))
+ ;; insert defun
+ (insert "(eval-when-compile"
+ " (require 'color-theme))\n")
+ (color-theme-print-theme 'my-color-theme
+ (concat "Color theme by "
+ (if (string= "" user-full-name)
+ (user-login-name)
+ user-full-name)
+ ", created " (format-time-string "%Y-%m-%d") ".")
+ (color-theme-get-params)
+ (color-theme-get-vars)
+ (mapcar 'color-theme-spec (color-theme-get-faces)))
+ (unless buf
+ (emacs-lisp-mode))
+ (goto-char (point-min))
+ (message "Pretty printing current color theme function... done"))
+
+(defun color-theme-analyze-find-theme (code)
+ "Find the sexpr that calls `color-theme-install'."
+ (let (theme)
+ (while (and (not theme) code)
+ (when (eq (car code) 'color-theme-install)
+ (setq theme code))
+ (when (listp (car code))
+ (setq theme (color-theme-analyze-find-theme (car code))))
+ (setq code (cdr code)))
+ theme))
+
+;; (equal (color-theme-analyze-find-theme
+;; '(defun color-theme-blue-eshell ()
+;; "Color theme for eshell faces only."
+;; (color-theme-install
+;; '(color-theme-blue-eshell
+;; nil
+;; (eshell-ls-archive-face ((t (:bold t :foreground "IndianRed"))))
+;; (eshell-ls-backup-face ((t (:foreground "Grey"))))))))
+;; '(color-theme-install
+;; (quote
+;; (color-theme-blue-eshell
+;; nil
+;; (eshell-ls-archive-face ((t (:bold t :foreground "IndianRed"))))
+;; (eshell-ls-backup-face ((t (:foreground "Grey")))))))))
+
+(defun color-theme-analyze-add-face (a b regexp faces)
+ "If only one of A or B are in FACES, the other is added, and FACES is returned.
+If REGEXP is given, this is only done if faces contains a match for regexps."
+ (when (or (not regexp)
+ (catch 'found
+ (dolist (face faces)
+ (when (string-match regexp (symbol-name (car face)))
+ (throw 'found t)))))
+ (let ((face-a (assoc a faces))
+ (face-b (assoc b faces)))
+ (if (and face-a (not face-b))
+ (setq faces (cons (list b (nth 1 face-a))
+ faces))
+ (if (and (not face-a) face-b)
+ (setq faces (cons (list a (nth 1 face-b))
+ faces))))))
+ faces)
+
+;; (equal (color-theme-analyze-add-face
+;; 'blue 'violet nil
+;; '((blue ((t (:foreground "blue"))))
+;; (bold ((t (:bold t))))))
+;; '((violet ((t (:foreground "blue"))))
+;; (blue ((t (:foreground "blue"))))
+;; (bold ((t (:bold t))))))
+;; (equal (color-theme-analyze-add-face
+;; 'violet 'blue nil
+;; '((blue ((t (:foreground "blue"))))
+;; (bold ((t (:bold t))))))
+;; '((violet ((t (:foreground "blue"))))
+;; (blue ((t (:foreground "blue"))))
+;; (bold ((t (:bold t))))))
+;; (equal (color-theme-analyze-add-face
+;; 'violet 'blue "foo"
+;; '((blue ((t (:foreground "blue"))))
+;; (bold ((t (:bold t))))))
+;; '((blue ((t (:foreground "blue"))))
+;; (bold ((t (:bold t))))))
+;; (equal (color-theme-analyze-add-face
+;; 'violet 'blue "blue"
+;; '((blue ((t (:foreground "blue"))))
+;; (bold ((t (:bold t))))))
+;; '((violet ((t (:foreground "blue"))))
+;; (blue ((t (:foreground "blue"))))
+;; (bold ((t (:bold t))))))
+
+(defun color-theme-analyze-add-faces (faces)
+ "Add missing faces to FACES and return it."
+ ;; The most important thing is to add missing faces for the other
+ ;; editor. These are the most important faces to check. The
+ ;; following rules list two faces, A and B. If either of the two is
+ ;; part of the theme, the other must be, too. The optional third
+ ;; argument specifies a regexp. Only if an existing face name
+ ;; matches this regexp, is the rule applied.
+ (let ((rules '((font-lock-builtin-face font-lock-reference-face)
+ (font-lock-doc-face font-lock-doc-string-face)
+ (font-lock-constant-face font-lock-preprocessor-face)
+ ;; In Emacs 21 `modeline' is just an alias for
+ ;; `mode-line'. I recommend the use of
+ ;; `modeline' until further notice.
+ (modeline mode-line)
+ (modeline modeline-buffer-id)
+ (modeline modeline-mousable)
+ (modeline modeline-mousable-minor-mode)
+ (region primary-selection)
+ (region zmacs-region)
+ (font-lock-string-face dired-face-boring "^dired")
+ (font-lock-function-name-face dired-face-directory "^dired")
+ (default dired-face-executable "^dired")
+ (font-lock-warning-face dired-face-flagged "^dired")
+ (font-lock-warning-face dired-face-marked "^dired")
+ (default dired-face-permissions "^dired")
+ (default dired-face-setuid "^dired")
+ (default dired-face-socket "^dired")
+ (font-lock-keyword-face dired-face-symlink "^dired")
+ (tool-bar menu))))
+ (dolist (rule rules)
+ (setq faces (color-theme-analyze-add-face
+ (nth 0 rule) (nth 1 rule) (nth 2 rule) faces))))
+ ;; The `fringe' face defines what the left and right borders of the
+ ;; frame look like in Emacs 21. To give them default fore- and
+ ;; background colors, use (fringe ((t (nil)))) in your color theme.
+ ;; Usually it makes more sense to choose a color slightly lighter or
+ ;; darker from the default background.
+ (unless (assoc 'fringe faces)
+ (setq faces (cons '(fringe ((t (nil)))) faces)))
+ ;; The tool-bar should not be part of the frame-parameters, since it
+ ;; should not appear or disappear depending on the color theme. The
+ ;; apppearance of the toolbar, however, can be changed by the color
+ ;; theme. For Emacs 21, use the `tool-bar' face. The easiest way
+ ;; to do this is to give it the default fore- and background colors.
+ ;; This can be achieved using (tool-bar ((t (nil)))) in the theme.
+ ;; Usually it makes more sense, however, to provide the same colors
+ ;; as used in the `menu' face, and to specify a :box attribute. In
+ ;; order to alleviate potential Emacs/XEmacs incompatibilities,
+ ;; `toolbar' will be defined as an alias for `tool-bar' if it does
+ ;; not exist, and vice-versa. This is done eventhough the face
+ ;; `toolbar' seems to have no effect on XEmacs. If you look at
+ ;; XEmacs lisp/faces.el, however, you will find that it is in fact
+ ;; referenced for XPM stuff.
+ (unless (assoc 'tool-bar faces)
+ (setq faces (cons '(tool-bar ((t (nil)))) faces)))
+ ;; Move the default face back to the front, and sort the rest.
+ (unless (eq (caar faces) 'default)
+ (let ((face (assoc 'default faces)))
+ (setq faces (cons face
+ (sort (delete face faces)
+ (lambda (a b)
+ (string-lessp (car a) (car b))))))))
+ faces)
+
+(defun color-theme-analyze-remove-heights (faces)
+ "Remove :height property where it is an integer and return FACES."
+ ;; I don't recommend making font sizes part of a color theme. Most
+ ;; users would be surprised to see their font sizes change when they
+ ;; install a color-theme. Therefore, remove all :height attributes
+ ;; if the value is an integer. If the value is a float, this is ok
+ ;; -- the value is relative to the default height. One notable
+ ;; exceptions is for a color-theme created for visually impaired
+ ;; people. These *must* use a larger font in order to be usable.
+ (let (result)
+ (dolist (face faces)
+ (let ((props (cadar (nth 1 face))))
+ (if (and (plist-member props :height)
+ (integerp (plist-get props :height)))
+ (setq props (color-theme-plist-delete props :height)
+ result (cons (list (car face) `((t ,props)))
+ result))
+ (setq result (cons face result)))))
+ (nreverse result)))
+
+;; (equal (color-theme-analyze-remove-heights
+;; '((blue ((t (:foreground "blue" :height 2))))
+;; (bold ((t (:bold t :height 1.0))))))
+;; '((blue ((t (:foreground "blue"))))
+;; (bold ((t (:bold t :height 1.0))))))
+
+;;;###autoload
+(defun color-theme-analyze-defun ()
+ "Once you have a color-theme printed, check for missing faces.
+This is used by maintainers who receive a color-theme submission
+and want to make sure it follows the guidelines by the color-theme
+author."
+ ;; The support for :foreground and :background attributes works for
+ ;; Emacs 20 and 21 as well as for XEmacs. :inverse-video is taken
+ ;; care of while printing color themes.
+ (interactive)
+ ;; Parse the stuff and find the call to color-theme-install
+ (save-excursion
+ (save-restriction
+ (narrow-to-defun)
+ ;; define the function
+ (eval-defun nil)
+ (goto-char (point-min))
+ (let* ((code (read (current-buffer)))
+ (theme (color-theme-canonic
+ (eval
+ (cadr
+ (color-theme-analyze-find-theme
+ code)))))
+ (func (color-theme-function theme))
+ (doc (documentation func t))
+ (variables (color-theme-variables theme))
+ (faces (color-theme-faces theme))
+ (params (color-theme-frame-params theme)))
+ (setq faces (color-theme-analyze-remove-heights
+ (color-theme-analyze-add-faces faces)))
+ ;; Remove any variable bindings of faces that point to their
+ ;; symbol? Perhaps not, because another theme might want to
+ ;; change this, so it is important to be able to reset them.
+ ;; (let (result)
+ ;; (dolist (var variables)
+ ;; (unless (eq (car var) (cdr var))
+ ;; (setq result (cons var result))))
+ ;; (setq variables (nreverse result)))
+ ;; Now modify the theme directly.
+ (setq theme (color-theme-analyze-find-theme code))
+ (setcdr (cadadr theme) (list params variables faces))
+ (message "Pretty printing analysed color theme function...")
+ (with-current-buffer (get-buffer-create "*Color Theme*")
+ (setq buffer-read-only nil)
+ (erase-buffer)
+ ;; insert defun
+ (color-theme-print-theme func doc params variables faces)
+ (emacs-lisp-mode))
+ (message "Pretty printing analysed color theme function... done")
+ (ediff-buffers (current-buffer)
+ (get-buffer "*Color Theme*"))))))
+
+;;; Creating a snapshot of the current color theme
+
+(defun color-theme-snapshot nil)
+
+;;;###autoload
+(defun color-theme-make-snapshot ()
+ "Return the definition of the current color-theme.
+The function returned will recreate the color-theme in use at the moment."
+ (eval `(lambda ()
+ "The color theme in use when the selection buffer was created.
+\\[color-theme-select] creates the color theme selection buffer. At the
+same time, this snapshot is created as a very simple undo mechanism.
+The snapshot is created via `color-theme-snapshot'."
+ (interactive)
+ (color-theme-install
+ '(color-theme-snapshot
+ ;; alist of frame parameters
+ ,(color-theme-get-params)
+ ;; alist of variables
+ ,(color-theme-get-vars)
+ ;; remaining elements of snapshot: face specs
+ ,@(color-theme-get-face-definitions))))))
+
+
+
+;;; Handling the various parts of a color theme install
+
+(defvar color-theme-frame-param-frobbing-rules
+ '((foreground-color default foreground)
+ (background-color default background))
+ "List of rules to use when frobbing faces based on frame parameters.
+This is only necessary for XEmacs, because in Emacs 21 changing the
+frame paramters automatically affects the relevant faces.")
+
+;; fixme: silent the bytecompiler with set-face-property
+(defun color-theme-frob-faces (params)
+ "Change certain faces according to PARAMS.
+This uses `color-theme-frame-param-frobbing-rules'."
+ (dolist (rule color-theme-frame-param-frobbing-rules)
+ (let* ((param (nth 0 rule))
+ (face (nth 1 rule))
+ (prop (nth 2 rule))
+ (val (cdr (assq param params)))
+ (frame (if color-theme-is-global nil (selected-frame))))
+ (when val
+ (set-face-property face prop val frame)))))
+
+(defun color-theme-alist-reduce (old-list)
+ "Reduce OLD-LIST.
+The resulting list will be newly allocated and will not contain any elements
+with duplicate cars. This will speed the installation of new themes by
+only installing unique attributes."
+ (let (new-list)
+ (dolist (elem old-list)
+ (when (not (assq (car elem) new-list))
+ (setq new-list (cons elem new-list))))
+ new-list))
+
+(defun color-theme-install-frame-params (params)
+ "Change frame parameters using alist PARAMETERS.
+
+If `color-theme-is-global' is non-nil, all frames are modified using
+`modify-frame-parameters' and the PARAMETERS are prepended to
+`default-frame-alist'. The value of `initial-frame-alist' is not
+modified. If `color-theme-is-global' is nil, only the selected frame is
+modified. If `color-theme-is-cumulative' is nil, the frame parameters
+are restored from `color-theme-original-frame-alist'.
+
+If the current frame parameters have a parameter `minibuffer' with
+value `only', then the frame parameters are not installed, since this
+indicates a dedicated minibuffer frame.
+
+Called from `color-theme-install'."
+ (setq params (color-theme-filter
+ params color-theme-legal-frame-parameters))
+ ;; We have a new list in params now, therefore we may use
+ ;; destructive nconc.
+ (if color-theme-is-global
+ (let ((frames (frame-list)))
+ (if (or color-theme-is-cumulative
+ (null color-theme-original-frame-alist))
+ (setq default-frame-alist
+ (append params (color-theme-alist default-frame-alist))
+ minibuffer-frame-alist
+ (append params (color-theme-alist minibuffer-frame-alist)))
+ (setq default-frame-alist
+ (append params color-theme-original-frame-alist)
+ minibuffer-frame-alist
+ (append params (color-theme-alist minibuffer-frame-alist))))
+ (setq default-frame-alist
+ (color-theme-alist-reduce default-frame-alist)
+ minibuffer-frame-alist
+ (color-theme-alist-reduce minibuffer-frame-alist))