diff --git a/lisp/apps/elfeed.el b/lisp/apps/elfeed.el index 90572fd..2c5c354 100644 --- a/lisp/apps/elfeed.el +++ b/lisp/apps/elfeed.el @@ -11,13 +11,14 @@ (user/bind-key-global :apps :feed-reader 'elfeed) :config (setq elfeed-feeds - '("http://blog.python.org/feeds/posts/default" - "https://blog.finxter.com/feed" - "https://planetpython.org/rss20.xml" + '("http://blog.python.org/feeds/posts/default" + "https://blog.finxter.com/feed" + "https://planet.emacslife.com/atom.xml" + "https://planetpython.org/rss20.xml" "http://www.reddit.com/r/emacs/.rss" - "https://sachachua.com/blog/category/emacs-news/feed" - "http://linuxfr.org/journaux.atom" - ))) + "http://linuxfr.org/journaux.atom" + "https://xkcd.com/atom.xml" + ))) (provide 'apps/elfeed) diff --git a/lisp/modes/c-c++.el b/lisp/modes/c-c++.el index de3f376..7f2876e 100644 --- a/lisp/modes/c-c++.el +++ b/lisp/modes/c-c++.el @@ -4,13 +4,14 @@ (require 'cl) (require 'lsp) +(require 'cc-vars) +(require 'flycheck) (defun user--c-format-before-save () "C/C++ cleanup and format before save buffer." (delete-trailing-whitespace) ;; Format buffer. - (indent-region (point-min) (point-max) nil) - ) + (indent-region (point-min) (point-max) nil)) ;; From https://www.emacswiki.org/emacs/CompileCommand (defun* user--c-get-closest-pathname (&optional (file "Makefile")) @@ -31,10 +32,13 @@ of FILE in the current directory, suitable for creation" (defun user--c-mode-common-hook () "C-like languages mode hook." + (message "user--c-mode-common-hook BEG") + (add-many-to-list 'c-default-style '(c-mode . "bsd") '(c++-mode . "bsd")) - (setq tab-width 4) - + (setq-local tab-width 4) + (setq-local c-basic-offset 4) + ;; Propertize "#if 0" regions as comments. (font-lock-add-keywords nil @@ -47,7 +51,7 @@ of FILE in the current directory, suitable for creation" (format "make -C %s" (directory-file-name (file-name-directory (user--c-get-closest-pathname))))) ;; Avoid to hit enter after compile-command to build. (setq compilation-read-command nil) - + ;; Separate camel-case into separate words. (subword-mode t) @@ -56,11 +60,14 @@ of FILE in the current directory, suitable for creation" (paren-toggle-open-paren-context t)) (setq flycheck-checker-error-threshold 1000) - + (setq flycheck-local-checkers '((lsp . ((next-checkers . (flawfinder)))))) ;; (flycheck-add-next-checker 'clang-analyzer 'flawfinder) - (user/smartparens-enable)) + (user/smartparens-enable) + + (message "user--c-mode-common-hook END") + ) (defun user/c-mode-font-lock-if0 (limit) "Propertize '#if 0' regions, up to LIMIT in size, as comments." @@ -100,7 +107,7 @@ of FILE in the current directory, suitable for creation" (c-mode-common-hook . hs-minor-mode) (c-mode-common-hook . lsp-deferred) (c-mode-common-hook . (lambda () - (add-hook 'before-save-hook #'user--c-format-before-save nil t))) + (add-hook 'before-save-hook #'user--c-format-before-save nil t))) :init ;; Detect if inside a C++ header file. (add-magic-mode 'c++-mode 'user/c++-header-file-p) @@ -112,7 +119,6 @@ of FILE in the current directory, suitable for creation" ;; https://github.com/emacs-mirror/emacs/blob/master/lisp/progmodes/cc-vars.el ;; user customization variables for CC Mod (use-package cc-vars - :disabled :ensure cc-mode :config (validate-setq @@ -146,7 +152,7 @@ of FILE in the current directory, suitable for creation" (validate-setq ccls-initialization-options '(:index (:comments 1) :cacheFormat "msgpack"))) - + ;; https://github.com/alexmurray/flycheck-flawfinder ;; Integrate flawfinder with flycheck to automatically check for possible security weaknesses ;; within your C/C++ code on the fly. diff --git a/lisp/modes/python.el b/lisp/modes/python.el index e8dfe6e..bc69e65 100644 --- a/lisp/modes/python.el +++ b/lisp/modes/python.el @@ -6,26 +6,16 @@ (defun user--python-format-before-save () "Python cleanup and format before save buffer." (lsp-format-buffer) - (delete-trailing-whitespace) -) + (delete-trailing-whitespace)) (defun user--python-mode-hook () "Python mode hook." - ;; lsp python customization (lsp-register-custom-settings '(("pylsp.plugins.pyls_mypy.enabled" t t) - ;; ("pylsp.plugins.flake8.maxLineLength" 120) - ;; ("pylsp.plugins.pycodestyle.maxLineLength" 120) + ("pylsp.plugins.flake8.maxLineLength" 100) ("pylsp.plugins.yapf.enabled" t t) ("pylsp.plugins.pylint.enabled" t t))) - ;; ("pyls.plugins.pyls_mypy.live_mode" nil t) - ;; ("pyls.plugins.pyls_black.enabled" t t) - ;; ("pyls.plugins.pyls_isort.enabled" t t) - ;; ("pyls.plugins.flake8.enabled" t t))) - - (setq lsp-pylsp-plugins-flake8-max-line-length 120) - (setq lsp-pylsp-plugins-pycodestyle-max-line-length 120) ;; Enable virtualenv support. (when(feature-p 'pyvenv) @@ -41,30 +31,7 @@ (subword-mode t) ;; ElDoc shows function documentation as you type - (eldoc-mode t) - - ;; Select pylint for ckecing - ;; (setq flycheck-checker nil) - ;; (setq-default flycheck-disabled-checkers '(lsp)) - ;; (flycheck-add-mode 'python-flake8 'python-mode) - ;; (flycheck-select-checker 'python-pycheckers) - - ;; (flycheck-add-next-checker 'lsp 'python-pycheckers) - - ;; (setq-local lsp-pylsp-plugins-pylint-enabled nil) - - ;; (with-eval-after-load "lsp-mode" - ;; (add-to-list 'lsp-disabled-clients 'pyls) - ;; (add-to-list 'lsp-enabled-clients 'pylsp)) - - ;; (Bindings) ;; - ;; (when(feature-p 'nose) - ;; (user/bind-key-local: code: test 'nosetests-all)) - ;; (when(feature-p 'pyvenv) - ;; (user/bind-key-local: code: virtual 'pyvenv-workon)) - ;; (when(feature-p 'lsp-pyright) - ;; (require 'lsp-pyright))) -) + (eldoc-mode t)) (use-package python :if (executable-find "python") @@ -90,7 +57,6 @@ python-shell-prompt-regexp "In \\[[0-9]+\\]: " python-shell-prompt-output-regexp "Out\\[[0-9]+\\]: " python-shell-completion-setup-code "from IPython.core.completerlib import module_completion" - python-shell-completion-module-string-code "';'.join(module_completion('''%s'''))\n" python-shell-completion-string-code "';'.join(get_ipython().Completer.all_completions('''%s'''))\n")) (with-executable 'bpython