Subject: bug#47820: closed (Re: bug#47820: [PATCH] org-table-import: Give option to import interactively even if filename doesn't match)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 01 May 2021 08:52:01 +0000

Your bug report

#47820: [PATCH] org-table-import: Give option to import interactively even if filename doesn't match

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
47820: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=47820
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#47820: [PATCH] org-table-import: Give option to import interactively even if filename doesn't match
From: Bastien <[email-masked]>
To: Utkarsh Singh <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Sat, 01 May 2021 10:51:00 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Utkarsh,

Utkarsh Singh <[email-masked]> writes:

> Can we give small flexibility in choosing the filename interactively for
> `org-table-import'?  Currently org-table-import will just throw an error
> when file name doesn't have .txt, .csv or .tsv as extension.

Applied in master as commit 7c99d1555, thanks.

Please see the commit changelog for future patches:
https://code.orgmode.org/bzg/org-mode/commit/7c99d1555

Also https://orgmode.org/worg/org-contribute.html#commit-messages give
more detailed directions.

Thanks,

-- 
 Bastien

Subject: [PATCH] org-table-import: Give option to import interactively even if filename doesn't match
From: Utkarsh Singh <[email-masked]>
To: [email-masked], [email-masked]
Date: Fri, 16 Apr 2021 14:31:42 +0530
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

Can we give small flexibility in choosing the filename interactively for
`org-table-import'?  Currently org-table-import will just throw an error
when file name doesn't have .txt, .csv or .tsv as extension.

This patch tries to add a simple yes-and-no to let user choose if they
want to continue importing or not.

diff --git a/lisp/org/org-table.el b/lisp/org/org-table.el
index 0e93fb271f..ab66859d6a 100644
--- a/lisp/org/org-table.el
+++ b/lisp/org/org-table.el
@@ -938,7 +938,8 @@ org-table-import
 - regexp  When a regular expression, use it to match the separator."
   (interactive "f\nP")
   (when (and (called-interactively-p 'any)
-	     (not (string-match-p (rx "." (or "txt" "tsv" "csv") eos) file)))
+	     (not (string-match-p (rx "." (or "txt" "tsv" "csv") eos) file))
+             (not (yes-or-no-p "File doesn't have .txt, .tsv or .csv as extension.  Do you still want to continue? ")))
     (user-error "Cannot import such file"))
   (unless (bolp) (insert "\n"))
   (let ((beg (point))

-- 
Utkarsh Singh
http://utkarshsingh.xyz