emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Max Nikulin <manikulin@gmail.com>
To: Hugo Heagren <hugo@heagren.com>, emacs-orgmode@gnu.org
Subject: Re: [PATCH v6] ol.el: add description format parameter to org-link-parameters
Date: Mon, 18 Jul 2022 17:55:51 +0700	[thread overview]
Message-ID: <47248a4f-10aa-0980-c054-563f30c05aaa@gmail.com> (raw)
In-Reply-To: <87k08bjw0t.fsf@heagren.com>

Hugo,

I am sorry if I am wrong, but I do not see you among known Org 
contributors. You patch is likely greater than it is allowed for 
TINYCHANGE, so before you patch can be committed, copyright assignment 
should be signed, see 
https://orgmode.org/worg/org-contribute.html#copyright for details.

On 18/07/2022 03:59, Hugo Heagren wrote:
>  From fbe030ad3a2aafd09d491aefb9c56242b7ec669b Mon Sep 17 00:00:00 2001
> From: Hugo Heagren<hugo@heagren.com>
> Date: Sat, 16 Jul 2022 19:50:15 +0100
> Subject: [PATCH] test-ol: tests for insert-description param when inserting
>   links

Emacs-26.3:
make test-dirty BTEST_RE=test-ol/insert-link-insert-description

selected tests: test-ol/insert-link-insert-description
Running 1 tests (2022-07-18 12:21:46+0200)
Test test-ol/insert-link-insert-description backtrace:
   signal(wrong-type-argument (listp :insert-description))
   apply(signal (wrong-type-argument (listp :insert-description)))
   (setq value-7565 (apply fn-7563 args-7564))
   (unwind-protect (setq value-7565 (apply fn-7563 args-7564)) (setq fo
   (if (unwind-protect (setq value-7565 (apply fn-7563 args-7564)) (set
   (let (form-description-7567) (if (unwind-protect (setq value-7565 (a
   (let ((value-7565 (quote ert-form-evaluation-aborted-7566))) (let (f
   (let* ((fn-7563 (function signal)) (args-7564 (condition-case err (l
   (closure (t) nil (let* ((fn-7563 (function signal)) (args-7564 (cond
   ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test
   ert-run-test(#s(ert-test :name test-ol/insert-link-insert-descriptio
   ert-run-or-rerun-test(#s(ert--stats :selector "test-ol/insert-link-i
   ert-run-tests("test-ol/insert-link-insert-description" #f(compiled-f
   ert-run-tests-batch("test-ol/insert-link-insert-description")
   ert-run-tests-batch-and-exit("test-ol/insert-link-insert-description
   (let ((org-id-track-globally t) (org-test-selector (if org-test-sele
   org-test-run-batch-tests("test-ol/insert-link-insert-description")
   eval((org-test-run-batch-tests org-test-select-re))
   command-line-1(("--eval" "(setq vc-handled-backends nil org-startup-
   command-line()
   normal-top-level()
Test test-ol/insert-link-insert-description condition:
     (wrong-type-argument listp :insert-description)
    FAILED  1/1  test-ol/insert-link-insert-description

> +(ert-deftest test-ol/insert-link-insert-description ()
> +  "Test `:insert-description' parameter handling."
> +  ;; String case.

The cases might be improved by using different values, so when 
particular `should' form fail it is easier to find it in the code

> +  (should
> +   (string=
> +    "foobar"
> +    (test-ol-with-link-parameters-as
> +        "id" (:insert-description "foobar")

E.g. "foobar-string"

> +      (test-ol-insert-link-get-desc "id:foo-bar"))))
> +  ;; Lambda case.
> +  (should
> +   (string=
> +    "foobar"
> +    (test-ol-with-link-parameters-as
> +        "id" (:insert-description (lambda (_link-test _desc) "foobar"))
> +      (test-ol-insert-link-get-desc "id:foo-bar"))))

"foobar-lambda"

Further "foobar-desc-arg", etc.

> +`:insert-description'
> +
> +  String or function used as a default when prompting users for a
> +  link's description.  A string is used as-is, a function is
> +  called with two arguments: the full link text, and the

"link text" might be a bit ambiguous here. I would consider "link 
location", "string containing link type and target", or something else.

> +  description generated by `org-insert-link'.  It should return
> +  the description to use (this reflects the behaviour of
> +  `org-link-make-description-function').  If it returns nil, no
> +  default description is used, but no error is thrown (from the
> +  user's perspective, this is equivalent to a default description
> +  of \"\").



  reply	other threads:[~2022-07-18 11:19 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-28 23:15 Hugo Heagren
2022-03-28 23:15 ` [PATCH] " Hugo Heagren
2022-04-04  9:49   ` Ihor Radchenko
2022-04-05 19:29     ` [PATCH v2] " Hugo Heagren
2022-04-07  5:13       ` Ihor Radchenko
2022-06-21 12:03         ` [PATCH v3] " Hugo Heagren
2022-06-21 13:41           ` Robert Pluim
2022-07-07 19:57             ` [PATCH v4] " Hugo Heagren
2022-07-09  3:31               ` Ihor Radchenko
2022-07-14 13:08                 ` [PATCH v5] " Hugo Heagren
2022-07-16  9:09                   ` Ihor Radchenko
2022-07-16 21:20                     ` Hugo Heagren
2022-07-17  6:11                       ` Max Nikulin
2022-07-17 10:27                         ` Ihor Radchenko
2022-07-17 10:18                       ` Ihor Radchenko
2022-07-17 20:59                         ` [PATCH v6] " Hugo Heagren
2022-07-18 10:55                           ` Max Nikulin [this message]
2022-07-23  7:48                             ` [PATCH v7] " Hugo Heagren
2022-07-23  7:59                               ` Max Nikulin
2022-07-23 13:06                                 ` Ihor Radchenko
2022-07-23 15:46                                   ` Max Nikulin
2022-07-24 10:34                                   ` Max Nikulin
2022-07-24 13:15                                     ` Ihor Radchenko
2022-07-25 11:55                                       ` [PATCH v8] " Hugo Heagren
2022-07-29 12:54                                         ` Max Nikulin
2022-07-29 19:05                                           ` [PATCH v9] " Hugo Heagren
2022-07-30  6:29                                             ` Ihor Radchenko
     [not found]                                               ` <87tu6zf2o1.fsf@heagren.com>
2022-07-30  8:02                                                 ` Ihor Radchenko
2022-07-30 12:34                                                   ` [PATCH] ol-info: Enable :insert-description feature Max Nikulin
2022-08-06  7:00                                                     ` Ihor Radchenko
2022-08-14 16:41                                                       ` [PATCH v2] ol-info: Define :insert-description function Max Nikulin
2022-08-19  4:28                                                         ` Ihor Radchenko
2022-08-19 12:26                                                           ` Max Nikulin
2022-08-20  7:29                                                             ` Ihor Radchenko
2022-08-21 14:49                                                               ` Max Nikulin
2022-08-22  4:10                                                                 ` Ihor Radchenko
2022-08-24 14:37                                                                   ` [PATCH v3] " Max Nikulin
2022-08-26 13:15                                                                     ` Ihor Radchenko
2022-09-04 15:05                                                       ` [PATCH] ol-info: Enable :insert-description feature Max Nikulin
2022-09-05  6:36                                                         ` Ihor Radchenko
2022-08-06  6:06                                             ` [PATCH v9] ol.el: add description format parameter to org-link-parameters Ihor Radchenko
2022-07-29  1:47                               ` [PATCH v7] " Ihor Radchenko
2022-07-29  7:05                                 ` Bastien Guerry
2022-07-10 10:26               ` [PATCH v4] " Max Nikulin
2022-06-21 15:01           ` [PATCH v3] " Max Nikulin

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=47248a4f-10aa-0980-c054-563f30c05aaa@gmail.com \
    --to=manikulin@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=hugo@heagren.com \
    /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).