emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/dash dbbf617 281/316: Remove dead code from examples-to


From: ELPA Syncer
Subject: [elpa] externals/dash dbbf617 281/316: Remove dead code from examples-to-info.el
Date: Mon, 15 Feb 2021 15:58:17 -0500 (EST)

branch: externals/dash
commit dbbf617c28e46a950d20a0a1545f54b16c68e493
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>

    Remove dead code from examples-to-info.el
    
    * dev/examples-to-info.el (docs--chop-prefix, docs--chop-suffix)
    (github-id, function-summary): Remove unused functions.
    (function-to-node): Remove redundant conditions.
---
 dev/examples-to-info.el | 34 ++--------------------------------
 1 file changed, 2 insertions(+), 32 deletions(-)

diff --git a/dev/examples-to-info.el b/dev/examples-to-info.el
index 3b5ff9f..cecf40d 100644
--- a/dev/examples-to-info.el
+++ b/dev/examples-to-info.el
@@ -105,8 +105,8 @@ Based on `describe-function-1'."
        it t t))))
 
 (defun function-to-node (function)
-  (when (and (stringp function)
-             (string-match "^\\(### [[:upper:]][[:alpha:]- ]+\\)$" function))
+  (let ((case-fold-search nil))
+    (string-match "^\\(### [[:upper:]][[:alpha:]- ]+\\)$" function)
     (concat (s-replace "### " "* " (match-string 1 function)) "::")))
 
 (defun function-to-info (function)
@@ -128,40 +128,10 @@ Based on `describe-function-1'."
               (format-docstring docstring)
               (mapconcat 'identity (-take 3 examples) "\n")))))
 
-(defun docs--chop-prefix (prefix s)
-  "Remove PREFIX if it is at the start of S."
-  (let ((pos (length prefix)))
-    (if (and (>= (length s) (length prefix))
-             (string= prefix (substring s 0 pos)))
-        (substring s pos)
-      s)))
-
-(defun docs--chop-suffix (suffix s)
-  "Remove SUFFIX if it is at end of S."
-  (let ((pos (- (length suffix))))
-    (if (and (>= (length s) (length suffix))
-             (string= suffix (substring s pos)))
-        (substring s 0 pos)
-      s)))
-
-(defun github-id (command-name signature)
-  (docs--chop-suffix
-   "-"
-   (replace-regexp-in-string "[^a-zA-Z0-9-]+" "-" (docs--chop-prefix
-                                                   "!"
-                                                   (format "%S %S" 
command-name signature)))))
-
 (defun s-replace (old new s)
   "Replace OLD with NEW in S."
   (replace-regexp-in-string (regexp-quote old) new s t t))
 
-(defun function-summary (function)
-  (if (stringp function)
-      (concat "\n" function "\n")
-    (let ((command-name (car function))
-          (signature (cadr function)))
-      (format "* [%s](#%s) `%s`" command-name (github-id command-name 
signature) signature))))
-
 (defun simplify-quotes ()
   (goto-char (point-min))
   (while (re-search-forward (rx (or "'nil" "(quote nil)")) nil t)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]