From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uL7YGfKCeWD8PAEAgWs5BA (envelope-from ) for ; Fri, 16 Apr 2021 14:28:34 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id SFzEFPKCeWADbQAAbx9fmQ (envelope-from ) for ; Fri, 16 Apr 2021 12:28:34 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CE59416A12 for ; Fri, 16 Apr 2021 14:28:33 +0200 (CEST) Received: from localhost ([::1]:47194 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXNaK-0001J0-J3 for larch@yhetil.org; Fri, 16 Apr 2021 08:28:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXKMF-0001vA-8p; Fri, 16 Apr 2021 05:01:47 -0400 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]:36364) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lXKMD-0004qg-LT; Fri, 16 Apr 2021 05:01:47 -0400 Received: by mail-pj1-x1036.google.com with SMTP id f2-20020a17090a4a82b02900c67bf8dc69so16005000pjh.1; Fri, 16 Apr 2021 02:01:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=hAL7QDW7lio+mBqzKbMsJJcb9AJWd5fHYybMn7J12Fk=; b=V+68Xwp9nTKW0LoPC/QroEgpLZrel6KLX1QPKlbN9zQNziLxPmzf8BNtyN3U3inL05 4La+ve74itRA6cQjXuyHH84urUNlkke+1pkLgjvvBrLnnnRzMnHTVVkVTEa9mKa5a/U6 1AJf7bKeZFmOYZKp2EDmjo4alQHtw38n4E30gAkusi15XGoLEmxEGb8FwnJKw7BMlq0J AhjAZfC5OSgEZshgFMFHQVICYP2SjGZXit39GZlDK7rDOfBqwpMt0Xg2sZgX0kimI2Xs iKjBOX8yYergcGf/QzWaepxh3g9oGyacfhP9VGhRZOeAqOIgfx9b/LAe/BpBQdUwBChR 74UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=hAL7QDW7lio+mBqzKbMsJJcb9AJWd5fHYybMn7J12Fk=; b=GrradAdMMwPj9m6DHtU8UmJ8Eex1EVIo4ozXver1aH6hplgMeZPAnf9DNASBd1MoUT b8TKXYAkRi8nUoBxoW/BG2h0pzvuHQzqqKJzRAfprmtffovQ4YFVEKJmj0pfEe6cAdv0 Zxw6An+OKL3xQDqZd/37uD+fq/Tk93FyBCnl8+SDvwH13k2h4C9MwCTsZ5mklsRb3ge7 +gskMw72En11XuqWxdpPZHsqU70FvzmvXGVD73+jPNBkoqENk4D9/GV7suEWgjZH4EFM SW00ljid4/th1KENaiaNLrM5aSW8eDeZu8XCwsvEFjUfPhsY1hlT/FGpaG/5WTYpYqPa 5phA== X-Gm-Message-State: AOAM533p6NjVlBiH6A2dwX4TkJCS4J6r28w35RakT55h5HwYqvNOcHNJ Vg1Im05IGUF0v6L8tL1lSbHmc7RypBs= X-Google-Smtp-Source: ABdhPJxg2VjpS1xVDeeeEPrbqVy8FS4JxKH6ZBj0rVSaKeg/lHa/ruONJNEztneXtUT29xabX7wK5g== X-Received: by 2002:a17:902:20a:b029:eb:873d:d73d with SMTP id 10-20020a170902020ab02900eb873dd73dmr5883359plc.54.1618563701871; Fri, 16 Apr 2021 02:01:41 -0700 (PDT) Received: from localhost ([45.251.50.123]) by smtp.gmail.com with ESMTPSA id c21sm3537459pfc.165.2021.04.16.02.01.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Apr 2021 02:01:41 -0700 (PDT) From: Utkarsh Singh To: bug-gnu-emacs@gnu.org, emacs-orgmode@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 Message-ID: <8735vqzjpl.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=utkarsh190601@gmail.com; helo=mail-pj1-x1036.google.com X-Spam_score_int: 1 X-Spam_score: 0.1 X-Spam_bar: / X-Spam_report: (0.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_OTHER_BAD_TLD=1.999, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 16 Apr 2021 08:27:09 -0400 X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1618576114; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=hAL7QDW7lio+mBqzKbMsJJcb9AJWd5fHYybMn7J12Fk=; b=bqpIGn+AKnpi7ru/2nFNiI2aNvXmrYQ905RZQ/8wq/paAsNgBTFejn9qDZqHaI4aFMhUxN Ys5ert3BzNGCXstRzu0F7P5mQ6+1VspEC2+w3GSC56lGgHnMAUw5b1TcT2R6yhr23nQsNl FnPirH7wXyEQ+nNI5DXwQteh6bOmHtLx8MgKDqdgVuPffS9Dmpp6PfK1AAgahNmw+5Fm9S 7jkSmnFhULz0EHKq8qfFYrZgujiX0K4ar4tTarqf8yU317jIsJWmNgamsESgn7OeFs7uZx E1GcTNnBbOjDLlzfJAuRN1vlOATN98WAYvRD4RluTTQj//IoXzK9QY+FwiwO1g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618576114; a=rsa-sha256; cv=none; b=RWQ3murkZY7SPhb9Mz7S9UF89dTKPcCKhMlPMHEAa2webVmFTXjp6pf2iuM9iUON1IsjSz srVZOphZQPJffxEkXkPwjVRmYD+sZo7VssgoRLuq0r0LCVCoSjzUDtaq7T2ylgdCNj5Wdw 5ZGd9BruTgCcrcCKO8khdgH2WiO2cwWMIAfqPh9FiAtPL0gV5Ey4SKkivcMVcUaf1p0Gq3 JTi1RHU/VTjZ0CIurhwkslkFiaTKB20wHK9RVxlctZcASJgGT1yXN2fU1FPLmLsVfPn3og Acxi3QYfin0gjwyT3e9MKTNs8wJxdAhgVTqT2Y3f1CsFqsnUiuHzR29rcToiiA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=V+68Xwp9; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.14 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=V+68Xwp9; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: CE59416A12 X-Spam-Score: -3.14 X-Migadu-Scanner: scn0.migadu.com X-TUID: W3gqVZNJrPth 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