summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2015-11-13 23:51:28 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2015-11-13 23:51:28 +0100
commit403249a6ab1bfe4b8ed5ffb8c75535d3d56ca699 (patch)
tree0e96ac41ce035496383a1ac217ef53e707b371bc
parent4e1f550224aa104080d78c0bdc6754bb3efeadf3 (diff)
downloadorg-mode-403249a6ab1bfe4b8ed5ffb8c75535d3d56ca699.tar.gz
org-attach: Use lexical binding
* lisp/org-attach.el (org-attach-dir): Silence byte-compiler.
-rw-r--r--lisp/org-attach.el22
1 files changed, 10 insertions, 12 deletions
diff --git a/lisp/org-attach.el b/lisp/org-attach.el
index fb4c385..b3cd7b7 100644
--- a/lisp/org-attach.el
+++ b/lisp/org-attach.el
@@ -1,4 +1,4 @@
-;;; org-attach.el --- Manage file attachments to org-mode tasks
+;;; org-attach.el --- Manage file attachments to Org tasks -*- lexical-binding: t; -*-
;; Copyright (C) 2008-2015 Free Software Foundation, Inc.
@@ -208,25 +208,23 @@ using the entry ID will be invoked to access the unique directory for the
current entry.
If the directory does not exist and CREATE-IF-NOT-EXISTS-P is non-nil,
the directory and (if necessary) the corresponding ID will be created."
- (let (attach-dir uuid inherit)
+ (let (attach-dir uuid)
(setq org-attach-inherited (org-entry-get nil "ATTACH_DIR_INHERIT"))
(cond
((setq attach-dir (org-entry-get nil "ATTACH_DIR"))
(org-attach-check-absolute-path attach-dir))
((and org-attach-allow-inheritance
- (setq inherit (org-entry-get nil "ATTACH_DIR_INHERIT" t)))
+ (org-entry-get nil "ATTACH_DIR_INHERIT" t))
(setq attach-dir
- (save-excursion
- (save-restriction
- (widen)
- (if (marker-position org-entry-property-inherited-from)
- (goto-char org-entry-property-inherited-from)
- (org-back-to-heading t))
- (let (org-attach-allow-inheritance)
- (org-attach-dir create-if-not-exists-p)))))
+ (org-with-wide-buffer
+ (if (marker-position org-entry-property-inherited-from)
+ (goto-char org-entry-property-inherited-from)
+ (org-back-to-heading t))
+ (let (org-attach-allow-inheritance)
+ (org-attach-dir create-if-not-exists-p))))
(org-attach-check-absolute-path attach-dir)
(setq org-attach-inherited t))
- (t ; use the ID
+ (t ; use the ID
(org-attach-check-absolute-path nil)
(setq uuid (org-id-get (point) create-if-not-exists-p))
(when (or uuid create-if-not-exists-p)