{"id":72,"date":"2009-11-30T17:20:51","date_gmt":"2009-11-30T15:20:51","guid":{"rendered":"http:\/\/www.blackhats.es\/wordpress\/?p=72"},"modified":"2022-08-20T18:26:12","modified_gmt":"2022-08-20T16:26:12","slug":"color-theme","status":"publish","type":"post","link":"https:\/\/www.blackhats.es\/wordpress\/?p=72","title":{"rendered":"Color-theme"},"content":{"rendered":"<p><strong>Color-theme<\/strong> es un script en elisp que permite la carga de temas para emacs. <strong>Color-theme.el<\/strong> carga el fichero <strong>color-theme-6.6.0\/themes\/<\/strong><strong>color-theme-library.el<\/strong>, que es el fichero que contiene los temas que no son mas que pedazos de codigo a modo de funcion unidos en un mismo fichero e interpretados por <strong>color-theme.el<\/strong>.<\/p>\n<p>Por lo tanto tendremos que cargar el script<strong> color-theme.el <\/strong>y especificar que tema queremos cargar en nuestro <strong>.emacs<\/strong>, y del resto ya lo hara nuestro <strong>color-theme.el<\/strong>.<\/p>\n<p>Tambien podemos editar el fichero <strong>color-theme-library.el<\/strong> y modificar un tema a nuestro gusto, que siempre es una tarea menos compleja que comenzar uno de cero. En cualquier caso pasemos a explicar como instalar y configurar <strong>color-theme<\/strong>. Primero debemos descargarlo en la web oficial:<\/p>\n<p><a href=\"http:\/\/www.nongnu.org\/color-theme\/\" target=\"_blank\" rel=\"noopener\">http:\/\/www.nongnu.org\/color-theme\/<\/a><\/p>\n<p>Desde dicha web recomiendo usar la version tarball, ya que asi tenemos un control total de donde y como se instalan las cosas, donde descomprimimos, etc:<\/p>\n<p><a href=\"http:\/\/mirrors.aixtools.net\/sv\/color-theme\/\" target=\"_blank\" rel=\"noopener\">http:\/\/mirrors.aixtools.net\/sv\/color-theme\/<\/a><\/p>\n<p>Luego solo debemos descomprimirlo (por ejemplo en nuestro<strong> $HOME<\/strong>) mediante:<\/p>\n<p>$<strong> tar xvfz\u00a0color-theme-6.6.0.tar.gz<\/strong> (o la version que sea)<\/p>\n<p>Una vez hecho esto, no debemos compilar ni instalar (entendiendo por instalar un make install que simplemente copia ciertos ficheros generalmente binarios en directorios del sistema en lugar de directorios locales al usuario).<\/p>\n<p>Una vez hecho esto tan solo debemos anadir a nuestro <strong>.emacs<\/strong> las siguientes lineas:<\/p>\n<p style=\"padding-left: 30px;\"><em><span style=\"color: #ff6600;\">(add-to-list &#8216;load-path \u00ab~\/color-theme-6.6.0\u00bb)<\/span><\/em><br \/>\n<em><span style=\"color: #ff6600;\">(require &#8216;color-theme)<\/span><\/em><br \/>\n<em><span style=\"color: #ff6600;\">(color-theme-initialize)<\/span><\/em><\/p>\n<p>Y anadir esta otra para cargar un theme emacs (por ejemplo uno de mis favoritos):<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #ff6600;\"><em>(color-theme-goldenrod)<\/em><\/span><\/p>\n<p>Para ver la lista de themes podemos e ir probando uno a uno podemos hacer <strong>M-x color-theme-<\/strong> y presionamos la tecla <strong>TAB<\/strong>, podremos ver un listado de los mismos, sin embargo la carga y recarga de uno y otro tema conlleva la ventaja de que es mas rapido ir probando nuevos temas, pero la desventaja que si un nuevo tema no cambia alguna propiedad de emacs, se quedara con la propiedad antigua, lo que no nos permitira ver totalmente o deformara el tema original.<\/p>\n<p>Aqui dejo para quien quiera descargar mi color-theme basado en <strong>goldenrod<\/strong> (tan solo se deben copiar las siguientes lineas en el <strong>color-theme-library.el<\/strong> y anadir<strong> (color-theme-overdrive) <\/strong>en nuestro<strong> .emacs<\/strong>):<\/p>\n<p style=\"padding-left: 30px;\"><span style=\"color: #ff6600;\"><em>(defun color-theme-overdrive ()<br \/>\n\u00abBrown color theme. \u00a0Very different from the others.<br \/>\nSupports standard, font-lock and info faces, and it uses<br \/>\n`color-theme-blue-gnus&#8217;, `color-theme-blue-erc&#8217; , and<br \/>\n`color-theme-beige-diff&#8217;.\u00bb<br \/>\n(interactive)<br \/>\n(color-theme-blue-gnus)<br \/>\n(let ((color-theme-is-cumulative t))<br \/>\n(color-theme-blue-erc)<br \/>\n(color-theme-beige-diff)<br \/>\n(color-theme-beige-eshell)<br \/>\n(color-theme-install<br \/>\n&#8216;(color-theme-goldenrod<br \/>\n((background-color . \u00abblack\u00bb)<br \/>\n<\/em><\/span> <span><span style=\"color: #ff6600;\"><em> <\/em><\/span><\/span><span style=\"color: #ff6600;\"><em>(background-mode . dark)<br \/>\n<\/em><\/span> <span><span style=\"color: #ff6600;\"><em> <\/em><\/span><\/span><span style=\"color: #ff6600;\"><em>(border-color . \u00abblack\u00bb)<br \/>\n<\/em><\/span> <span><span style=\"color: #ff6600;\"><em> <\/em><\/span><\/span><span style=\"color: #ff6600;\"><em>(cursor-color . \u00ablight goldenrod\u00bb)<br \/>\n<\/em><\/span> <span><span style=\"color: #ff6600;\"><em> <\/em><\/span><\/span><span style=\"color: #ff6600;\"><em>(foreground-color . \u00abgoldenrod\u00bb)<br \/>\n<\/em><\/span> <span><span style=\"color: #ff6600;\"><em> <\/em><\/span><\/span><span style=\"color: #ff6600;\"><em>(mouse-color . \u00abgoldenrod\u00bb))<br \/>\n((goto-address-mail-face . info-xref)<br \/>\n<\/em><\/span> <span><span style=\"color: #ff6600;\"><em> <\/em><\/span><\/span><span style=\"color: #ff6600;\"><em>(list-matching-lines-face . bold)<br \/>\n<\/em><\/span> <span><span style=\"color: #ff6600;\"><em> <\/em><\/span><\/span><span style=\"color: #ff6600;\"><em>(view-highlight-face . highlight))<br \/>\n(default ((t (nil))))<br \/>\n(bold ((t (:bold t))))<br \/>\n(bold-italic ((t (:italic t :bold t :foreground \u00ablavender\u00bb))))<br \/>\n(font-lock-builtin-face ((t (:foreground \u00abpale goldenrod\u00bb))))<br \/>\n(font-lock-comment-face ((t (:foreground \u00abindian red\u00bb))))<br \/>\n(font-lock-constant-face ((t (:foreground \u00abpale green\u00bb))))<br \/>\n(font-lock-function-name-face ((t (:bold t :foreground \u00ablemon chiffon\u00bb))))<br \/>\n(font-lock-keyword-face ((t (:foreground \u00abwheat\u00bb))))<br \/>\n(font-lock-string-face ((t (:foreground \u00abgold\u00bb))))<br \/>\n(font-lock-type-face ((t (:foreground \u00abdark khaki\u00bb :bold t))))<br \/>\n(font-lock-variable-name-face ((t (:bold t :foreground \u00abkhaki\u00bb))))<br \/>\n(font-lock-warning-face ((t (:bold t :foreground \u00aborange red\u00bb))))<br \/>\n(fringe ((t (:background \u00abgray25\u00bb))))<br \/>\n(header-line ((t (:background \u00abaliceblue\u00bb :foreground \u00abblack\u00bb))))<\/em><\/span><span><span style=\"color: #ff6600;\"><em> <\/em><\/span><\/span><span style=\"color: #ff6600;\"><em><br \/>\n(highlight ((t (:background \u00abdark slate blue\u00bb))))<br \/>\n(info-menu-5 ((t (:underline t))))<br \/>\n(info-node ((t (:bold t))))<br \/>\n(info-xref ((t (:bold t :foreground \u00abpale goldenrod\u00bb))))<br \/>\n(isearch ((t (:background \u00abSeaGreen4\u00bb :foreground \u00abblack\u00bb))))<br \/>\n(isearch-lazy-highlight-face ((t (:background \u00abcyan\u00bb :foreground \u00abblack\u00bb))))<br \/>\n(italic ((t (:italic t :foreground \u00ablavender\u00bb))))<br \/>\n(menu ((t (:background \u00abgray25\u00bb :foreground \u00ablemon chiffon\u00bb))))<br \/>\n(modeline ((t (:background \u00abgray40\u00bb :foreground \u00ablemon chiffon\u00bb :box (:line-width 1 :style released-button)))))<br \/>\n(modeline-buffer-id ((t (:background \u00abAntiqueWhite4\u00bb :foreground \u00abblue\u00bb))))<br \/>\n(modeline-mousable ((t (:background \u00abAntiqueWhite4\u00bb :foreground \u00ablemon chiffon\u00bb))))<br \/>\n(modeline-mousable-minor-mode ((t (:background \u00abwheat\u00bb :foreground \u00ablemon chiffon\u00bb))))<br \/>\n(mode-line-inactive ((t (:background \u00abgray20\u00bb :foreground \u00ablemon chiffon\u00bb :box (:line-width 1 :style released-button)))))<br \/>\n(region ((t (:background \u00abred\u00bb :foreground \u00abblack\u00bb))))<br \/>\n(secondary-selection ((t (:background \u00abdark green\u00bb))))<br \/>\n(tool-bar ((t (:background \u00abgray25\u00bb :foreground \u00ablemon chiffon\u00bb :box (:line-width 1 :style released-button)))))<br \/>\n(left-margin ((t (:background \u00abdarkblue\u00bb :foreground \u00abyellow\u00bb))))<br \/>\n(underline ((t (:underline t))))))))<\/em><\/span><\/p>\n<p>Algunas capturas de pantalla de mi theme:<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/img228.imageshack.us\/img228\/1235\/32417556.png\" alt=\"\" width=\"607\" height=\"527\" \/><\/p>\n<p style=\"text-align: center;\">Tema con codigo fuente buscando cadena con C-s y resaltando las ocurrencias<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" src=\"http:\/\/img301.imageshack.us\/img301\/97\/85989722.png\" alt=\"\" \/><\/p>\n<p style=\"text-align: center;\">Tema con codigo empleando resaltado para regiones<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/img265.imageshack.us\/img265\/3416\/66771982.png\" alt=\"\" width=\"606\" height=\"465\" \/><\/p>\n<p style=\"text-align: center;\">Tema resaltando directorios y ficheros en eshell<\/p>\n<p style=\"text-align: center;\">\n<p style=\"text-align: center;\">\n","protected":false},"excerpt":{"rendered":"<p>Color-theme es un script en elisp que permite la carga de temas para emacs. Color-theme.el carga el fichero color-theme-6.6.0\/themes\/color-theme-library.el, que es el fichero que contiene los temas que no son mas que pedazos de codigo a modo de funcion unidos en un mismo fichero e interpretados por color-theme.el. Por lo tanto tendremos que cargar el [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[135,134,8],"class_list":["post-72","post","type-post","status-publish","format-standard","hentry","category-basic","tag-color-theme","tag-colortheme","tag-emacs"],"_links":{"self":[{"href":"https:\/\/www.blackhats.es\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/72"}],"collection":[{"href":"https:\/\/www.blackhats.es\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.blackhats.es\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.blackhats.es\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.blackhats.es\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=72"}],"version-history":[{"count":1,"href":"https:\/\/www.blackhats.es\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/72\/revisions"}],"predecessor-version":[{"id":774,"href":"https:\/\/www.blackhats.es\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/72\/revisions\/774"}],"wp:attachment":[{"href":"https:\/\/www.blackhats.es\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.blackhats.es\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.blackhats.es\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}