* [PATCH] org-attach: Fix checkdoc warnings
@ 2021-10-02 16:34 No Wayman
2021-10-02 17:15 ` Bastien
0 siblings, 1 reply; 2+ messages in thread
From: No Wayman @ 2021-10-02 16:34 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 16 bytes --]
See attached.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-attach.el-Fix-checkdoc-warnings.patch --]
[-- Type: text/x-patch, Size: 6226 bytes --]
From 477f05274d2de75fc6d4761e6e6089f46e024f4e Mon Sep 17 00:00:00 2001
From: Nicholas Vollmer <iarchivedmywholelife@gmail.com>
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] org-attach: Fix checkdoc warnings
2021-10-02 16:34 [PATCH] org-attach: Fix checkdoc warnings No Wayman
@ 2021-10-02 17:15 ` Bastien
0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2021-10-02 17:15 UTC (permalink / raw)
To: No Wayman; +Cc: emacs-orgmode
No Wayman <iarchivedmywholelife@gmail.com> writes:
> See attached.
Applied, thanks.
--
Bastien
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-02 17:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-02 16:34 [PATCH] org-attach: Fix checkdoc warnings No Wayman
2021-10-02 17:15 ` Bastien
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).