summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2023-12-10 00:09:19 -0500
committerKyle Meyer <kyle@kyleam.com>2024-01-21 21:47:59 -0500
commitb2b0f0721a503c4e2e17cc981f49e701eb9e09d3 (patch)
tree9d717a90a4d32095701948b5d8baa55631c4d5c7
parentf101cdb35a81cd04aae8c4aaba736b2ea1dfacf4 (diff)
downloademacs.d-b2b0f0721a503c4e2e17cc981f49e701eb9e09d3.tar.gz
Drop pydoc-related bits
I haven't used this in a long time.
-rw-r--r--init.el16
-rw-r--r--lisp/km-python.el60
2 files changed, 1 insertions, 75 deletions
diff --git a/init.el b/init.el
index 3a20e51..e495cbb 100644
--- a/init.el
+++ b/init.el
@@ -1910,15 +1910,7 @@
(require 'km-python))
-(use-package pydoc
- :load-path "~/src/emacs/pydoc/"
- :config
- (setq pydoc-make-method-buttons nil)
- ;; Don't shadow my `ace-link' binding.
- (define-key pydoc-mode-map "o" #'ace-link-help))
-
(use-package km-python
- :bind ("C-h y" . km/pydoc)
:init
(bind-keys :map km/python-prefix-map
("c" . km/python-copy-last-shell-line-as-comment)
@@ -1934,11 +1926,7 @@
(lambda ()
(add-hook
'post-self-insert-hook
- #'km/python-indent-post-self-insert-function 'append 'local)))
-
- (add-hook 'pydoc-after-finish-hook #'km/pydoc-store-name)
- (when (file-exists-p km/pydoc-names-file)
- (km/pydoc-read-names-file km/pydoc-names-file)))
+ #'km/python-indent-post-self-insert-function 'append 'local))))
(use-package snakemake-mode
:load-path "~/src/emacs/snakemake-mode/"
@@ -2311,8 +2299,6 @@
;; Remove all mail map bindings except notmuch-related ones.
(global-set-key (kbd "C-x m n") #'notmuch)
(global-set-key (kbd "C-x m .") #'km/notmuch-show-at-point)
- (with-eval-after-load 'km-python
- (add-hook 'kill-emacs-hook #'km/pydoc-save-names-file))
(savehist-mode 1)
(setq save-abbrevs 'silently
bookmark-save-flag 1)
diff --git a/lisp/km-python.el b/lisp/km-python.el
index 5f50131..339e8be 100644
--- a/lisp/km-python.el
+++ b/lisp/km-python.el
@@ -203,65 +203,5 @@ being turned on."
(when (< (current-indentation) indentation)
(indent-line-to indentation))))))
-
-;;; Pydoc
-
-(require 'pydoc)
-
-(defvar km/pydoc-names nil
- "List of names that have been sucessfully loaded by `pydoc'.")
-
-(defvar km/pydoc-names-file "~/.emacs.d/.pydoc-names"
- "File to save `km/pydoc-names' to.")
-
-;;;###autoload
-(defun km/pydoc ()
- "Run `pydoc', prompting with `km/pydoc-names'."
- (interactive)
- (let* ((default-directory "~/")
- (initial-name (and (use-region-p)
- (buffer-substring-no-properties
- (region-beginning)
- (region-end))))
- (name (completing-read "Name: " km/pydoc-names nil nil
- initial-name)))
- (pydoc name)))
-
-(defun km/pydoc-store-name ()
- "Store the name for the current pydoc object."
- (with-current-buffer (pydoc-buffer)
- (unless (eq (plist-get pydoc-info :type) 'not-found)
- (cl-pushnew (substring-no-properties (car (cdr help-xref-stack-item)))
- km/pydoc-names
- :test #'string=))))
-
-(defun km/pydoc-save-names-file (&optional file)
- "Save `km/pydoc-names' to FILE.
-FILE is `km/pydoc-names-file' by default."
- (interactive
- (list
- (read-file-name (format "Save file (default %s): "
- km/pydoc-names-file)
- nil km/pydoc-names-file t)))
- (setq file (or file km/pydoc-names-file))
- (when (file-writable-p file)
- (with-temp-file file
- (let (print-length)
- (print (sort km/pydoc-names #'string-lessp)
- (current-buffer))))))
-
-;;;###autoload
-(defun km/pydoc-read-names-file (&optional file)
- "Read `km/pydoc-names-file' from FILE.
-FILE is `km/pydoc-names-file' by default."
- (interactive
- (list
- (read-file-name (format "Read file (default %s): "
- km/pydoc-names-file)
- nil km/pydoc-names-file t)))
- (with-temp-buffer
- (insert-file-contents (or file km/pydoc-names-file))
- (setq km/pydoc-names (read (current-buffer)))))
-
(provide 'km-python)
;;; km-python.el ends here