Re: [O] [OT] Re: capture with iceweasel/firefox -- nothing works

2016-06-04 Thread Philip Hudson
This is moving OT, but bear with me briefly please if you all would, I
do (kind of) get back to the OP's concerns at the end.

On 4 June 2016 at 21:53, Matt Lundin  wrote:
>
> I think it's
> important to note (for anyone thinking of investing time in setting it
> up) that conkeror's future is uncertain given Mozilla's planned
> deprecation of XUL, its abandonment of xulrunner, and its lack of
> official support for using Firefox's browser engine to run third party
> apps.

Sad but true. However, we can at least be sure that nobody can take
away the existing Firefox/Xulrunner code base. That's the glory of
freedom-respecting software. Forking it is easy. Maintaining it and
keeping feature-parity is another matter, of course.

> This is what a Mozilla developer said in response to a broken -app
> flag (which conkeror requires to run) in FF 48 nightly: "This bug isn't
> high on the official Mozilla priority list. We don't use -app or have
> any testing for it, so it's likely to break."[fn:1]

That made my heart stop. Thankfully, it seems they have found the bug,
and more importantly, they seem to have willingly put in the required
effort. Happily, they had the original author of the problematic code
on hand. The (very simple) fix is in review. Apparently the defect was
always there (for at least 5 years), but by luck never bit anyone
before.

> [fn:1] https://bugzilla.mozilla.org/show_bug.cgi?id=1271574

Could lispkit be the next best thing? This might meet the OP's
no-JavaScript requirement at least -- and even better, it's Lisp too
-- but it's WebKit-based (Safari's innards, rather than Firefox's) and
also keyboard-oriented. The Lisp is Common Lisp, not Emacs Lisp, which
is a Good Thing to my way of thinking but does mean there are a few
gotchas to watch out for coming from an Elisp background.

https://github.com/AeroNotix/lispkit

-- 
Phil Hudson   http://hudson-it.ddns.net
@UWascalWabbit PGP/GnuPG ID: 0x887DCA63



Re: [O] Restricting admisible tags depending on header

2016-06-04 Thread Óscar Fuentes
Óscar Fuentes  writes:

> I'll like to offer only certain tags depending on the contents of the
> current header. For instance, if the header is
>
> * Status
>
> I want to see only "open" and "closed" on the options shown by
> org-fast-tag-selection.
>
> Currently I define quite a lot of tags with #+TAGS:, most of them are
> intended to be assigned to a specific header. Having so many tags
> displayed by org-fast-tag-selection is confusing, error-prone and breaks
> the selection method (org-fast-tag-selection runs out of letters).
>
> I'm thinking on advising org-fast-tag-selection and prune the list of
> acceptable tags before calling the real function, but maybe there is a
> better method.

Thanks to all who responded, both off- and on-list.

At the end, I opted for advising org-fast-tag-selection. Now, for a
given heading, a tag group with the same name provides the admisible
tags:

#+TAGS: [ Status : { open closed }  ]
#+TAGS: [ Status : { done(d) postponed cancelled wontfix worksforme invalid } ]
#+TAGS: [ Type : { task defect enhancement feedback test } ]
#+TAGS: [ Severity : { critical major minor cosmetic } ]
#+TAGS: [ Priority : { top high medium low } ]

* Status
* Type
* Severity
* Priority


Code:

(defun ofv-issues-tags-for-heading (h)
  (setq h (org-no-properties h))
  (let (check-name-p collect-tags-p specific-tags)
(dolist (tag org-tag-alist)
  (cond
   ((eq (car tag) ':endgrouptag)
(setq collect-tags-p nil))
   ((eq (car tag) ':startgrouptag)
(setq check-name-p t))
   (collect-tags-p
(push tag specific-tags))
   (check-name-p
(setq collect-tags-p (equal (car tag) h))
(setq check-name-p nil
specific-tags))

(defun ofv-issues-org-fast-tag-selection (args)
  ;; The `table' parameter of `org-fast-tag-selection' contains a
  ;; uniquified list, which removes duplicated group tag names.
  ;; `ofv-issues-tags-for-heading' uses the contents of
  ;; `org-tag-alist'.
  (let ((specific-tags (ofv-issues-tags-for-heading (org-get-heading t t
(when specific-tags
  (setcar (nthcdr 2 args) (nreverse specific-tags
  args)

(advice-add 'org-fast-tag-selection :filter-args
'ofv-issues-org-fast-tag-selection)




[O] [OT] Re: capture with iceweasel/firefox -- nothing works

2016-06-04 Thread Matt Lundin
Philip Hudson  writes:

> On 4 June 2016 at 02:23, Samuel Wales  wrote:
>> over many years, i have been trying to get org-protocol (or
>> anything similar) to work, and it is not working reliably.
>> that's why i want this feature to work so much.
> ...
>>   *what is the most reliable set of instructions or code to
>>   get iceweasel to work with org?*
>
> Ordinarily my advice would be: Don't. Use Conkeror instead.
>
> However, I see that keyboard-orientation and JavaScript are exactly
> what you don't want, which is a pity. Org-capture from Conkeror is
> bulletproof for me, even with Emacs server running on a different host
> on the same LAN segment.
>
> Conkeror uses the same browser engine as Firefox, so some FF
> extensions work with it, but with an "Emacsified" keyboard-oriented
> front end (M-x, M-:, C-u, C-g, etc) -- all dynamically configurable
> and extensible, though in JavaScript not Elisp. The JavaScripting
> framework uses familiar Elisp idioms wherever possible, like hooks,
> `provide' and `require', for example.

Conkeror is great. I used it for over seven years. However, I think it's
important to note (for anyone thinking of investing time in setting it
up) that conkeror's future is uncertain given Mozilla's planned
deprecation of XUL, its abandonment of xulrunner, and its lack of
official support for using Firefox's browser engine to run third party
apps. This is what a Mozilla developer said in response to a broken -app
flag (which conkeror requires to run) in FF 48 nightly: "This bug isn't
high on the official Mozilla priority list. We don't use -app or have
any testing for it, so it's likely to break."[fn:1] Conkeror is still a
good browser, but if you switch to it, expect to find several broken
features (viewing page source and text files internally, managing
permissions, etc.) and more turbulence in the future.

Matt

[fn:1] https://bugzilla.mozilla.org/show_bug.cgi?id=1271574




Re: [O] default visibility of results drawer

2016-06-04 Thread Matt Lundin
John Kitchin  writes:

> Is it possible to get the default visibility of results drawers to be
> open?
>
> They are closed when I first open a file, and I have to manually open
> them to see the contents.
>

You can add "#+STARTUP: showeverything" to the top of a file. The
corresponding variable `org-startup-folded' will control this globally.

You can also type C-u C-u C-u Tab to open everything up in the buffer
quickly.

Matt



Re: [O] [PATCH] Make today's deadlines "close" without lead time

2016-06-04 Thread Nicolas Goaziou
Hello,

Don March  writes:

> Not at all. The new patch---which includes the original changes and the new
> tests---is attached. While I was in there, I made a second patch that renames
> the function to have a `-p' predicate suffix.

Applied. Thank you.

Regards,

-- 
Nicolas Goaziou



Re: [O] capture with iceweasel/firefox -- nothing works

2016-06-04 Thread Matt Lundin
Samuel Wales  writes:

> hi matt,
>
> thanks for your reply.
>
> On 6/3/16, Matt Lundin  wrote:
>> Here is the new style bookmark that works for me:
>>
>> javascript:location.href='org-protocol://capture?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(window.getSelection())
>>
>>
>> I'd recommend copying and pasting the javascript line above into the
>> location bar to confirm whether it works. If it does, you can then
>> easily add it to your bookmarks.
>
> will try.  this is supposed to imitate clicking on the unicorn or
> calling the bookmark?

This is the content of the bookmark. Pasting it into the location bar is
just a quick way to test if everything is working prior to saving it
permanently as a bookmark. But it might be easier to go straight to the
bookmark step (see below).

Do you mean clicking on the unicorn icon installed with this extension?

https://addons.mozilla.org/en-US/firefox/addon/org-mode-capture/

If you have installed that extension, I think everything should just
work with minimal configuration. The extension is distinct from the
bookmark method. The difference is that a bookmark is a bit more
universal. Once you get it set up the protocol system-wide, the bookmark
should work in any browser.

> however, i never found any good instructions on what to do to add js
> to bookmarks.

> i have a menu bar and a location bar + icons.  i'd like a button or
> icon on the latter if possible.  my previous thrashing around caused a
>>> symbol which is a drop down menu which contains the bookmarks.
> i'll settle for that if nec.  but that is extra clicking i'd rather
> avoid, and one of them brings up a page with js on it.

To save it as a bookmark in firefox, right click on the bookmark bar,
select "New Bookmark," and paste it into the Location field.

> do i try with selecting and without selecting?

The bookmark should work with and without selections.

> which capture key does it call?

This can be controlled with the emacs variable
`org-protocol-default-template-key'. You can also specify a template
shortcut by changing the bookmark. For instance, to call a template
designated by "x", you could use the following:

javascript:location.href='org-protocol://capture?template=x&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)+'&body='+encodeURIComponent(window.getSelection())

Matt



[O] default visibility of results drawer

2016-06-04 Thread John Kitchin
Is it possible to get the default visibility of results drawers to be
open?

They are closed when I first open a file, and I have to manually open
them to see the contents.

thanks!

-- 
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



Re: [O] lists in tables (latex export)

2016-06-04 Thread martin . guertler
Hi,

Some time ago I used such a feture in od export. I think it does exist
in ox-odt.el.

Regards,

Martin




Re: [O] capture with iceweasel/firefox -- nothing works

2016-06-04 Thread Philip Hudson
On 4 June 2016 at 02:23, Samuel Wales  wrote:
> over many years, i have been trying to get org-protocol (or
> anything similar) to work, and it is not working reliably.
> that's why i want this feature to work so much.
...
>   *what is the most reliable set of instructions or code to
>   get iceweasel to work with org?*

Ordinarily my advice would be: Don't. Use Conkeror instead.

However, I see that keyboard-orientation and JavaScript are exactly
what you don't want, which is a pity. Org-capture from Conkeror is
bulletproof for me, even with Emacs server running on a different host
on the same LAN segment.

Conkeror uses the same browser engine as Firefox, so some FF
extensions work with it, but with an "Emacsified" keyboard-oriented
front end (M-x, M-:, C-u, C-g, etc) -- all dynamically configurable
and extensible, though in JavaScript not Elisp. The JavaScripting
framework uses familiar Elisp idioms wherever possible, like hooks,
`provide' and `require', for example.

> i'd be grateful for any useful hints.

Maybe not for you given your no-JS/no-keyboard requirement, but for
others who find this thread:

* Use Conkeror:
http://conkeror.org
git clone git://repo.or.cz/conkeror.git
* Don't forget to compile the external-interface module:
http://conkeror.org/ConkerorSpawnHelper
(tl;dr: Just cd into the cloned repo and execute 'make')
* On an XDG-compliant system (most Unix-like OSes except OS X):
xdg-mime default conkeror.desktop x-scheme-handler/http
xdg-mime default conkeror.desktop x-scheme-handler/https
* On a debian-esque system:
sudo update-alternatives --config x-www-browser
* Expose Conkeror's JS innards using the 'MozREPL' FF extension:
http://conkeror.org/MozRepl
** Use Emacs to inspect, configure, drive and automate Conkeror:
 git clone 'https://github.com/bard/mozrepl.git'
 Elisp package 'moz.el' is in subdirectory 'chrome/content/'
** Use the 'bash' shell to inspect, configure, drive and automate Conkeror:
 git clone 'https://github.com/PhilHudson/bash-mozrepl.git'


WRT Org capture protocol for those who do use a desktop env:
# Support org-protocol on Gnome (and XFCE, MATE, etc):
dbus-launch gconftool-2 -s
/desktop/gnome/url-handlers/org-protocol/command \
'/usr/local/bin/emacsclient %s' --type String
dbus-launch gconftool-2 -s
/desktop/gnome/url-handlers/org-protocol/enabled \
--type Boolean true


-- 
Phil Hudson   http://hudson-it.ddns.net
@UWascalWabbit PGP/GnuPG ID: 0x887DCA63



Re: [O] Restricting admisible tags depending on header

2016-06-04 Thread John Kitchin
This looks more like TODO states to me.

You can do that on a file basis like this I think:

#+TODO: OPEN CLOSED

It is an interesting idea to make them heading specific though. I guess
you should store them in a property on the headline though.

Otherwise I would suggest using something like counsel-org-tag which
wouldn't have the same limitations.

Óscar Fuentes writes:

> I'll like to offer only certain tags depending on the contents of the
> current header. For instance, if the header is
>
> * Status
>
> I want to see only "open" and "closed" on the options shown by
> org-fast-tag-selection.
>
> Currently I define quite a lot of tags with #+TAGS:, most of them are
> intended to be assigned to a specific header. Having so many tags
> displayed by org-fast-tag-selection is confusing, error-prone and breaks
> the selection method (org-fast-tag-selection runs out of letters).
>
> I'm thinking on advising org-fast-tag-selection and prune the list of
> acceptable tags before calling the real function, but maybe there is a
> better method.


-- 
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



Re: [O] capture with iceweasel/firefox -- nothing works

2016-06-04 Thread tumashu
https://github.com/tumashu/org-capture-pop-frame

you can try above package


--
发自我的网易邮箱手机智能版


在 2016-06-04 09:23:09,"Samuel Wales"  写道:
>over many years, i have been trying to get org-protocol (or
>anything similar) to work, and it is not working reliably.
>
>intermittently, it says there is a greedy protocol.  the
>success rate of capturing is around 50% maybe.  when it is not
>working, it never works.  i have
>noticed no correlation with anything that could cause this.
>
>sometimes it captures bogus text when i just want the link,
>but i don't care about that.  at least it copied the link.
>
>i've tried:
>
>  1) org-capture firefox extension
>  2) a bookmark like this
> - 
> javascript:location.href%20=%20'org-protocol://capture-html://w/'%20+%20encodeURIComponent(location.href)%20+%20'/'%20+%20encodeURIComponent(document.title)%20+%20'/'%20+%20encodeURIComponent(function%20()%20{var%20html%20=%20"";%20if%20(typeof%20document.getSelection%20!=%20"undefined")%20{var%20sel%20=%20document.getSelection();%20if%20(sel.rangeCount)%20{var%20container%20=%20document.createElement("div");%20for%20(var%20i%20=%200,%20len%20=%20sel.rangeCount;%20i%20<%20len;%20++i)%20{container.appendChild(sel.getRangeAt(i).cloneContents());}%20html%20=%20container.innerHTML;}}%20else%20if%20(typeof%20document.selection%20!=%20"undefined")%20{if%20(document.selection.type%20==%20"Text")%20{html%20=%20document.selection.createRange().htmlText;}}%20var%20relToAbs%20=%20function%20(href)%20{var%20a%20=%20document.createElement("a");%20a.href%20=%20href;%20var%20abs%20=%20a.protocol%20+%20"//"%20+%20a.host%20+%20a.pathname%20+%20a.search%20+%20a.hash;%20a.remove();%20return%20abs;};%20var%20elementTypes%20=%20[['a',%20'href'],%20['img',%20'src']];%20var%20div%20=%20document.createElement('div');%20div.innerHTML%20=%20html;%20elementTypes.map(function(elementType)%20{var%20elements%20=%20div.getElementsByTagName(elementType[0]);%20for%20(var%20i%20=%200;%20i%20<%20elements.length;%20i++)%20{elements[i].setAttribute(elementType[1],%20relToAbs(elements[i].getAttribute(elementType[1])));}});%20return%20div.innerHTML;}());
>  3) a bookmark like this
> - 
> javascript:location.href='org-protocol://capture://L/'+encodeURIComponent(location.href)+'/'+encodeURIComponent(document.title)+'/'+encodeURIComponent(window.getSelection())
>  4) i know there's a new one that is supposed to capture
> format better (so you don't end up with a single
> paragraph when there were several paragraphs).  that
> sounds wonderful!  however, i am limited in computer
> use (4 minutes at a time), so i don't know if it is
> worth my trying or not.  i have to use those 4 minutes responsibly.
>  5) i followed various instructions
>
>i currently using iceweasel 38.8.0 (debian jessie) and
>emacs-version "24.4.1".
>
>i understand elisp and org.
>
>however, i don't understand javascript or org-protocol's
>internal concepts.  i am limited in concentration ability,
>so this could be a problem.  i am also hazy on how to set up
>a bookmark, but i somehow managed to do it twice.
>
>===
>
>i am very often physically unable to use a keyboard.  during
>these times i am often able to use a pointing device (2
>mouses, one for clicking and one for moving).
>
>i am often using firefox (iceweasel) and want to capture
>things to org using only the mouse.
>
>that's why i want this feature to work so much.
>
>===
>
>i want to use org-capture extension or similar so that i can
>copy snippets of text like this:
>
>  * [[link][descr]]
>  text that i selected
>  ---
>
>(the --- indicates that it came from iceweasel, and is not something i wrote.)
>
>or just the plain link like this if nothing is selected:
>
>  * [[link][descr]]
>
>i have this working.  it is just unreliable, failing randomly at random times.
>
>(note: i don't want emacs to pop up and there should be no keyboard
>interaction.  useful if emacs switches to the buffer it is saved to,
>however.  i have all that stuff taken care of in my elisp.  that part
>i understand and can fix by myself.)
>
>===
>
>i am stuck on this.
>
>after all that long-windedness, my question is this:
>
>  *what is the most reliable set of instructions or code to
>  get iceweasel to work with org?*
>
>i'd be grateful for any useful hints.
>
>thanks.
>
>
>samuel
>
>===
>
>here are just 2 of the many elisp-side things i tried over
>the years to get this to work.  elisp i can handle.
>
>  (setq org-capture-templates
>(append
> org-capture-templates
> `(
>   ("p" "Protocol" entry (file+headline ,(concat org-directory
>"notes.org") "Inbox")
>"* %^{Title}\nSource: %u, %c\n
>#+BEGIN_QUOTE\n%i\n#+END_QUOTE\n\n\n%?")
>   ("L" "Protocol Link" entry (file+headline ,(concat
>org-directory "notes.org") "Inbox")
>"* %? [[%:link][%:description]] \nCaptured On: %U")
>   )))
>  ;; --- 
> https://github.com/sprig/org-capture-extension#set-up-handlers-in-emacs
>
>  (cl-loop