Re: idea for capture anywhere in x

2022-06-13 Thread Michal Politowski
Dnia Mon, 13 Jun 2022 17:04:46 +0700, Max Nikulin napisał(a):
> On 13/06/2022 16:10, Michal Politowski wrote:
> > 
> > $ xclip -selection clipboard -o -t text/x-moz-url-priv
> > https://orgmode.org/
> 
> Thank you for the trick.
> 
> Have you ever tried to set drag-n-drop handler for org buffers to invoke
> e.g. `org-store-link'? I mean dragging a link or URL from the address bar
> from a browser to an emacs window. I am curious how much information is
> available in such case.

No, I haven't. Sorry.

-- 
Michał Politowski
Talking has been known to lead to communication if practiced carelessly.



Re: idea for capture anywhere in x

2022-06-13 Thread Michal Politowski
Dnia Thu,  9 Jun 2022 19:35:52 -0700, Samuel Wales napisał(a):
[...]
> otoh, if there is such a thing as "a cli command that will ask firefox
> for its current url" then it is possible.

Not exactly this (and what is current with many windows and tabs?), but it 
seems that when Firefox
owns a selection, you can ask it not only for the text but also for the URL:

$ xclip -selection clipboard -o -t text/plain
A GNU Emacs major mode for keeping notes, authoring documents,
computational notebooks, literate programming, maintaining to-do lists,
planning projects, and more \u2014 in a fast and effective plain text
system.

$ xclip -selection clipboard -o -t text/x-moz-url-priv
https://orgmode.org/

$ xclip -selection clipboard -o -t TARGETS
TIMESTAMP
TARGETS
MULTIPLE
SAVE_TARGETS
text/html
text/_moz_htmlcontext
text/_moz_htmlinfo
UTF8_STRING
COMPOUND_TEXT
TEXT
STRING
text/plain;charset=utf-8
text/plain
text/x-moz-url-priv

-- 
Michał Politowski
Talking has been known to lead to communication if practiced carelessly.



Re: Changed list indentation behavior: how to revert?

2020-11-16 Thread Michal Politowski
On Mon, 16 Nov 2020 16:24:45 -0700, T.F. Torrey wrote:
[...]
> The proper fix for this is one of two choices:
> 
> 1. If keeping electric-indent-mode on is really important, the easiest
>way to restore intuitive behavior is to change the default of
>org-adapt-indentation to nil.  Yes, this changes a longstanding
>default, but it is necessitated because of the change of another
>longstanding default: electric-indent-mode.  Before, anyone who
>wanted text indented by default needed to specify that in their init
>file, so this should not inconvenience anyone who wasn't
>inconvenienced before.
> 
> or
> 
> 2. More involved would be to change the default behavior of Org's
>electric indentation so that typing  at the end of a heading
>takes you back to column 0 by default.  In many contexts, the
>indentation provided by org-auto-indent is useful, but not this
>one.

Or maybe?
3. Pair the electric indentation + org-adapt-indentation with electric asterisk
(actually more of an electric space) so that "* " removes the indentation.

So this is similar to conditional option 2. I do not think I really understand
the benefits of option 2. as is. Wouldn't it be doing a lot of work to just
unconditionally undo the work of electric indentation and o-a-i without actually
turning them off?

Finally, given how few people seem to have benefitted from or even noticed
org-adapt-indentation, option 1. does seem reasonable to this casual user
(who has o-a-i turned off almost accidentally, via org-indent-mode).

-- 
Michał Politowski
Talking has been known to lead to communication if practiced carelessly.



Re: bi-monthly steps.

2020-03-13 Thread Michal Politowski
Fortnightly :)
Such a useful word.

On Thu, 12 Mar 2020 18:55:16 -0400, Christian Hopps wrote:
> could use semimonth then :)
> 
> > On Mar 12, 2020, at 2:15 PM, Nick Dokos  wrote:
> > 
> > "Bi-monthly" is ambiguous: it can mean twice a month or it can mean
> > once every two months and there is no convincing anybody that their
> > use of it is wrong :-)
> > 
> > -- 
> > Nick
> > 
> > "There are only two hard problems in computer science: cache
> > invalidation, naming things, and off-by-one errors." -Martin Fowler

-- 
Michał Politowski
Talking has been known to lead to communication if practiced carelessly.



Re: [O] funny remote time/duration values

2019-01-07 Thread Michal Politowski
On Mon,  7 Jan 2019 11:29:15 +0100, Robert Klein wrote:
> 
> Hi,
> 
> when using values (time/duration) from a remote table I sometimes get
> funny values:
> 
> 
> #+name: teta
> | 4:50 |
> 
> 
> | 2:25 |
> #+TBLFM: @1$1=remote(teta,@1$1)
> 
> 
> When I set e.g. 7:50 in “teta” the same value shows up in the second
> table (after C-u C-c C-c).
> 
> For 1:00 in “teta” I get #ERROR in the second table.  same in all cases
> with a 0 in front (04:50, 07:50, 01:00).
> 
> 
> Org-version is 9.2
> 
> Any ideas?

It seems they are treated as (calc) fractions and simplified.

-- 
Michał Politowski



Re: [O] funny remote time/duration values

2019-01-07 Thread Michal Politowski
On Mon,  7 Jan 2019 11:29:15 +0100, Robert Klein wrote:
> 
> Hi,
> 
> when using values (time/duration) from a remote table I sometimes get
> funny values:
> 
> 
> #+name: teta
> | 4:50 |
> 
> 
> | 2:25 |
> #+TBLFM: @1$1=remote(teta,@1$1)
> 
> 
> When I set e.g. 7:50 in “teta” the same value shows up in the second
> table (after C-u C-c C-c).
> 
> For 1:00 in “teta” I get #ERROR in the second table.  same in all cases
> with a 0 in front (04:50, 07:50, 01:00).
> 
> 
> Org-version is 9.2
> 
> Any ideas?

It seems you need the 'T' flag here, as described in "Duration and time
values" in the org manual:

#+TBLFM: @1$1=remote(teta,@1$1);T

-- 
Michał Politowski



Re: [O] Bug: c++ code block automatically adds comma [8.2.10 (release_8.2.10 @ c:/Users/Louis/home/bin/emacs-24.5/share/emacs/24.5/lisp/org/)]

2017-10-23 Thread Michal Politowski
On Mon, 23 Oct 2017 12:15:29 +0200, Nicolas Goaziou wrote:
> Hello,
> 
> Michal Politowski <m...@meep.pl> writes:
> 
> > Interesting, even if not very likely to hit anyone, that lines
> > intentionally starting with ,,* are not escaped and thus
> > lose one comma on the next edit.
> 
> Could you provide an ECM?

I mean something like this. I'm new to org and don't know any practical
examples where it matters, but it's interesting.

#+BEGIN_EXAMPLE
  Start editing with C-c ' enter ,* and ,,* at the beginninng of the next two 
lines,
  end end editing with C-c ' - you get two identical lines.
#+END_EXAMPLE

-- 
Michał Politowski
Talking has been known to lead to communication if practiced carelessly.



Re: [O] Bug: c++ code block automatically adds comma [8.2.10 (release_8.2.10 @ c:/Users/Louis/home/bin/emacs-24.5/share/emacs/24.5/lisp/org/)]

2017-10-23 Thread Michal Politowski
On Sun, 22 Oct 2017 19:30:55 +0200, Nicolas Goaziou wrote:
> Hello,
> 
> Louis Strous  writes:
> 
> > When I edit a c++ code block using C-c ' and then finish the edit using
> > C-c ' again, then org-mode sometimes adds a comma to the code.
[...]
> > Note the appearance of a comma in front of the "*".
> >
> > 7. Press "C-c '" to edit the code block again.  The code displayed in
> > the "*Org Src *scratch*[ c++ ]*" buffer does not contain the comma:
> >
> > if (foo)
> >*foo = 3;
> >
> > 8. Press "C-c '" to finish the editing.  The code in the *scratch*
> > buffer still contains the comma.
> >
> > End of reproduction scenario.
> 
> See (info "(org) Literal examples"), fourth footnote

Interesting, even if not very likely to hit anyone, that lines
intentionally starting with ,,* are not escaped and thus
lose one comma on the next edit.

-- 
Michał Politowski
Talking has been known to lead to communication if practiced carelessly.



Re: [O] Tracking Interruptions -- Work Flow Question

2017-08-17 Thread Michal Politowski
On Sun, 13 Aug 2017 02:02:00 +, Raymond Zeitler wrote:
> Does anyone schedule and "org-clock" interruptions?  I really need to 
> quantify how much of a drain they are to my productivity.
> I thought I'd include a generic "** TODO Interruption" in my todo.org (or an 
> inter.org file) and schedule it every day.  Then I'd press "I" every time I 
> get interrupted and perhaps tag it with a special term.
> Or I suppose I could use a capture template just for interruptions.
> What do you suggest?

Haven't yet personally tried anything as elaborate as this, but 
http://doc.norang.ca/org-mode.html
describes a very complete personal workflow with, among other things, tracking 
interruptions via
capture templates.

-- 
Michał Politowski



Re: [O] %K template escape doesn't link to exact task headline

2017-07-13 Thread Michal Politowski
On Thu, 13 Jul 2017 14:27:11 +0200, Nicolas Goaziou wrote:
> Hello,
> 
> Michal Politowski <m...@meep.pl> writes:
> 
> > Hello everyone and thank you for the fascinating org mode,
> >
> > Is the behaviour of %K a bug in the documentation, in the implementation,
> > or just my unfounded expectation?
> >
> > It is supposed to link "to the currently clocked task" but it is implemented
> > in org-capture.el as
> >
> > (v-K (if (marker-buffer org-clock-marker)
> >   (org-make-link-string
> >(buffer-file-name (marker-buffer org-clock-marker))
> >org-clock-heading)))
> >
> > <http://orgmode.org/cgit.cgi/org-mode.git/tree/lisp/org-capture.el#n1611>
> >
> > which only puts the headline text in the link description,
> > the actual link is just to the task file - not what I would expect.
> 
> Fixed. Thank you.

Thank you. Wouldn't it be better to still have a link description though?
Probably both versions have advantages.

diff --git a/lisp/org-capture.el b/lisp/org-capture.el
index 44dbb7f96..7b880cf9a 100644
--- a/lisp/org-capture.el
+++ b/lisp/org-capture.el
@@ -1613,7 +1613,8 @@ The template may still contain \"%?\" for cursor 
positioning."
  (org-make-link-string
   (format "%s::%s"
   (buffer-file-name (marker-buffer org-clock-marker))
-  (org-no-properties org-clock-heading)))
+  (org-no-properties org-clock-heading))
+  (org-no-properties org-clock-heading))
""))
 (v-f (or (org-capture-get :original-file-nondirectory) ""))
 (v-F (or (org-capture-get :original-file) ""))


-- 
Michał Politowski



[O] %K template escape doesn't link to exact task headline

2017-07-13 Thread Michal Politowski
Hello everyone and thank you for the fascinating org mode,

Is the behaviour of %K a bug in the documentation, in the implementation,
or just my unfounded expectation?

It is supposed to link "to the currently clocked task" but it is implemented
in org-capture.el as

(v-K (if (marker-buffer org-clock-marker)
  (org-make-link-string
   (buffer-file-name (marker-buffer org-clock-marker))
   org-clock-heading)))



which only puts the headline text in the link description,
the actual link is just to the task file - not what I would expect.

-- 
Michał Politowski