Browse Source

org-attach.el: Allow to attach files starting with a dot

* org-attach.el (org-attach-sync, org-attach-file-list): Allow
to attach files starting with a dot.

Thanks to Oleh for requesting this and providing a patch.
Bastien Guerry 11 years ago
parent
commit
74162d9eb6
1 changed files with 3 additions and 3 deletions
  1. 3 3
      lisp/org-attach.el

+ 3 - 3
lisp/org-attach.el

@@ -417,15 +417,15 @@ This can be used after files have been added externally."
 	(and files (org-attach-tag))
 	(when org-attach-file-list-property
 	  (dolist (file files)
-	    (unless (string-match "^\\." file)
+	    (unless (string-match "^\\.\\.?\\'" file)
 	      (org-entry-add-to-multivalued-property
 	       (point) org-attach-file-list-property file))))))))
 
 (defun org-attach-file-list (dir)
   "Return a list of files in the attachment directory.
-This ignores files starting with a \".\", and files ending in \"~\"."
+This ignores files ending in \"~\"."
   (delq nil
-	(mapcar (lambda (x) (if (string-match "^\\." x) nil x))
+	(mapcar (lambda (x) (if (string-match "^\\.\\.?\\'" x) nil x))
 		(directory-files dir nil "[^~]\\'"))))
 
 (defun org-attach-reveal (&optional if-exists)