From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id YICMOLmKWGHtWQEAgWs5BA (envelope-from ) for ; Sat, 02 Oct 2021 18:37:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id UDYYNLmKWGEqJgAAB5/wlQ (envelope-from ) for ; Sat, 02 Oct 2021 16:37:13 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 431F42FE28 for ; Sat, 2 Oct 2021 18:37:13 +0200 (CEST) Received: from localhost ([::1]:42204 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWi0Z-0007he-5M for larch@yhetil.org; Sat, 02 Oct 2021 12:37:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36732) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWhzk-0007hU-OH for emacs-orgmode@gnu.org; Sat, 02 Oct 2021 12:36:16 -0400 Received: from mail-qk1-x736.google.com ([2607:f8b0:4864:20::736]:40667) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWhzi-0008DE-QP for emacs-orgmode@gnu.org; Sat, 02 Oct 2021 12:36:16 -0400 Received: by mail-qk1-x736.google.com with SMTP id 72so12296953qkk.7 for ; Sat, 02 Oct 2021 09:36:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=user-agent:from:to:subject:date:message-id:mime-version; bh=/MfeTFRLFln/8m1G8fqEzrrHEG7ULE05QecIioA3DKk=; b=eRBUMHrmxOVXL9AtOLPeFBWoE4fS0RZ5fOCyY11DZ8qlsuJQYoCsfcAe+BYJMSFeF+ n6xzOp4SShLDy7fFi2VBUdLzuO0Znk7fQZ9ZQTSMWU73NF4DGB0EvLmGLgA+ZuqmTFuN vh2MMouv9/clE5eTjzqnclGWW/Bik9nEhU+3USL3/sL/F2sRK0hm7SGP42UUNuV/ef/7 iv7jwECjJrJiW4noH57RpBxM+npBwYluyCbVHoZTMFp2bgs7i0Atg5FVn92W+6ZwUBhY 5jGU0ResCY7kD9HAbEzOtPUUepTVP5i/qDqh7pVg/ugp3lVcyPq1wbxIJpo6mMcX6l1u bs1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:user-agent:from:to:subject:date:message-id :mime-version; bh=/MfeTFRLFln/8m1G8fqEzrrHEG7ULE05QecIioA3DKk=; b=XYkTwwTRLC+ptRyfqzDVqEB3LPuZFuRWg3MuWZHKMvwVBP6ePkcegVs1O9UTT87JJl RL3gt0ahgvDzyrD9lgUgcQ7bwkazpAYlt8+IQFKTqgtJZ5SFNgPNB5Sv5lTcI2b7er/0 r08HAqNC+T6dl9SlVvnHiz3guIRS/f7GK0f12PaCE5lW9fNu38Z2vi3SXf9yKqoNewZ7 /MJESYVmbfgJnJ2NhTu2poQcMB4JoFu2myE4jtZGa6ZJXnLlyVSQn3T0Eb0w44a9LfEE Uwr2PsbwK994/FLlQJ2nnp4v/khyJVVRGQkpbvAfb03lFAysK+tVI8PBYjrJtvPOtbNL Vr1g== X-Gm-Message-State: AOAM5315hHWxZNM5lxXBPgVQKI4dcNROd2tGB8TWKkyUIe9EXtb7mtMS rCPWDpTH7LsYvNBjlAx4oMkPOgbAlMU= X-Google-Smtp-Source: ABdhPJy/Ilr4TXuh0db5/Fm/hhs9ebAKC+vu0egscKPdQBLVRhY9zjaXpRxjD9zMwDksC0newa2+HA== X-Received: by 2002:a37:a95:: with SMTP id 143mr3115051qkk.378.1633192572318; Sat, 02 Oct 2021 09:36:12 -0700 (PDT) Received: from arch ([2601:82:c200:166d:afae:ebe6:a0e2:409e]) by smtp.gmail.com with ESMTPSA id b79sm4888777qkc.0.2021.10.02.09.36.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Oct 2021 09:36:11 -0700 (PDT) User-agent: mu4e 1.7.0; emacs 28.0.50 From: No Wayman To: emacs-orgmode@gnu.org Subject: [PATCH] org-attach: Fix checkdoc warnings Date: Sat, 02 Oct 2021 12:34:09 -0400 Message-ID: <87zgrr8jut.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::736; envelope-from=iarchivedmywholelife@gmail.com; helo=mail-qk1-x736.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633192633; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=/MfeTFRLFln/8m1G8fqEzrrHEG7ULE05QecIioA3DKk=; b=SfytvkxCaaefYeCWe2/HAMIlt/0HHBKGcqJ//AN/0YsxRy93ELRpTTkFMci684qWXgEitM DCVi4z+4FQWpadU1ikW3MwHsWeZQrv6LiqwjhvYuOrasxg3Fqh9d2Y+j3q4fNH9CURppil Td14++eKi6qU/UjbK7gL3ou8FluGkp717/04zjwhl3DhgCNe5yJBVWu6AKdKWEANfDqz3n gebvuXFDBID2bjV3UZZKWKRRRhiCJZfiDRZx1oavRz9EHO2di0oP/Zz/haiMJmCi/3hWc1 b81Bswc0T7pSSBQYtaeTNCgY4ftpQkyZ10125IqrhNQRUqPNQbTQcabQgl8c2g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633192633; a=rsa-sha256; cv=none; b=QbZx4y6bB8Ks5FPJAg5AjBd+HdkIQqCUN/JzH+NpYHIoAedALyVCGp/QEFXWZU5kQIhdM7 0SQOiZHfuCYRigirRYz3uYLz1AYIpVWmp9DXiqyGPFPZ5Tcdev6ddqyS4nMB3B5HVAGlPR AD7Rl4A7mJ4SxpLgtqnntahJOToZD5antM9qQKBZhbqnck2tHLJ7w1ryuX6wsYyHvWyS0Z vqEFtUeV0kweQeIsvEhaPn0SSbDIcyHkuR6Ao+rDHybo3vAnWxfDBVYV3Y5xEkFj+Sued2 jdWSZBiPHihHBuvaWrcUCVOKGMoWQfe3ZnxiN5P0sBeGyODwJTflicAkiABxQQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=eRBUMHrm; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -4.00 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=eRBUMHrm; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 431F42FE28 X-Spam-Score: -4.00 X-Migadu-Scanner: scn1.migadu.com X-TUID: mmRra1v9HhrO --=-=-= Content-Type: text/plain; format=flowed See attached. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-org-attach.el-Fix-checkdoc-warnings.patch >From 477f05274d2de75fc6d4761e6e6089f46e024f4e Mon Sep 17 00:00:00 2001 From: Nicholas Vollmer Date: Thu, 30 Sep 2021 16:07:15 -0400 Subject: [PATCH] org-attach.el: Fix checkdoc warnings * org-attach.el: Fix checkdoc warnings. --- lisp/org-attach.el | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/lisp/org-attach.el b/lisp/org-attach.el index 75db69c9c..e62432dca 100644 --- a/lisp/org-attach.el +++ b/lisp/org-attach.el @@ -123,8 +123,8 @@ lns create a symbol link. Note that this is not supported Enabling inheritance for `org-attach' implies two things. First, that attachment links will look through all parent headings until -it finds the linked attachment. Second, that running org-attach -inside a node without attachments will make org-attach operate on +it finds the linked attachment. Second, that running `org-attach' +inside a node without attachments will make `org-attach' operate on the first parent heading it finds with an attachment. Selective means to respect the inheritance setting in @@ -335,7 +335,7 @@ will be invoked to access the directory for the current entry. Note that this method returns the directory as declared by ID or DIR even if the directory doesn't exist in the filesystem. -If CREATE-IF-NOT-EXIST-P is non-nil, `org-attach-dir-get-create' +If CREATE-IF-NOT-EXISTS-P is non-nil, `org-attach-dir-get-create' is run. If NO-FS-CHECK is non-nil, the function returns the path to the attachment even if it has not yet been initialized in the filesystem. @@ -378,7 +378,7 @@ If the attachment by some reason cannot be created an error will be raised." ((or (eq org-attach-preferred-new-method 'dir) (eq answer ?2)) (setq attach-dir (org-attach-set-directory))) ((eq org-attach-preferred-new-method 'nil) - (error "No existing directory. DIR or ID property has to be explicitly created"))))) + (error "No existing directory. DIR or ID property has to be explicitly created"))))) (unless attach-dir (error "No attachment directory is associated with the current node")) (unless (file-directory-p attach-dir) @@ -483,6 +483,7 @@ DIR-property exists (that is different from the unset one)." (org-attach-tag 'off)) (defun org-attach-url (url) + "Attach URL." (interactive "MURL of the file to attach: \n") (let ((org-attach-method 'url)) (org-attach-attach url))) @@ -503,7 +504,7 @@ if it would overwrite an existing filename." (defun org-attach-attach (file &optional visit-dir method) "Move/copy/link FILE into the attachment directory of the current outline node. -If VISIT-DIR is non-nil, visit the directory with dired. +If VISIT-DIR is non-nil, visit the directory with `dired'. METHOD may be `cp', `mv', `ln', `lns' or `url' default taken from `org-attach-method'." (interactive @@ -574,27 +575,27 @@ The attachment is created as an Emacs buffer." (find-file (expand-file-name file attach-dir)) (message "New attachment %s" file))) -(defun org-attach-delete-one (&optional file) - "Delete a single attachment." +(defun org-attach-delete-one (&optional attachment) + "Delete a single ATTACHMENT." (interactive) (let* ((attach-dir (org-attach-dir)) (files (org-attach-file-list attach-dir)) - (file (or file + (attachment (or attachment (completing-read "Delete attachment: " (mapcar (lambda (f) (list (file-name-nondirectory f))) files))))) - (setq file (expand-file-name file attach-dir)) - (unless (file-exists-p file) - (error "No such attachment: %s" file)) - (delete-file file) + (setq attachment (expand-file-name attachment attach-dir)) + (unless (file-exists-p attachment) + (error "No such attachment: %s" attachment)) + (delete-file attachment) (run-hook-with-args 'org-attach-after-change-hook attach-dir))) (defun org-attach-delete-all (&optional force) "Delete all attachments from the current outline node. This actually deletes the entire attachment directory. -A safer way is to open the directory in dired and delete from there. +A safer way is to open the directory in `dired' and delete from there. With prefix argument FORCE, directory will be recursively deleted with no prompts." @@ -629,12 +630,12 @@ empty attachment directories." t)) (delete-directory attach-dir)))))) -(defun org-attach-file-list (dir) - "Return a list of files in the attachment directory. +(defun org-attach-file-list (directory) + "Return a list of files in the attachment DIRECTORY. This ignores files ending in \"~\"." (delq nil (mapcar (lambda (x) (if (string-match "^\\.\\.?\\'" x) nil x)) - (directory-files dir nil "[^~]\\'")))) + (directory-files directory nil "[^~]\\'")))) (defun org-attach-reveal () "Show the attachment directory of the current outline node. @@ -645,7 +646,7 @@ exist yet. Respects `org-attach-preferred-new-method'." (org-open-file (org-attach-dir-get-create))) (defun org-attach-reveal-in-emacs () - "Show the attachment directory of the current outline node in dired. + "Show the attachment directory of the current outline node in `dired'. Will create an attachment and folder if it doesn't exist yet. Respects `org-attach-preferred-new-method'." (interactive) @@ -749,14 +750,14 @@ This function is called by `org-archive-hook'. The option ;;;###autoload (defun org-attach-dired-to-subtree (files) - "Attach FILES marked or current file in dired to subtree in other window. + "Attach FILES marked or current file in `dired' to subtree in other window. Takes the method given in `org-attach-method' for the attach action. -Precondition: Point must be in a dired buffer. +Precondition: Point must be in a `dired' buffer. Idea taken from `gnus-dired-attach'." (interactive (list (dired-get-marked-files))) (unless (eq major-mode 'dired-mode) - (user-error "This command must be triggered in a dired buffer")) + (user-error "This command must be triggered in a `dired' buffer")) (let ((start-win (selected-window)) (other-win (get-window-with-predicate -- 2.33.0 --=-=-=--