emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Max Nikulin <manikulin@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: capturing and filling
Date: Fri, 7 Apr 2023 11:12:53 +0700	[thread overview]
Message-ID: <u0o587$423$1@ciao.gmane.io> (raw)
In-Reply-To: <CAJcAo8vmNXsmz1_EDLs-sTpmFUymLHy3fGjwAYMoyP8i7s1Etw@mail.gmail.com>

On 07/04/2023 10:29, Samuel Wales wrote:
> when i use the superb org-capture extension in firefox, there is only
> one icon, so any decisions about formatting have to be
> one-size-fits-all at capture time in elisp.

Samuel, in your case, it is your requirement to have non-distracting 
single-click capture.

I admit that the feature is not implemented in browser add-ons.

A workaround is to define 2 capture template: for prose text and for 
code. Browser extension should not add template=x query parameter to 
org-protocol URI.

Extension may determine if the captured text pre-formatting, however 
there are some complications. Besides <pre> and <code> tags, there may 
be <div> and <span> elements with white-space: pre-wrap CSS property and 
similar. Selection may consist of several regions, each one with mix of 
regular and pre-formatted text.

Actually it is possible to convert selected text to Org markup. use

     %(insert (shell-command-to-string "xclip -t text/html -o | pandoc 
-f html -t org -"))

in your capture template. Possible caveats: headers, especially <h1> may 
give undesired effect.



  reply	other threads:[~2023-04-07  4:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-07  3:29 capturing and filling Samuel Wales
2023-04-07  4:12 ` Max Nikulin [this message]
2023-04-07  4:40   ` Samuel Wales
2023-04-07  5:23     ` Max Nikulin
2023-04-15  1:36       ` Samuel Wales
2023-04-15  3:37         ` Max Nikulin
2023-04-17  7:00         ` Max Nikulin
2023-04-10  4:39 ` 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='u0o587$423$1@ciao.gmane.io' \
    --to=manikulin@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).