Pārlūkot izejas kodu

Make checkdoc happy about db-org

master
Daniel 3 mēnešus atpakaļ
vecāks
revīzija
7833e28185
Šim parakstam datu bāzē netika atrasta zināma atslēga
1 mainītis faili ar 29 papildinājumiem un 30 dzēšanām
  1. 29
    30
      site-lisp/db-org.el

+ 29
- 30
site-lisp/db-org.el Parādīt failu

@@ -26,10 +26,10 @@
26 26
 ;;; Agenda Customization
27 27
 
28 28
 (defun db/check-special-org-files-in-agenda (&rest args)
29
-  "Check whether the special org-mode files are part of `org-agenda-files', ignoring ARGS.
30
-The special org-mode files are `db/org-default-org-file',
29
+  "Check special Org mode files to be part of the variable `org-agenda-files'.
30
+The special Org mode files are `db/org-default-org-file',
31 31
 `db/org-default-work-file', `db/org-default-home-file', and
32
-`db/org-default-refile-file'."
32
+`db/org-default-refile-file'.  Ignore ARGS."
33 33
   (ignore args)
34 34
   (require 'org)
35 35
   (let ((agenda-files (mapcar #'file-truename (org-agenda-files t))))
@@ -227,7 +227,9 @@ Add this function to `org-agenda-finalize-hook' to enable this."
227 227
 ;;; Capturing
228 228
 
229 229
 (defun db/org-timestamp-difference (stamp-1 stamp-2)
230
-  "Returns time difference between two given org-mode timestamps."
230
+  "Return time difference between two Org mode timestamps.
231
+STAMP-1 and STAMP-2 must be understood by
232
+`org-parse-time-string'."
231 233
   ;; Things copied from `org-clock-update-time-maybe’
232 234
   (let* ((s (-
233 235
              (float-time
@@ -243,8 +245,7 @@ Add this function to `org-agenda-finalize-hook' to enable this."
243 245
 ;; Capture Code Snippets
244 246
 ;; from http://ul.io/nb/2018/04/30/better-code-snippets-with-org-capture/
245 247
 (defun db/org-capture-code-snippet (filename)
246
-  "Format Org mode entry for capturing code in active region in
247
-the buffer visiting FILENAME."
248
+  "Format Org mode source block with contant of active region in FILENAME."
248 249
   (with-current-buffer (find-buffer-visiting filename)
249 250
     (let ((code-snippet (buffer-substring-no-properties (mark) (- (point) 1)))
250 251
           (func-name (which-function))
@@ -277,9 +278,8 @@ In ~%s~:
277 278
   (delete-other-windows)
278 279
   (org-capture))
279 280
 
280
-(defun db/delete-frame-if-capture (&rest r)
281
+(defun db/delete-frame-if-capture (&rest)
281 282
   "If current frame was made for a capture, close after done."
282
-  (ignore r)
283 283
   (when (equal (frame-parameter nil 'name)
284 284
                "capture")
285 285
     (delete-frame)))
@@ -351,8 +351,7 @@ tag PERIODIC."
351 351
          (org-clock-in '(4))))))))
352 352
 
353 353
 (defun db/save-current-org-task-to-file ()
354
-  "Format currently clocked task and write it to
355
-`db/org-clock-current-task-file'."
354
+  "Format currently clocked task and write it to`db/org-clock-current-task-file'."
356 355
   (with-temp-file db/org-clock-current-task-file
357 356
     (let ((clock-buffer (marker-buffer org-clock-marker)))
358 357
       (if (null clock-buffer)
@@ -360,8 +359,7 @@ tag PERIODIC."
360 359
         (insert org-clock-heading)))))
361 360
 
362 361
 (defun db/org-update-frame-title-with-current-clock ()
363
-  "Set the title of all active frames to the headline of the
364
-  current task."
362
+  "Set title of all active frames to the headline of the current task."
365 363
   (interactive)
366 364
   (let ((clock-buffer (marker-buffer org-clock-marker)))
367 365
     (when clock-buffer
@@ -391,7 +389,7 @@ tag PERIODIC."
391 389
   "Clock in org mode task as given by TASK-ID."
392 390
   (let ((location (org-id-find task-id 'marker)))
393 391
     (if (null location)
394
-        (user-error "Invalid location «%s» given." task-id)
392
+        (user-error "Invalid location give: %s»" task-id)
395 393
       (org-with-point-at location
396 394
         (org-clock-in))
397 395
       (org-save-all-org-buffers))))
@@ -487,14 +485,14 @@ forces clocking in of the default task."
487 485
 (defun db/org-onenote-open (path)
488 486
   "Visit OneNote document on PATH."
489 487
   (unless (file-executable-p db/path-to-onenote)
490
-    (user-error "Path for OneNote is not executable, please customize `db/path-to-onenote’."))
488
+    (user-error "Path for OneNote is not executable, please customize `db/path-to-onenote’"))
491 489
   (start-process "OneNote" nil db/path-to-onenote "/hyperlink" path))
492 490
 
493 491
 (defun db/org-outlook-open (id)
494
-  "Open the Outlook item identified by ID.
495
-  ID should be an Outlook GUID."
492
+  "Open Outlook item identified by ID.
493
+ID should be an Outlook GUID."
496 494
   (unless (file-executable-p db/path-to-outlook)
497
-    (user-error "Path for Outlook is not executable, please customize `db/path-to-outlook’."))
495
+    (user-error "Path for Outlook is not executable, please customize `db/path-to-outlook’"))
498 496
   (w32-shell-execute "open" db/path-to-outlook (concat "/select outlook:" id)))
499 497
 
500 498
 (defun db/org-rfc-open (number)
@@ -542,9 +540,9 @@ open RFC in HTML format in the default browser."
542 540
        (org-clock-update-time-maybe)))))
543 541
 
544 542
 (defun db/find-csv-in-org (arg)
545
-  "Interactively CSV find file and open it as Org mode table.
543
+  "Interactively find CSV file and open it as Org mode table.
546 544
 Default separator is \";\", but this can be changed interactively
547
-by passing a universal argument."
545
+by passing a non-nil value for ARG."
548 546
   (interactive "P")
549 547
   (let ((separator (if arg (read-from-minibuffer "Separator (regular expression): ")
550 548
                      ";")))
@@ -577,7 +575,7 @@ drawers, will be copied to point."
577 575
                                                 (org-element-at-point))))
578 576
                         (unless (string-equal (org-element-property :title template-element)
579 577
                                               "Template")
580
-                          (user-error "Template must be first headline in periodic task."))
578
+                          (user-error "Template must be first headline in periodic task"))
581 579
                         ;; Starting from the end of the last element in the
582 580
                         ;; subtree, we go up until we find a drawer or a
583 581
                         ;; headline; everything in between is considered to be the template
@@ -599,14 +597,14 @@ drawers, will be copied to point."
599 597
 ;;; Calendar
600 598
 
601 599
 (defun db/export-diary ()
602
-  "Export diary.org as ics file to the current value of `org-icalendar-combined-agenda-file’.
600
+  "Export diary.org as ics file to `org-icalendar-combined-agenda-file’.
603 601
 This is done only if the value of this variable is not null."
604 602
   (interactive)
605 603
   (cond
606 604
    ((null org-icalendar-combined-agenda-file)
607 605
     (message "`org-icalendar-combined-agenda-file’ not set, not exporting diary."))
608 606
    ((not (file-name-absolute-p org-icalendar-combined-agenda-file))
609
-    (user-error "`org-icalendar-combined-agenda-file’ not an absolute path, aborting."))
607
+    (user-error "`org-icalendar-combined-agenda-file’ not an absolute path, aborting"))
610 608
    (t
611 609
     (progn
612 610
       (org-save-all-org-buffers)
@@ -664,11 +662,12 @@ not."
664 662
 
665 663
 (defun db/org--get-location (&optional arg)
666 664
   "Interactively query for location and return mark.
667
-Searches through the current file, and through all of
668
-`org-agenda-files', `org-agenda-text-search-extra-files', and the
669
-current buffer, if ARG is non-nil.  Search is always conducted up
670
-to level 9.  If the selected location does not have an associated
671
-mark, error out."
665
+Searches through the current file, and through all files in the
666
+variables `org-agenda-files',
667
+`org-agenda-text-search-extra-files', and the current buffer, if
668
+ARG is non-nil.  Search is always conducted up to level 9.  If
669
+the selected location does not have an associated mark, error
670
+out."
672 671
   (let* ((org-refile-targets (if arg
673 672
                                  `((org-agenda-files :maxlevel . 9)
674 673
                                    (,(cl-remove-if-not
@@ -704,9 +703,9 @@ prompt for an item."
704 703
 
705 704
 Search through all items of the current buffer, or
706 705
 `db/org-default-org-file' if the current buffer is not associated
707
-with a file.  If ARG is non-nil, include all files in
708
-`org-agenda-files' and `org-agenda-text-search-extra-files' in
709
-this search.
706
+with a file.  If ARG is non-nil, include all files in the
707
+variables `org-agenda-files' and
708
+`org-agenda-text-search-extra-files' in this search.
710 709
 
711 710
 Use `org-store-link' to save link to `org-stored-links'."
712 711
   (interactive "P")

Notiek ielāde…
Atcelt
Saglabāt