emacs-diffs
[Top][All Lists]
Advanced

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

master 7d0dc31: * lisp/org/: Delete some always-nil variables


From: Stefan Monnier
Subject: master 7d0dc31: * lisp/org/: Delete some always-nil variables
Date: Thu, 11 Mar 2021 13:07:41 -0500 (EST)

branch: master
commit 7d0dc31833d471a6f86e947d3165d3fd1452a184
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * lisp/org/: Delete some always-nil variables
    
    * lisp/org/ob-lilypond.el (org-babel-lilypond-compile-lilyfile):
    Remove always-nil variable `arg-2`.
    
    * lisp/org/ol-gnus.el (org-gnus-store-link):
    Remove always-nil variables `newsgroup` and `xarchive`.
    
    * lisp/org/ol.el (org-store-link):
    Remove always-nil variable `description`.
    
    * lisp/org/org-clock.el (org-clock-special-range):
    Remove always-nil variables `m1` and `m`.
    
    * lisp/org/org-crypt.el (org--matcher-tags-todo-only): Declare var.
    
    * lisp/org/org-protocol.el (org-protocol-open-source):
    Remove always-nil variable `result`.
    
    * lisp/org/ox-odt.el (org-odt-format-label):
    Remove always-nil variable `short-caption`.
    (org-odt-link--inline-formula):
    Remove always-nil variables `width` and `height`.
    
    * lisp/org/ox.el (org-export--missing-definitions):
    Remove always-nil variable `seen`.
---
 lisp/org/ob-lilypond.el  |  6 +++---
 lisp/org/ol-gnus.el      |  4 ++--
 lisp/org/ol.el           |  4 ++--
 lisp/org/org-clock.el    |  8 ++++----
 lisp/org/org-crypt.el    |  2 ++
 lisp/org/org-protocol.el |  4 ++--
 lisp/org/ox-odt.el       | 11 ++++++-----
 lisp/org/ox.el           |  4 ++--
 8 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/lisp/org/ob-lilypond.el b/lisp/org/ob-lilypond.el
index fbdd905..47397e6 100644
--- a/lisp/org/ob-lilypond.el
+++ b/lisp/org/ob-lilypond.el
@@ -220,7 +220,7 @@ If error in compilation, attempt to mark the error in 
lilypond org file."
 FILE-NAME is full path to lilypond (.ly) file."
   (message "Compiling LilyPond...")
   (let ((arg-1 org-babel-lilypond-ly-command) ;program
-        (arg-2 nil)                    ;infile
+        ;; (arg-2 nil)                    ;infile
         (arg-3 "*lilypond*")           ;buffer
        (arg-4 t)                      ;display
        (arg-5 (if org-babel-lilypond-gen-png  "--png"  "")) ;&rest...
@@ -231,10 +231,10 @@ FILE-NAME is full path to lilypond (.ly) file."
         (arg-10 (concat "--output=" (file-name-sans-extension file-name)))
         (arg-11 file-name))
     (if test
-        `(,arg-1 ,arg-2 ,arg-3 ,arg-4 ,arg-5 ,arg-6
+        `(,arg-1 ,nil ,arg-3 ,arg-4 ,arg-5 ,arg-6 ;; arg-2
                  ,arg-7 ,arg-8 ,arg-9 ,arg-10 ,arg-11)
       (call-process
-       arg-1 arg-2 arg-3 arg-4 arg-5 arg-6
+       arg-1 nil arg-3 arg-4 arg-5 arg-6 ;; arg-2
        arg-7 arg-8 arg-9 arg-10 arg-11))))
 
 (defun org-babel-lilypond-check-for-compile-error (file-name &optional test)
diff --git a/lisp/org/ol-gnus.el b/lisp/org/ol-gnus.el
index 71051bc..2d51447 100644
--- a/lisp/org/ol-gnus.el
+++ b/lisp/org/ol-gnus.el
@@ -198,11 +198,11 @@ If `org-store-link' was called with a prefix arg the 
meaning of
               (to (mail-fetch-field "To"))
               (from (mail-fetch-field "From"))
               (subject (mail-fetch-field "Subject"))
-              newsgroup xarchive)      ;those are always nil for gcc
+              ) ;; newsgroup xarchive  ;those are always nil for gcc
           (unless gcc (error "Can not create link: No Gcc header found"))
           (org-link-store-props :type "gnus" :from from :subject subject
                                 :message-id id :group gcc :to to)
-          (let ((link (org-gnus-article-link gcc newsgroup id xarchive))
+          (let ((link (org-gnus-article-link gcc nil id nil)) ;;newsgroup 
xarchive
                 (description (org-link-email-description)))
             (org-link-add-props :link link :description description)
             link)))))))
diff --git a/lisp/org/ol.el b/lisp/org/ol.el
index 994e30f..9ed6ab9 100644
--- a/lisp/org/ol.el
+++ b/lisp/org/ol.el
@@ -1467,7 +1467,7 @@ non-nil."
            (move-beginning-of-line 2)
            (set-mark (point)))))
     (setq org-store-link-plist nil)
-    (let (link cpltxt desc description search custom-id agenda-link)
+    (let (link cpltxt desc search custom-id agenda-link) ;; description
       (cond
        ;; Store a link using an external link type, if any function is
        ;; available. If more than one can generate a link from current
@@ -1598,7 +1598,7 @@ non-nil."
                      'org-create-file-search-functions))
        (setq link (concat "file:" (abbreviate-file-name buffer-file-name)
                           "::" search))
-       (setq cpltxt (or description link)))
+       (setq cpltxt (or link))) ;; description
 
        ((and (buffer-file-name (buffer-base-buffer)) (derived-mode-p 
'org-mode))
        (org-with-limited-levels
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index 2844b0e..251ad97 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -2239,7 +2239,7 @@ have priority."
                  ((>= month 7) 3)
                  ((>= month 4) 2)
                  (t 1)))
-        m1 h1 d1 month1 y1 shiftedy shiftedm shiftedq)
+        h1 d1 month1 y1 shiftedy shiftedm shiftedq) ;; m1
     (cond
      ((string-match "\\`[0-9]+\\'" skey)
       (setq y (string-to-number skey) month 1 d 1 key 'year))
@@ -2342,7 +2342,7 @@ have priority."
                  (`interactive (org-read-date nil t nil "Range end? "))
                  (`untilnow (current-time))
                  (_ (encode-time 0
-                                 (or m1 m)
+                                 m ;; (or m1 m)
                                  (or h1 h)
                                  (or d1 d)
                                  (or month1 month)
@@ -2389,7 +2389,7 @@ the currently selected interval size."
        (user-error "Line needs a :block definition before this command works")
       (let* ((b (match-beginning 1)) (e (match-end 1))
             (s (match-string 1))
-            block shift ins y mw d date wp m)
+            block shift ins y mw d date wp) ;; m
        (cond
         ((equal s "yesterday") (setq s "today-1"))
         ((equal s "lastweek") (setq s "thisweek-1"))
@@ -2414,7 +2414,7 @@ the currently selected interval size."
          (cond
           (d (setq ins (format-time-string
                         "%Y-%m-%d"
-                        (encode-time 0 0 0 (+ d n) m y))))
+                        (encode-time 0 0 0 (+ d n) nil y)))) ;; m
           ((and wp (string-match "w\\|W" wp) mw (> (length wp) 0))
            (require 'cal-iso)
            (setq date (calendar-gregorian-from-absolute
diff --git a/lisp/org/org-crypt.el b/lisp/org/org-crypt.el
index caf9de9..103baeb 100644
--- a/lisp/org/org-crypt.el
+++ b/lisp/org/org-crypt.el
@@ -284,6 +284,8 @@ Assume `epg-context' is set."
         nil)))
     (_ nil)))
 
+(defvar org--matcher-tags-todo-only)
+
 ;;;###autoload
 (defun org-encrypt-entries ()
   "Encrypt all top-level entries in the current buffer."
diff --git a/lisp/org/org-protocol.el b/lisp/org/org-protocol.el
index 74043f8..726c1ca 100644
--- a/lisp/org/org-protocol.el
+++ b/lisp/org/org-protocol.el
@@ -535,7 +535,7 @@ The location for a browser's bookmark should look like this:
         encodeURIComponent(location.href)"
   ;; As we enter this function for a match on our protocol, the return value
   ;; defaults to nil.
-  (let ((result nil)
+  (let (;; (result nil)
        (f (org-protocol-sanitize-uri
            (plist-get (org-protocol-parse-parameters fname nil '(:url))
                       :url))))
@@ -586,7 +586,7 @@ The location for a browser's bookmark should look like this:
               (if (file-exists-p the-file)
                   (message "%s: permission denied!" the-file)
                 (message "%s: no such file or directory." the-file))))))
-      result)))
+      nil))) ;; FIXME: Really?
 
 
 ;;; Core functions:
diff --git a/lisp/org/ox-odt.el b/lisp/org/ox-odt.el
index 2d550d9..a076d15 100644
--- a/lisp/org/ox-odt.el
+++ b/lisp/org/ox-odt.el
@@ -2111,7 +2111,8 @@ SHORT-CAPTION are strings."
         (caption (let ((c (org-export-get-caption element-or-parent)))
                    (and c (org-export-data c info))))
         ;; FIXME: We don't use short-caption for now
-        (short-caption nil))
+        ;; (short-caption nil)
+        )
     (when (or label caption)
       (let* ((default-category
               (cl-case (org-element-type element)
@@ -2159,7 +2160,7 @@ SHORT-CAPTION are strings."
                           "<text:sequence text:ref-name=\"%s\" 
text:name=\"%s\" text:formula=\"ooow:%s+1\" 
style:num-format=\"1\">%s</text:sequence>"
                           label counter counter seqno))
                   (?c . ,(or caption "")))))
-              short-caption))
+              nil)) ;; short-caption
            ;; Case 2: Handle Label reference.
            (reference
             (let* ((fmt (cddr (assoc-string label-style org-odt-label-styles 
t)))
@@ -2362,14 +2363,14 @@ used as a communication channel."
         ;; If yes, note down its contents.  It will go in to frame
         ;; description.  This quite useful for debugging.
         (desc (and replaces (org-element-property :value replaces)))
-        width height)
+        ) ;; width height
     (cond
      ((eq embed-as 'character)
-      (org-odt--render-image/formula "InlineFormula" href width height
+      (org-odt--render-image/formula "InlineFormula" href nil nil ;; width 
height
                                     nil nil title desc))
      (t
       (let* ((equation (org-odt--render-image/formula
-                       "CaptionedDisplayFormula" href width height
+                       "CaptionedDisplayFormula" href nil nil ;; width height
                        captions nil title desc))
             (label
              (let* ((org-odt-category-map-alist
diff --git a/lisp/org/ox.el b/lisp/org/ox.el
index 050a809..36ecf01 100644
--- a/lisp/org/ox.el
+++ b/lisp/org/ox.el
@@ -2706,9 +2706,9 @@ a list of footnote definitions or in the widened buffer."
               (and (or (eq (org-element-type f) 'footnote-definition)
                        (eq (org-element-property :type f) 'inline))
                    (org-element-property :label f)))))
-         seen)
+         ) ;; seen
       (dolist (l (funcall list-labels tree))
-       (cond ((member l seen))
+       (cond ;; ((member l seen))
              ((member l known-definitions) (push l defined))
              (t (push l undefined)))))
     ;; Complete MISSING-DEFINITIONS by finding the definition of every



reply via email to

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