From 87e0fb1b74cfb28247ab28725f60f0aa5ed6c7c1 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Sun, 22 Oct 2023 06:44:15 +0200 Subject: [PATCH] Remove the python-add-docstring function --- configuration.org | 56 ----------------------------------------------- 1 file changed, 56 deletions(-) diff --git a/configuration.org b/configuration.org index fd522f9..1283355 100644 --- a/configuration.org +++ b/configuration.org @@ -742,22 +742,6 @@ To temporarily hide the mode line. ** Programming related -*** Check if we are inside a string - -#+BEGIN_SRC emacs-lisp -(defun gpolonkai/prog-in-string-p () - "Return t if point is inside a string." - (nth 3 (syntax-ppss))) -#+END_SRC - -*** Check if we are inside a comment - -#+BEGIN_SRC emacs-lisp -(defun gpolonkai/prog-in-comment-p () - "Return t if point is inside a comment." - (nth 4 (syntax-ppss))) -#+END_SRC - *** Add code references to Org documents :PROPERTIES: :SOURCE: http://www.howardism.org/Technical/Emacs/capturing-content.html @@ -799,46 +783,6 @@ and a backlink to the function and the file." (ha/org-capture-fileref-snippet f "SRC" org-src-mode func-name)))) #+END_SRC -** ~python-mode~ related - -*** Add a docstring to the current thing - -…be it a function, class, or a module - -#+BEGIN_SRC emacs-lisp -(defun gpolonkai/python-add-docstring () - "Add a Python docstring to the current thing. - -If point is inside a function, add docstring to that. If point -is in a class, add docstring to that. If neither, add docstring -to the beginning of the file." - (interactive) - (save-restriction - (widen) - (beginning-of-defun) - (if (not (looking-at-p "\\(def\\|class\\) ")) - (progn - (goto-char (point-min)) - (back-to-indentation) - (forward-char) - (while (gpolonkai/prog-in-comment-p) - (forward-line) - (back-to-indentation) - (forward-char))) - (search-forward ":") - (while (or (gpolonkai/prog-in-string-p) - (gpolonkai/prog-in-comment-p)) - (search-forward ":"))) - (if (eq 1 (count-lines 1 (point))) - (open-line-above) - (open-line-below)) - (insert "\"\"\"") - (let ((point-pos (point))) - (open-line-below) - (insert "\"\"\"\n") - (goto-char point-pos)))) -#+END_SRC - ** Jinja related *** Mark a string as translatable