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

Previous Next

Package: emacs;

Reported by: Utkarsh Singh <utkarsh190601 <at> gmail.com>

Date: Fri, 16 Apr 2021 09:02:02 UTC

Severity: normal

Tags: patch

Done: Bastien <bzg <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Bastien <bzg <at> gnu.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#47820: closed ([PATCH] org-table-import: Give option to
 import interactively even if filename doesn't match)
Date: Sat, 01 May 2021 08:52:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 01 May 2021 10:51:00 +0200
with message-id <87o8duu9aj.fsf <at> gnu.org>
and subject line Re: bug#47820: [PATCH] org-table-import: Give option to import interactively even if filename doesn't match
has caused the debbugs.gnu.org bug report #47820,
regarding [PATCH] org-table-import: Give option to import interactively even if filename doesn't match
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
47820: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=47820
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Utkarsh Singh <utkarsh190601 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org, emacs-orgmode <at> gnu.org
Subject: [PATCH] org-table-import: Give option to import interactively even
 if filename doesn't match
Date: Fri, 16 Apr 2021 14:31:42 +0530
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


[Message part 3 (message/rfc822, inline)]
From: Bastien <bzg <at> gnu.org>
To: Utkarsh Singh <utkarsh190601 <at> gmail.com>
Cc: emacs-orgmode <at> gnu.org, 47820-done <at> debbugs.gnu.org
Subject: Re: bug#47820: [PATCH] org-table-import: Give option to import
 interactively even if filename doesn't match
Date: Sat, 01 May 2021 10:51:00 +0200
Hi Utkarsh,

Utkarsh Singh <utkarsh190601 <at> gmail.com> 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


This bug report was last modified 4 years and 18 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.