From 0e42692dd284bec655f5c80c525c1c5ddf57db56 Mon Sep 17 00:00:00 2001 From: Jorge Araya Navarro Date: Sat, 28 Apr 2018 03:40:36 -0600 Subject: [PATCH] fix: Elimina el uso de `custom-file` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Evita desorden y la posibilidad de fallos en la configuración, aumenta el control sobre la configuración. - https://github.com/dbordak/telephone-line/issues/66 - https://github.com/felipeochoa/rjsx-mode/issues/68 --- CHANGELOG.md | 6 +++ configuracion.org | 93 +++++++++++++++++++++++++++++++++++------------ custom.el | 76 -------------------------------------- init.el | 40 +++++++++++++++----- 4 files changed, 106 insertions(+), 109 deletions(-) delete mode 100644 custom.el diff --git a/CHANGELOG.md b/CHANGELOG.md index f4a1a8a..f2ac698 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -120,6 +120,12 @@ Changes Fix ~~~ +- Elimina el uso de `custom-file` [Jorge Araya Navarro] + + Evita desorden y la posibilidad de fallos en la configuración, aumenta el control sobre la configuración. + + - https://github.com/dbordak/telephone-line/issues/66 + - https://github.com/felipeochoa/rjsx-mode/issues/68 - Comprobación mejorada de errores graves o triviales. [Jorge Araya Navarro] diff --git a/configuracion.org b/configuracion.org index 06cfabf..baead3a 100644 --- a/configuracion.org +++ b/configuracion.org @@ -98,7 +98,9 @@ La ubicación geográfica usada es la de San José, Costa Rica siendo tan peque user-mail-address "jorge@esavara.cr" calendar-location-name "Heredia, CR" calendar-latitude 9.935607 - calendar-longitude -84.1833856) + calendar-longitude -84.1833856 + calendar-christian-all-holidays-flag t + calendar-date-style 'european) #+END_SRC * Repositorio de paquetes Desde la versión 24 Emacs permite la instalación de paquetes de la misma manera como se realiza en distribuciones de GNU/Linux. @@ -486,19 +488,7 @@ Sacado de [[https://orgmode.org/worg/org-hacks.html#org34c56ba][Org ad hoc code, ad-do-it)) (ad-activate 'org-refile)) #+END_SRC -* Macros -#+BEGIN_SRC emacs-lisp - (fset 'untangle-use-packages - [?\C-s ?\( delete ?u ?s ?e ?- ?p ?a ?c ?k ?a ?g ?e prior return ?\C-\M-b ?\C- ?\C-\M-f ?\C-\M-f ?\M-x ?c ?o ?p ?y ? ?t ?o return ?p ?\C-s ?\( delete ?u ?s ?e ?- ?p ?a ?c ?k ?a ?g ?e next up return ?\C-f ?\C- ?\C-\M-f ?\M-x ?c ?o ?p ?y ? return ?n ?\C-s ?\( delete ?u ?s ?e ?- ?p ?a ?c ?k ?a ?g ?e next return ?\C-\M-b ?\C-b ?\C-c ?0 ?\C-w ?\M-x ?b ?e ?g down down down down return return ?\M-x ?b ?e down down down down return ?\C-y ?\C-s ?\( delete ?u ?s ?e ?- ?p ?a ?c ?k ?a ?g ?e prior return ?\C-\M-f return ?: ?a ?f ?t ?e ?r ? ?\( ?\M-x ?i ?n ?s ?e ?r ?t down down down return ?n ?\C-s ?\M-x ?i ?n ?s ?e ?r ?t ? ?r ?e ?g return ?p return]) -#+END_SRC -* Custom.el - El archivo customize sera éste. Cualquier modificación de Emacs que se haga a través de =customize= ira al archivo especificado. - -#+BEGIN_SRC emacs-lisp - (setf custom-file (expand-file-name "custom.el" user-emacs-directory)) - (load custom-file) -#+END_SRC -* Division de ventanas y movimiento inmediato del cursor a la nueva ventana +** Division de ventanas y movimiento inmediato del cursor a la nueva ventana Combinaciones de teclas que no pertenecen a ningún paquete en particular. #+BEGIN_SRC emacs-lisp (defun shackra-split-window-vertically () @@ -516,6 +506,17 @@ Combinaciones de teclas que no pertenecen a ningún paquete en particular. (global-set-key [remap split-window-below] #'shackra-split-window-vertically) (global-set-key [remap split-window-right] #'shackra-split-window-horizontally) #+END_SRC +* Macros +#+BEGIN_SRC emacs-lisp + (fset 'untangle-use-packages + [?\C-s ?\( delete ?u ?s ?e ?- ?p ?a ?c ?k ?a ?g ?e prior return ?\C-\M-b ?\C- ?\C-\M-f ?\C-\M-f ?\M-x ?c ?o ?p ?y ? ?t ?o return ?p ?\C-s ?\( delete ?u ?s ?e ?- ?p ?a ?c ?k ?a ?g ?e next up return ?\C-f ?\C- ?\C-\M-f ?\M-x ?c ?o ?p ?y ? return ?n ?\C-s ?\( delete ?u ?s ?e ?- ?p ?a ?c ?k ?a ?g ?e next return ?\C-\M-b ?\C-b ?\C-c ?0 ?\C-w ?\M-x ?b ?e ?g down down down down return return ?\M-x ?b ?e down down down down return ?\C-y ?\C-s ?\( delete ?u ?s ?e ?- ?p ?a ?c ?k ?a ?g ?e prior return ?\C-\M-f return ?: ?a ?f ?t ?e ?r ? ?\( ?\M-x ?i ?n ?s ?e ?r ?t down down down return ?n ?\C-s ?\M-x ?i ?n ?s ?e ?r ?t ? ?r ?e ?g return ?p return]) +#+END_SRC +* Custom.el + El archivo customize es completamente innecesario y todas las variables modificadas usando =Customize= fueron migradas. Cualquier cambio que se haga con =Customize= no será preservado *pase lo que pase*. + +#+BEGIN_SRC emacs-lisp + (setf custom-file null-device) +#+END_SRC * Aliases Nombres más cortos para comandos usados frecuentemente #+BEGIN_SRC emacs-lisp @@ -525,6 +526,16 @@ Nombres más cortos para comandos usados frecuentemente #+END_SRC * Paquetes de extensiones ** Utilidades +*** TRAMP +Transparent Remote Access, Multiple Protocols: paquete para editar archivos remotos. [[https://www.gnu.org/software/tramp/][Manual de usuario]]. +#+BEGIN_SRC emacs-lisp + (setf tramp-default-method "ssh") + (setf tramp-encoding-shell "/bin/zsh") +#+END_SRC +*** Bug hunter para configuración de Emacs +#+BEGIN_SRC emacs-lisp + (use-package bug-hunter) +#+END_SRC *** =better-defaults= configuración sana de ciertas opciones en Emacs #+BEGIN_SRC emacs-lisp @@ -558,7 +569,14 @@ Función que comprueba disponibilidad de tipografías en el sistema, además de (when (not (eq system-type 'darwin)) (set-fontset-font t 'unicode (font-spec :size 20 :name "Symbola") nil 'prepend)) #+END_SRC - +*** View large files +Permite a Emacs manejar archivos enormes. Automáticamente se activa para archivos mayores a =large-file-warning-threshold=. +#+BEGIN_SRC emacs-lisp + (use-package vlf-setup + :ensure vlf + :init + (setf vlf-application 'dont-ask)) +#+END_SRC *** secreto Saca cualquier rastro de tus archivos y datos privados de tu configuración de Emacs #+BEGIN_SRC emacs-lisp @@ -675,14 +693,12 @@ Permite tratar combinaciones de teclas como grupos... es algo difícil de explic (use-package ace-window :bind ("M-o" . shackra-other-window) :init - (custom-set-faces - '(aw-leading-char-face - ((t (:inherit ace-jump-face-foreground :height 3.0))))) (defun --count-frames () "Retorna el numero de frames visibles" (let* ((frames (if (daemonp) (butlast (visible-frame-list) 1) (visible-frame-list)))) (length frames))) :config + (defface aw-leading-char-face '(:inherit ace-jump-face-foreground :height 2.0) "ace-jump leading character size") (setf aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)) (define-key global-map [remap other-window] 'ace-window)) (use-package windmove @@ -1114,7 +1130,9 @@ Git en Emacs. A decir verdad, amo Mercurial y odio Git. Usar @@html:C-c p v magit-completing-read-function 'ivy-completing-read) (add-hook 'after-save-hook 'vc-refresh-state) (add-hook 'after-revert-hook 'vc-refresh-state) - (add-hook 'post-command-hook #'vc-state-refresh-post-command-hook)) + (add-hook 'post-command-hook #'vc-state-refresh-post-command-hook) + (setf magit-commit-arguments nil) + (setf magit-use-overlays nil)) #+END_SRC *** git-gutter-fring Muestra información de =git diff= en el fringe. @@ -1200,6 +1218,7 @@ Marcadores para varias cosas en Emacs, asociado a @@html:M-p@@ :ensure nil :init (setf bookmark-default-file "~/.emacs.d/bookmarks") + (setf bmkp-last-as-first-bookmark-file bookmark-default-file) (setf bookmark-save-flag 1)) (use-package bookmark+ @@ -1604,10 +1623,11 @@ Conexión a Weechat desde Emacs #+END_SRC *** Redmine #+BEGIN_SRC emacs-lisp + (with-eval-after-load 'auth-source + (setf auth-source-save-behavior nil)) (when (boundp 'auth-sources) (use-package org-redmine :init - (setq org-redmine-uri "https://my.ivrtechnology.com") (setq org-redmine-auth-netrc-use t))) #+END_SRC ** Desarrollo de software @@ -1767,6 +1787,21 @@ Teclas ("ESPERA" :foreground "orange" :weight bold) ("RETENER" :foreground "magenta" :weight bold) ("CANCELADO" :foreground "forest green" :weight bold))) + (setf org-catch-invisible-edits 'show) + (setf org-clock-persist 'history) + (setf org-ctrl-k-protect-subtree t) + (setf org-export-backends '(ascii html icalendar latex md texinfo)) + (setf org-fontify-quote-and-verse-blocks t) + (setf org-footnote-auto-adjust t) + (setf org-habit-graph-column 55) + (setf org-imenu-depth 5) + (setf org-log-done 'time) + (setf org-modules '(org-bbdb org-bibtex org-crypt org-docview + org-gnus org-habit org-id org-info + org-irc org-mhe org-rmail org-w3m)) + (setf org-special-ctrl-k t) + (setf org-startup-folded nil) + (setf org-startup-indented t) (setf org-use-fast-todo-selection t) (setf org-treat-S-cursor-todo-selection-as-state-change nil) (setf org-todo-state-tags-triggers @@ -2006,6 +2041,7 @@ Modo mayor para programar en Python (shackra-electric-indent-mode-off) (aggressive-indent-mode -1)) + (setf python-shell-interpreter "python") (add-hook 'python-mode-hook #'shackra-python-mode) :config ;; re-mapea todas los atajos que hagan referencia a `python-indent-shift-*' con `shackra-python-indent-shift-*' @@ -2186,6 +2222,8 @@ Un modo mayor para editar paginas web (isrootfile (string-suffix-p httpd-root currentfiledir))) (when (and (derived-mode-p 'sgml-mode 'css-mode 'web-mode 'js2-mode) isrootfile (shackra-port-open-p moz-repl-host moz-repl-port)) (moz-controller-page-refresh)))) + :init + (setf web-mode-code-indent-offset 2) :config (add-hook 'after-save-hook #'shackra-webdev-refresh-page-on-save) (add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode)) @@ -2406,8 +2444,9 @@ Instalar estos componentes en el sistema operativo (tide-setup) (tide-hl-identifier-mode +1)) (setf tide-format-options - '(:insertSpaceAfterFunctionKeywordForAnonymousFunctions t :placeOpenBraceOnNewLineForFunctions nil)) + '(:indentSize 2 :tabSize: 2 :insertSpaceAfterFunctionKeywordForAnonymousFunctions t :placeOpenBraceOnNewLineForFunctions nil)) (setf tide-tsserver-process-environment '("TSS_LOG=-level verbose -file /tmp/tss.log")) + (setf typescript-indent-level 2) (add-hook 'before-save-hook 'tide-format-before-save) ;; Añade company-tide como fuente de auto-completado para varios modos ;; mayores que lidian con JavaScript/Typescript @@ -2451,6 +2490,8 @@ Instalar estos componentes en el sistema operativo :init (add-to-list 'auto-mode-alist '("components?\\/.*\\.js\\'" . rjsx-mode)) (add-to-list 'auto-mode-alist '("containers?\\/.*\\.js\\'" . rjsx-mode)) + ;; TODO: Eliminar cuando el bug sea resuelto https://github.com/felipeochoa/rjsx-mode/issues/68 + (add-hook 'rjsx-mode-hook (lambda () (flyspell-mode-off))) :config ;; tomado de https://emacs.stackexchange.com/a/33544/690 mejora el sangrado ;; de lineas @@ -2489,7 +2530,8 @@ Instalar estos componentes en el sistema operativo Desarrollo de aplicaciones para Android desde GNU Emacs #+BEGIN_SRC emacs-lisp (use-package android-mode - :init (custom-set-variables '(android-mode-sdk-dir "~/opt/android"))) + :init + (setf android-mode-sdk-dir "~/opt/android")) #+END_SRC *** SLIME SLIME is the Superior Lisp Interaction Mode for Emacs. @@ -3286,6 +3328,7 @@ Muestra imágenes de emojis en lugar de los caracteres utf-8 ;; Este paquete sólo funciona si la versión de Emacs es mayor o igual a 24.3 ;; y Emacs fue compilado con soporte para PNG :if (and (version<= "24.3" emacs-version) (image-type-available-p 'png)) + :bind (:map global-map ("C-!" . emojify-insert-emoji)) :init (add-hook 'after-init-hook #'global-emojify-mode)) (use-package company-emoji @@ -3417,6 +3460,10 @@ Utilidades para integrar Emacs y docker (setf realgud:ipdb-command-name "python -c \"from IPython import start_ipython; from sys import argv; start_ipython(['--simple-prompt', '-i', '-c', '%run -d {}'.format(' '.join(argv[1:]))])\"")) #+END_SRC *** Temas +Establece cuales temás son seguros. +#+BEGIN_SRC emacs-lisp + (setf custom-safe-themes '("f1a6cbc40528dbee63390fc81da426f1b00b4fc09a60fe35752f5838b12fbe0a" "51867fa64534ff7ca87fdc1537fbfffc168fa4673e3980850436dc87e31ef426" "3119b66b441eaa36acad473952dfdf901a5924b1fbc995b58477f031e12547c4" "f0b0710b7e1260ead8f7808b3ee13c3bb38d45564e369cbe15fc6d312f0cd7a0" "a27c00821ccfd5a78b01e4f35dc056706dd9ede09a8b90c6955ae6a390eb1c1e" "8aebf25556399b58091e533e455dd50a6a9cba958cc4ebb0aab175863c25b9a4" "d677ef584c6dfc0697901a44b885cc18e206f05114c8a3b7fde674fce6180879" "a8245b7cc985a0610d71f9852e9f2767ad1b852c2bdea6f4aadc12cce9c4d6d0" "3c83b3676d796422704082049fc38b6966bcad960f896669dfc21a7a37a748fa" "c74e83f8aa4c78a121b52146eadb792c9facc5b1f02c917e3dbb454fca931223" "134f38000f413a88743764983c751ac34edbec75a602065e2ae3b87fcf26c451" "930a202ae41cb4417a89bc3a6f969ebb7fcea5ffa9df6e7313df4f7a2a631434" "c5a044ba03d43a725bd79700087dea813abcb6beb6be08c7eb3303ed90782482" "9dae95cdbed1505d45322ef8b5aa90ccb6cb59e0ff26fef0b8f411dfc416c552" "3a727bdc09a7a141e58925258b6e873c65ccf393b2240c51553098ca93957723" "6a37be365d1d95fad2f4d185e51928c789ef7a4ccf17e7ca13ad63a8bf5b922f" default)) +#+END_SRC **** CANCELADO zenburn :CANCELADO: - State "CANCELADO" from [2018-03-28 mié 02:06] \\ desactiva el tema @@ -3426,7 +3473,7 @@ Utilidades para integrar Emacs y docker :config (load-theme 'zenburn t)) #+END_SRC -**** Monokai :CANCELADO: +**** Monokai - State "CANCELADO" from "CANCELADO" [2018-03-28 mié 17:25] - State "CANCELADO" from [2018-03-28 mié 16:55] \\ desactiva el tema diff --git a/custom.el b/custom.el deleted file mode 100644 index 20c0357..0000000 --- a/custom.el +++ /dev/null @@ -1,76 +0,0 @@ -(put 'upcase-region 'disabled nil) -(custom-set-variables - ;; custom-set-variables was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(android-mode-sdk-dir "~/opt/android") - '(auth-source-save-behavior nil) - '(bmkp-last-as-first-bookmark-file "~/.emacs.d/bookmarks" t) - '(byte-compile-warnings nil) - '(calendar-christian-all-holidays-flag t) - '(calendar-date-style (quote european)) - '(custom-safe-themes - (quote - ("f1a6cbc40528dbee63390fc81da426f1b00b4fc09a60fe35752f5838b12fbe0a" "51867fa64534ff7ca87fdc1537fbfffc168fa4673e3980850436dc87e31ef426" "3119b66b441eaa36acad473952dfdf901a5924b1fbc995b58477f031e12547c4" "f0b0710b7e1260ead8f7808b3ee13c3bb38d45564e369cbe15fc6d312f0cd7a0" "a27c00821ccfd5a78b01e4f35dc056706dd9ede09a8b90c6955ae6a390eb1c1e" "8aebf25556399b58091e533e455dd50a6a9cba958cc4ebb0aab175863c25b9a4" "d677ef584c6dfc0697901a44b885cc18e206f05114c8a3b7fde674fce6180879" "a8245b7cc985a0610d71f9852e9f2767ad1b852c2bdea6f4aadc12cce9c4d6d0" "3c83b3676d796422704082049fc38b6966bcad960f896669dfc21a7a37a748fa" "c74e83f8aa4c78a121b52146eadb792c9facc5b1f02c917e3dbb454fca931223" "134f38000f413a88743764983c751ac34edbec75a602065e2ae3b87fcf26c451" "930a202ae41cb4417a89bc3a6f969ebb7fcea5ffa9df6e7313df4f7a2a631434" "c5a044ba03d43a725bd79700087dea813abcb6beb6be08c7eb3303ed90782482" "9dae95cdbed1505d45322ef8b5aa90ccb6cb59e0ff26fef0b8f411dfc416c552" "3a727bdc09a7a141e58925258b6e873c65ccf393b2240c51553098ca93957723" "6a37be365d1d95fad2f4d185e51928c789ef7a4ccf17e7ca13ad63a8bf5b922f" default))) - '(helm-completing-read-handlers-alist - (quote - ((describe-function . helm-completing-read-symbols) - (describe-variable . helm-completing-read-symbols) - (describe-symbol . helm-completing-read-symbols) - (debug-on-entry . helm-completing-read-symbols) - (find-function . helm-completing-read-symbols) - (disassemble . helm-completing-read-symbols) - (trace-function . helm-completing-read-symbols) - (trace-function-foreground . helm-completing-read-symbols) - (trace-function-background . helm-completing-read-symbols) - (find-tag . helm-completing-read-with-cands-in-buffer) - (ffap-alternate-file) - (tmm-menubar) - (execute-extended-command)))) - '(hl-sexp-background-color "#1c1f26") - '(lui-formatting-list - (quote - (("\\(?:\\(?:^\\|[ ]\\)\\*\\([^ *]\\(?:[ ]+[^ *]+\\)*\\)\\*\\(?:$\\|[ ]\\)\\)" 1 - (quote lui-strong-face)) - ("\\(?:\\(?:^\\|[ ]\\)_\\([^ *]\\(?:[ ]+[^ *]+\\)*\\)_\\(?:$\\|[ ]\\)\\)" 1 - (quote lui-emphasis-face))))) - '(magit-commit-arguments nil) - '(magit-use-overlays nil) - '(org-babel-load-languages (quote ((ledger . t) (python . t) (emacs-lisp . t)))) - '(org-catch-invisible-edits (quote show)) - '(org-clock-persist (quote history)) - '(org-ctrl-k-protect-subtree t) - '(org-export-backends (quote (ascii html icalendar latex md texinfo))) - '(org-fontify-quote-and-verse-blocks t) - '(org-footnote-auto-adjust t) - '(org-habit-graph-column 55) - '(org-imenu-depth 5) - '(org-log-done (quote time)) - '(org-modules - (quote - (org-bbdb org-bibtex org-crypt org-docview org-gnus org-habit org-id org-info org-irc org-mhe org-rmail org-w3m))) - '(org-special-ctrl-k t) - '(org-startup-folded nil) - '(org-startup-indented t) - '(org-todo-keywords - (quote - ((sequence "POR-HACER(p)" "EN-PROGRESO(g)" "EN-ESPERA(e@/!)" "EN-REVISIÓN(r@/!)" "|" "CANCELADO(c@)" "TERMINADO(t!)")))) - '(package-selected-packages - (quote - (yasnippet projectile monokai-theme lsp-vue vue-mode org-plus-contrib counsel-notmuch notmuch-labeler org-bullets org-beautify-theme zenburn-theme undo-tree keyfreq dired-details+ ranger windresize ace-window ivy-hydra tern virtualenvwrapper counsel counsel-projectile switch-buffer-functions realgud meghanada org-redmine slack org-download multiple-cursors gimp-mode yapfify importmagic dockerfile-mode docker-compose-mode docker isortify pippel noflet org2web json-mode xref-js2 ng2-mode kotlin-mode gradle-mode flycheck-kotlin kotlin ox-gfm el2org chronos pkgbuild-mode free-keys company-emoji emojify pdf-tools shackle mingus ws-butler elfeed golden-ratio aurel pretty-mode systemd alert vimish-fold telephone-line all-the-icons fixmee mustache-mode golden-ratio-scroll-screen move-text paredit aggressive-indent hungry-delete visual-fill-column pcre2el flycheck-package flyspell-correct-ivy scss-mode stylus-mode slime android-mode indium js2-refactor company-tern flycheck-gometalinter go-guru godoctor go-snippets go-eldoc company-go go-mode php-mode php-refactor-mode web-beautify web-mode ac-html-bootstrap company-web emmet-mode python-environment flycheck-rust company-racer racer cargo yaml-mode toml-mode traad pony-mode company-anaconda py-autopep8 pyvenv org-trello org-projectile rainbow-mode highlight-escape-sequences highlight-numbers weechat org-webpage sx iedit moz-controller bookmark+ imenu-anywhere kill-or-bury-alive hgignore-mode monky git-gutter-fringe magit-gh-pulls gitconfig-mode gitignore-mode multi-term ag company-auctex company-quickhelp company-statistics company nlinum feature-mode prodigy pydoc-info sphinx-doc tide expand-region font-lock-studio webpaste highlight-indent-guides el-pocket twittering-mode better-defaults use-package org))) - '(py-autopep8-options nil) - '(python-shell-interpreter "python") - '(pyvenv-virtualenvwrapper-python "python") - '(tramp-default-method "ssh") - '(tramp-encoding-shell "/bin/bash") - '(vr/default-replace-preview t)) -(custom-set-faces - ;; custom-set-faces was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(aw-leading-char-face ((t (:inherit ace-jump-face-foreground :height 3.0)))) - '(mode-line ((t (:box nil)))) - '(mode-line-highlight ((t (:box nil)))) - '(mode-line-inactive ((t (:box nil))))) diff --git a/init.el b/init.el index fcad750..0a5cfe4 100644 --- a/init.el +++ b/init.el @@ -10,23 +10,43 @@ (setq package-enable-at-startup nil) ;; Ask package.el to not add (package-initialize) to .emacs. (setq package--init-file-ensured t) -;; https://www.gnu.org/software/emacs/manual/html_node/elisp/Packaging-Basics.html -(package-initialize nil) +(setf byte-compile-warnings nil) ;; repositorios de paquetes -(setf package-archives '(("melpa" . "https://melpa.org/packages/") +(setf package-archives '(("melpa" . "https://melpa.org/packages/") ("melpa-stable" . "https://stable.melpa.org/packages/") - ("gnu" . "https://elpa.gnu.org/packages/") - ("org" . "https://orgmode.org/elpa/"))) + ("gnu" . "https://elpa.gnu.org/packages/") + ("org" . "https://orgmode.org/elpa/"))) (setq inhibit-startup-screen t) ;; :pin no funciona en use-package por el momento, entonces si deseamos que se ;; instale un paquete desde el repositorio que queremos debemos especificarlo ;; aqui antes de que use-package sea inicializado -(setq package-pinned-packages '((auctex . "gnu") - (python . "gnu") +(setq package-pinned-packages '((auctex . "gnu") + (python . "gnu") (use-package . "melpa-stable"))) +(setf package-selected-packages '(ac-html-bootstrap ace-window ag aggressive-indent alert all-the-icons android-mode aurel better-defaults bookmark+ bug-hunter cargo chronos company company-anaconda company-auctex company-emoji company-go company-quickhelp company-racer company-statistics company-tern company-web counsel counsel-notmuch counsel-projectile dired-details+ docker docker-compose-mode dockerfile-mode el-pocket el2org elfeed emmet-mode emojify expand-region feature-mode fixmee flycheck-gometalinter flycheck-kotlin flycheck-package flycheck-rust flyspell-correct-ivy font-lock-studio free-keys gimp-mode git-gutter-fringe gitconfig-mode gitignore-mode go-eldoc go-guru go-mode go-snippets godoctor golden-ratio golden-ratio-scroll-screen gradle-mode hgignore-mode highlight-escape-sequences highlight-indent-guides highlight-numbers hungry-delete iedit imenu-anywhere importmagic indium isortify ivy-hydra js2-refactor json-mode keyfreq kill-or-bury-alive kotlin kotlin-mode lsp-vue magit-gh-pulls meghanada mingus monky monokai-theme move-text moz-controller multi-term multiple-cursors mustache-mode ng2-mode nlinum noflet notmuch-labeler org-beautify-theme org-bullets org-download org-projectile org-redmine org-trello org-webpage org2web ox-gfm paredit pcre2el php-mode php-refactor-mode pippel pkgbuild-mode pony-mode pretty-mode prodigy projectile py-autopep8 pydoc-info python-environment pyvenv racer rainbow-mode ranger realgud rjsx-mode scss-mode shackle slime sphinx-doc stylus-mode switch-buffer-functions sx systemd telephone-line tern tide toml-mode traad twittering-mode undo-tree use-package vimish-fold virtualenvwrapper visual-fill-column vlf vue-mode web-beautify web-mode webpaste weechat windresize ws-butler xref-js2 yaml-mode yapfify yasnippet zenburn-theme)) + +(defun package--save-selected-packages (&optional value) + "Set and save `package-selected-packages' to VALUE. + +The variable is saved on ~/.emacs.d/init.el and its content is ordered alphabetically." + (when value + (setq package-selected-packages value)) + ;; Sort alphabetically all symbols of package-selected-packages + (setf package-selected-packages (map 'list 'intern (cl-sort (map 'list 'symbol-name package-selected-packages) 'string-lessp))) + (if after-init-time + (let ((save-silently inhibit-message)) + ;; save the content of package-selected-packages + (with-current-buffer (find-file-noselect "~/.emacs.d/init.el") + (search-forward "package-selected-packages") + (delete-region (point-at-bol) (point-at-eol)) + (insert (format "(setf package-selected-packages '%s)" package-selected-packages)) + (save-buffer) + (kill-buffer))) + (add-hook 'after-init-hook #'package--save-selected-packages))) + (defun my-tangle-section-canceled () "Checks if the previous section header was CANC" (save-excursion @@ -66,8 +86,8 @@ (body (match-string 5)) (canc (my-tangle-section-canceled))) (when (and (string= lang "emacs-lisp") - (not (string-match-p ":tangle\\s-+no" args)) - (not canc)) + (not (string-match-p ":tangle\\s-+no" args)) + (not canc)) (add-to-list 'body-list body))))) (with-temp-file elfile (insert (format ";; No edite este archivo, en su lugar edite %s ...\n\n" orgfile)) @@ -82,7 +102,7 @@ (elfile (concat user-emacs-directory "configuracion.el")) (gc-cons-threshold most-positive-fixnum)) (when (or (not (file-exists-p elfile)) - (file-newer-than-file-p orgfile elfile)) + (file-newer-than-file-p orgfile elfile)) (my-tangle-config-org orgfile elfile)) (load-file elfile) ;; Solo al final inicializamos los paquetes