emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Derek Chen-Becker <derek@chen-becker.org>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] Cannot tangle src block in capture buffer [9.7.6]
Date: Sat, 18 Jan 2025 06:41:50 -0700	[thread overview]
Message-ID: <CAMbmz5=zfLwkhmKzHkW0yLM6S-D9WK8jEG2wHR7ALPNTWfoRrw@mail.gmail.com> (raw)
In-Reply-To: <875xmefu3v.fsf@localhost>

[-- Attachment #1: Type: text/plain, Size: 3852 bytes --]

I'm still sorting out the copyright assignment, but I have another style
question: It feels like I should move the `should' clauses closer to the
checks so that I get a more concise report when something is wrong:

(ert-deftest test-org-base-buffer-file-name ()

  "Test `org-base-buffer-file-name'."

  ;; Test direct buffer resolution

  (org-test-with-temp-text-in-file

   "File"

   (let ((base-filename (buffer-file-name)))

     ;; Confirm that we get the same answer whether we provide the buffer
or use the default
     (should (equal base-filename (org-base-buffer-file-name)))

     (should (equal base-filename (org-base-buffer-file-name
(current-buffer))))))
  ;; Test indirect buffer resolution

  (org-test-with-temp-text-in-file

   "File with indirect buffer"

   (let ((base-filename (buffer-file-name))

         (base-buffer (current-buffer))

         (indirect-test-buffer (make-indirect-buffer (current-buffer)
"test")))
     (set-buffer indirect-test-buffer)

     ;; Confirm that we get the same answer for the default, the indirect
buffer, and the base buffer
     (should (equal base-filename (org-base-buffer-file-name)))

     (should (equal base-filename (org-base-buffer-file-name base-buffer)))

     (should (equal base-filename (org-base-buffer-file-name
indirect-test-buffer)))
     (kill-buffer indirect-test-buffer)))

  ;; Test for a buffer with no associated file

  (org-test-with-temp-text

   "Buffer without file"

   (should-not (org-base-buffer-file-name))))


Is that OK?

Thanks,

Derek

On Thu, Jan 16, 2025 at 12:13 PM Ihor Radchenko <yantar92@posteo.net> wrote:

> Derek Chen-Becker <derek@chen-becker.org> writes:
>
> >> The latest version of your patch exceeds 20LOC and cannot be accepted
> >> unless you have FSF copyright assignment.
> >
> > Sorry, that was clear in your previous comment. I am working on the
> > assignment form right now but I expect that to be a solved problem and I
> > want to continue to contribute to Org mode anyway, so I wanted to
> > parallelize that with continuing on the patch. If you would like me to
> stop
> > working on the patch until I have the copyright assignment taken care
> of, I
> > can do that, too.
>
> Great. If you are going to have the copyright assignment, there is no
> limit on the patch size. It is just that we will need to wait until you
> finalize the assignment before we actually merge it.
>
> But nothing stops you and me from working on the patch before that.
>
> >> I recommend using `org-babel-effective-tangled-filename' instead.
> >> This is more future-proof against possible changes in the way file name
> >> is computed.
> >>
> >
> > I'm sorry, I don't quite understand. Do you mean I should change the
> > function name `org-base-buffer-file-name' to
> > `org-babel-effective-tangled-filename' or something else?
>
> Ouch. Never mind. I misread your patch. I thought that you are using
> :tangle yes in which case `org-babel-effective-tangle-filename' would be
> used to auto-generate the tangle file name. But that's not the case -
> you explicitly specify the tangle target.
>
> --
> Ihor Radchenko // yantar92,
> Org mode maintainer,
> Learn more about Org mode at <https://orgmode.org/>.
> Support Org development at <https://liberapay.com/org-mode>,
> or support my work at <https://liberapay.com/yantar92>
>


-- 
+---------------------------------------------------------------+
| Derek Chen-Becker                                             |
| GPG Key available at https://keybase.io/dchenbecker and       |
| https://pgp.mit.edu/pks/lookup?search=derek%40chen-becker.org |
| Fngrprnt: EB8A 6480 F0A3 C8EB C1E7  7F42 AFC5 AFEE 96E4 6ACC  |
+---------------------------------------------------------------+

[-- Attachment #2: Type: text/html, Size: 8352 bytes --]

  reply	other threads:[~2025-01-18 13:48 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-26 16:29 [BUG] Cannot tangle src block in capture buffer [9.7.6] Dilip
2024-08-05 14:03 ` Ihor Radchenko
2024-12-16  3:26   ` Derek Chen-Becker
2024-12-16 17:39     ` Ihor Radchenko
2024-12-19 17:56       ` Derek Chen-Becker
2024-12-19 19:17         ` Ihor Radchenko
2024-12-23 23:36           ` Derek Chen-Becker
2024-12-24  9:14             ` Ihor Radchenko
2025-01-10 15:25               ` Derek Chen-Becker
2025-01-11  9:17                 ` Ihor Radchenko
2025-01-12 15:52                   ` Derek Chen-Becker
2025-01-12 16:45                     ` Ihor Radchenko
2025-01-12 22:24                       ` Derek Chen-Becker
2025-01-13 17:23                         ` Ihor Radchenko
2025-01-14  3:01                           ` Derek Chen-Becker
2025-01-14 17:56                             ` Ihor Radchenko
2025-01-14 19:26                               ` Derek Chen-Becker
2025-01-15 14:15                                 ` Derek Chen-Becker
2025-01-15 17:15                                   ` Ihor Radchenko
2025-01-16 15:35                                     ` Derek Chen-Becker
2025-01-16 19:15                                       ` Ihor Radchenko
2025-01-18 13:41                                         ` Derek Chen-Becker [this message]
2025-01-18 14:46                                           ` Ihor Radchenko
2025-01-14 23:10                               ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMbmz5=zfLwkhmKzHkW0yLM6S-D9WK8jEG2wHR7ALPNTWfoRrw@mail.gmail.com' \
    --to=derek@chen-becker.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).