Re: [O] #+SETUPFILE with #+TODO
Hi Nicolas On Thu, Nov 12, 2015 at 11:30 PM, Nicolas Goaziou wrote: > Michael Brand writes: >> With today's release_8.3.2-308-g6c1f63b when I open the attached >> org_todo_test.org when it is writable then the customized todo keyword >> CNCL is recognized, when the file is read only then not. I expect CNCL >> to be recognized as a todo keyword in both cases. > > I cannot reproduce the issue. I opened "org_todo_test.org" with > `find-file-read-only' and CNCL is properly fontified as a TODO keyword. Sorry, I meant the file permissions of "org_todo_test.org" set to r--r--r--, not `find-file-read-only'. Michael
Re: [O] Org Mode and PDF Notes!
On Thu, 12-11-2015, at 14:11, Matt Price wrote: >> > >> > M-: (pdf-annot-get-annots) and look at the output in the *Messages* >> > buffer. Can you see any evidence of the the text? Can you share what you >> > learned? >> >> Nope, no evidence of the text. I get things such as >> >> (((buffer . #) (page . 13) (edges >> 0.113553 0.31717 0.868657 0.361746) (type . highlight) (id . annot-13-0) >> (flags . 4) (color . "#00") (contents . "") (modified 22081 45188) >> (label . "TF201") (subject . "Highlight") (opacity . 1.0) ...) >> >> >> so we get the location of the highlight (and its properties), but not the >> textual contents. And this is the case whether I make the annotation with >> EzPDF or Okular or, for that matter, with pdf-tools itself. >> >> So it seems RepliGO is actually giving you a lot more by default :-) >> >> > Try replacing > > (text (assoc-default 'subject annot)) > > with > > (text (pdf-info-gettext page (assoc-default 'edges annot))) > > > in the lambda function in pdf-annot-markups-as-org-text. This will fail on > cropped pdfs if you have added highlights using the most recent pdf-tools, > which stores negative values in the 'edges field, but I've found it works > otherwise. I'd love to hear if it works for you too. (I know you're > following the relevant bug report on the pdf-tools github repo). It works! I get the highlighted text (I have just tried with a pdf I highlighted with EzPDF, the one that, above, was giving just the location and properties). And it still does the correct thing in your pdf (the one from repligo). Awesome! Thanks. R. -- Ramon Diaz-Uriarte Department of Biochemistry, Lab B-25 Facultad de Medicina Universidad Autónoma de Madrid Arzobispo Morcillo, 4 28029 Madrid Spain Phone: +34-91-497-2412 Email: rdia...@gmail.com ramon.d...@iib.uam.es http://ligarto.org/rdiaz
Re: [O] Org Mode and PDF Notes!
On Thu, 12-11-2015, at 15:28, Matt Lundin wrote: > Ramon Diaz-Uriarte writes: > >> >> so we get the location of the highlight (and its properties), but not the >> textual contents. And this is the case whether I make the annotation with >> EzPDF or Okular or, for that matter, with pdf-tools itself. >> >> So it seems RepliGO is actually giving you a lot more by default :-) >> >>> >>> Politza and I are discussing this here: >>> https://github.com/politza/pdf-tools/issues/137 >>> >>> that might be a good place to ocntinue the conversation. >>> >> >> I'll do. In the meantime, I think this is a limitation coming from >> poppler. Other people have mentioned similar things (e.g., >> http://coda.caseykuhlman.com/entries/2014/pdf-extract.html) and using other >> tools that depend on poppler (such as Leela: >> https://github.com/TrilbyWhite/Leela) also will not give us the text >> itself. > > I don't think this is a limitation of poppler so much as the way that > pdf annotations work. Typically, the subject/text field is not populated > by the text of the highlighted region. Rather, a highlight annotation > specifies bounds, color, style, etc. Basically what Repligo does (I > wouldn't recommend using it, as it is closed source and severely out of > date) is to grab the text *at the time of highlighting* and add it to > the notes field. I don't know of any other annotation tool that does the > same thing. Applications built on poppler could do it, though they > currently do not. I stand corrected. You are right; sorry for the sloppiness in the wording and ideas. > > For extracting the text of highlighted regions *after the fact*, I've > had good luck with this script that relies on the pdf-reader gem for > ruby: > > https://gist.github.com/danlucraft/5277732 That is also what I use for extracting the text from the highlighted regions. R. > > Matt -- Ramon Diaz-Uriarte Department of Biochemistry, Lab B-25 Facultad de Medicina Universidad Autónoma de Madrid Arzobispo Morcillo, 4 28029 Madrid Spain Phone: +34-91-497-2412 Email: rdia...@gmail.com ramon.d...@iib.uam.es http://ligarto.org/rdiaz
Re: [O] Org Mode and PDF Notes!
On Thu, 12-11-2015, at 23:52, Matt Price wrote: > On Thu, Nov 12, 2015 at 9:28 AM, Matt Lundin wrote: > >> Ramon Diaz-Uriarte writes: >> > >> > I'll do. In the meantime, I think this is a limitation coming from >> > poppler. Other people have mentioned similar things (e.g., >> > http://coda.caseykuhlman.com/entries/2014/pdf-extract.html) and using >> other >> > tools that depend on poppler (such as Leela: >> > https://github.com/TrilbyWhite/Leela) also will not give us the text >> > itself. >> >> I don't think this is a limitation of poppler so much as the way that >> pdf annotations work. Typically, the subject/text field is not populated >> by the text of the highlighted region. Rather, a highlight annotation >> specifies bounds, color, style, etc. Basically what Repligo does (I >> wouldn't recommend using it, as it is closed source and severely out of >> date) is to grab the text *at the time of highlighting* and add it to >> the notes field. I don't know of any other annotation tool that does the >> same thing. Applications built on poppler could do it, though they >> currently do not. >> >> For extracting the text of highlighted regions *after the fact*, I've >> had good luck with this script that relies on the pdf-reader gem for >> ruby: >> >> https://gist.github.com/danlucraft/5277732 >> >> This looks interesting. It searches for file "./markup_receiver", but > doesn't provide that file, which does not appear to be a gem. Any hints? I think I got it from https://www.omniref.com/github/danlucraft/pyranine/HEAD/files/lib/pyranine/markup_receiver.rb > > With politza's help am getting close to being able to extract annotation > text from within pdf-tools, but am not quite there yet. Neat! R. > > >> Matt >> -- Ramon Diaz-Uriarte Department of Biochemistry, Lab B-25 Facultad de Medicina Universidad Autónoma de Madrid Arzobispo Morcillo, 4 28029 Madrid Spain Phone: +34-91-497-2412 Email: rdia...@gmail.com ramon.d...@iib.uam.es http://ligarto.org/rdiaz
Re: [O] Org Mode and PDF Notes!
On Thu, Nov 12, 2015 at 9:28 AM, Matt Lundin wrote: > Ramon Diaz-Uriarte writes: > > > > I'll do. In the meantime, I think this is a limitation coming from > > poppler. Other people have mentioned similar things (e.g., > > http://coda.caseykuhlman.com/entries/2014/pdf-extract.html) and using > other > > tools that depend on poppler (such as Leela: > > https://github.com/TrilbyWhite/Leela) also will not give us the text > > itself. > > I don't think this is a limitation of poppler so much as the way that > pdf annotations work. Typically, the subject/text field is not populated > by the text of the highlighted region. Rather, a highlight annotation > specifies bounds, color, style, etc. Basically what Repligo does (I > wouldn't recommend using it, as it is closed source and severely out of > date) is to grab the text *at the time of highlighting* and add it to > the notes field. I don't know of any other annotation tool that does the > same thing. Applications built on poppler could do it, though they > currently do not. > > For extracting the text of highlighted regions *after the fact*, I've > had good luck with this script that relies on the pdf-reader gem for > ruby: > > https://gist.github.com/danlucraft/5277732 > > This looks interesting. It searches for file "./markup_receiver", but doesn't provide that file, which does not appear to be a gem. Any hints? With politza's help am getting close to being able to extract annotation text from within pdf-tools, but am not quite there yet. > Matt >
Re: [O] [PATCH] ox-html.el ox.el: added list of figures support in html backend
Hello, Joost Helberg writes: > this patch adds the list of figures to the html export backend. It also > includes a translation entry-point for the label "List of Figures" with > already one translation in: dutch. Thank you. > From fab9105d04e5cb9f923c17d322d84a25527ec27a Mon Sep 17 00:00:00 2001 > From: Joost Helberg > Date: Sun, 8 Nov 2015 14:34:11 +0100 > Subject: [PATCH] ox-html.el: added list of figures support in html > backend It should be ox-html: Add list of figures > * lisp/ox-html.el (org-html-list-of-figures): new, similar to > org-html-list-of-tables but with tables replaced by figures. This is, indeed, almost the same as `org-html-list-of-tables' and `org-html-list-of-listings'. I suggest to refactor the 3 functions to use a generic one. Also please use a recent version of `org-html-list-of-tables' since yours contain deprecated code (e.g., `org-export-solidify-link-text'). > (org-html-list-of-tables): added mapping keyword "figures" > to new function org-html-list-of-figures. You can remove this. > ox.el: added label for "list of figures" Ditto. > * lisp/ox.el (org-export-dictionary): Added label for List of > Figures with dutch translation You need to add TINYCHANGE at the end of the commit message, if you haven't signed FSF papers yet. > +(defun org-html-list-of-figures (info) > + "Build a list of figures. > +INFO is a plist used as a communication channel. Return the list > +of figures as a string, or nil if it is empty." > + (let ((lol-entries (org-export-collect-figures info nil))) (org-export-collect-figures info nil) is rather sloppy. It collects all paragraphs with a caption. Is it a proper definition for "figures"? Regards, -- Nicolas Goaziou
Re: [O] #+SETUPFILE with #+TODO
Hello, Michael Brand writes: > With today's release_8.3.2-308-g6c1f63b when I open the attached > org_todo_test.org when it is writable then the customized todo keyword > CNCL is recognized, when the file is read only then not. I expect CNCL > to be recognized as a todo keyword in both cases. I cannot reproduce the issue. I opened "org_todo_test.org" with `find-file-read-only' and CNCL is properly fontified as a TODO keyword. Regards, -- Nicolas Goaziou
Re: [O] Error when using `org-table-field-info'
Hello, Junpeng Qiu writes: > Here is an example to reproduce the error: > > | 1 | | > #+TBLFM: $2=$1 > > When I invoke `org-table-field-info' in the table above, I got following > error: > args-out-of-range [nil 0] 2 > > Am I not supposed to use the table like this? Fixed. Thank you. Regards, -- Nicolas Goaziou
Re: [O] [PATCH] ox-extra.el: Fix filtering of latex header blocks
Hi Kyle, you're completely right. This is a bug in the provided patch. I've thought I had submitted another patch to fix that, but it seems that it got lost somewhere on the interwebs. It took some time until I've realized this. I've submitted an new patch already. Thanks. -Sebastian
Re: [O] [PATCH] ox-extra.el: Fix filtering of latex header blocks
Hi Aaron, thanks for the tip with (org-element-property :value X). I also got rid of the let*. Actually, the previous patch is buggy and I've thought had submitted another patch to fix that. But unfortunately it seems it got lost in the interwebs. Best wishes, Sebastian >From a814380158de6185747975848533e3bd6e675afd Mon Sep 17 00:00:00 2001 From: Sebastian Christ Date: Thu, 12 Nov 2015 19:23:05 +0100 Subject: [PATCH] ox-extra.el: Fix filtering of latex header blocks * contrib/lisp/ox-extra.el (org-latex-header-blocks-filter): Use `org-element' API to find beginning, end and contents of latex header blocks. `org-latex-header-blocks-filter' still called `org-edit-src-find-region-and-lang' and raised an undefined function error because the funtion was removed from org-mode. This is fixed by determining the begin and end of the latex block via `org-element'. --- contrib/lisp/ox-extra.el | 29 - 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/contrib/lisp/ox-extra.el b/contrib/lisp/ox-extra.el index e6d45cc..232f623 100644 --- a/contrib/lisp/ox-extra.el +++ b/contrib/lisp/ox-extra.el @@ -60,7 +60,7 @@ (defun org-latex-header-blocks-filter (backend) (when (org-export-derived-backend-p backend 'latex) -(let ((positions +(let ((blocks (org-element-map (org-element-parse-buffer 'greater-element nil) 'export-block (lambda (block) (when (and (string= (org-element-property :type block) "LATEX") @@ -69,23 +69,18 @@ "yes")) (list (org-element-property :begin block) (org-element-property :end block) - (org-element-property :post-affiliated block))) - (mapc (lambda (pos) - (goto-char (nth 2 pos)) - (destructuring-bind - (beg end &rest ignore) - (org-edit-src-find-region-and-lang) - (let ((contents-lines (split-string - (buffer-substring-no-properties beg end) - "\n"))) - (delete-region (nth 0 pos) (nth 1 pos)) - (dolist (line contents-lines) - (insert (concat "#+latex_header: " -(replace-regexp-in-string "\\` *" "" line) -"\n")) - ;; go in reverse, to avoid wrecking the numeric positions + (org-element-property :value block))) + (mapc (lambda (block) + (goto-char (nth 0 block)) + (let ((contents-lines (split-string (nth 2 block) "\n" t))) +(delete-region (nth 0 block) (nth 1 block)) +(dolist (line contents-lines) + (insert (concat "#+latex_header: " + (replace-regexp-in-string "\\` *" "" line) + "\n") + ;; go in reverse, to avoid wrecking the numeric blocks ;; earlier in the file - (reverse positions) + (reverse blocks) ;; During export headlines which have the "ignore" tag are removed -- 2.6.3
Re: [O] Bug: org-babel-tangle error. org-babel-get-header undefined [8.3.2 (release_8.3.2-317-gbd921f @ /home/swflint/.emacs.d/org-mode/lisp/)]
> Kyle Meyer writes: KM> "Samuel W. Flint" writes: [...] >>> In your org-babel-do-load-languages call, try to changing >>> >>> (sh . t) >>> >>> to >>> >>> (shell . t) >>> >>> -- Kyle >>> >>> >> >> I went ahead and tried that. I still get that error. KM> Hmm, and that was after Emacs was restarted? Nope. Should have thought of that. Figures. That'll probably be all that it is. Thanks. Sam KM> Here is why I suggested that. As of Org 8.2, ob-sh was renamed to KM> ob-shell. The NEWS file contained this: KM> *** =ob-sh.el= renamed to =ob-shell= This may require two KM> changes in user config. KM> 1. In =org-babel-do-load-languages=, change =(sh . t)= to KM> =(shell . t)=. 2. Edit =local.mk= files to change the value of KM> =BTEST_OB_LANGUAGES= to remove "sh" and include "shell". KM> If you didn't do this (as I didn't), you wouldn't necessarily KM> notice, because org-babel-do-load-languages ends up loading the old KM> ob-sh.el that ships with Emacs. As the builtin ob-sh.el and babel KM> diverged, there were very likely subtle and perhaps not-so-subtle KM> bugs, but the blocks would execute until recently. Execution now KM> fails because org-babel-get-header was removed in 0d000f5 (babel: KM> small change in API., 2015-10-29), but the old ob-sh.el is still KM> trying to call it. KM> Based on the configuration you included, you do need to change (sh KM> . t) to (shell . t), but perhaps there is still some other issue KM> going on. If a restart with the previous suggestion doesn't fix it, KM> please try to put together a minimal Org file and configuration that KM> will reproduce the issue with emacs -Q. KM> -- Kyle -- Samuel W. Flint 4096R/266596F4 (9477 D23E 389E 40C5 2F10 DE19 68E5 318E 2665 96F4) (λs.s s) λs.s s signature.asc Description: PGP signature
Re: [O] Bug: org-babel-tangle error. org-babel-get-header undefined [8.3.2 (release_8.3.2-317-gbd921f @ /home/swflint/.emacs.d/org-mode/lisp/)]
"Samuel W. Flint" writes: > On Thu, November 12, 2015 11:36 am, Kyle Meyer wrote: >> Hello, >> >> swfl...@flintfam.org (Samuel W. Flint) writes: >> >>> Hey all! >>> >>> In an attempt to keep my config file organized, I've been using org. As >>> of a fairly recent update, when I tangle the document (C-c C-v C-t), I >>> get the following error "Symbol's function definition is void: >>> org-babel-get-header". I have no idea why this is happening. I've >>> attached a backtrace. >>> >>> TIA, >>> >>> Sam >> >> In your org-babel-do-load-languages call, try to changing >> >> (sh . t) >> >> to >> >> (shell . t) >> >> -- >> Kyle >> >> > > I went ahead and tried that. I still get that error. > I don't know what the underlying cause might be, but you might be able to cure the symptom by doing M-x load-library RET ob-core RET which is where org-babel-get-header is defined. If that works, then it's likely that a (require 'ob-core) is missing somewhere. -- Nick
Re: [O] Bug: org-babel-tangle error. org-babel-get-header undefined [8.3.2 (release_8.3.2-317-gbd921f @ /home/swflint/.emacs.d/org-mode/lisp/)]
"Samuel W. Flint" writes: [...] >> In your org-babel-do-load-languages call, try to changing >> >> (sh . t) >> >> to >> >> (shell . t) >> >> -- >> Kyle >> >> > > I went ahead and tried that. I still get that error. Hmm, and that was after Emacs was restarted? Here is why I suggested that. As of Org 8.2, ob-sh was renamed to ob-shell. The NEWS file contained this: *** =ob-sh.el= renamed to =ob-shell= This may require two changes in user config. 1. In =org-babel-do-load-languages=, change =(sh . t)= to =(shell . t)=. 2. Edit =local.mk= files to change the value of =BTEST_OB_LANGUAGES= to remove "sh" and include "shell". If you didn't do this (as I didn't), you wouldn't necessarily notice, because org-babel-do-load-languages ends up loading the old ob-sh.el that ships with Emacs. As the builtin ob-sh.el and babel diverged, there were very likely subtle and perhaps not-so-subtle bugs, but the blocks would execute until recently. Execution now fails because org-babel-get-header was removed in 0d000f5 (babel: small change in API., 2015-10-29), but the old ob-sh.el is still trying to call it. Based on the configuration you included, you do need to change (sh . t) to (shell . t), but perhaps there is still some other issue going on. If a restart with the previous suggestion doesn't fix it, please try to put together a minimal Org file and configuration that will reproduce the issue with emacs -Q. -- Kyle
Re: [O] truncated footnote
thank you.
Re: [O] Bug: org-babel-tangle error. org-babel-get-header undefined [8.3.2 (release_8.3.2-317-gbd921f @ /home/swflint/.emacs.d/org-mode/lisp/)]
On Thu, November 12, 2015 11:36 am, Kyle Meyer wrote: > Hello, > > swfl...@flintfam.org (Samuel W. Flint) writes: > >> Hey all! >> >> In an attempt to keep my config file organized, I've been using org. As >> of a fairly recent update, when I tangle the document (C-c C-v C-t), I >> get the following error "Symbol's function definition is void: >> org-babel-get-header". I have no idea why this is happening. I've >> attached a backtrace. >> >> TIA, >> >> Sam > > In your org-babel-do-load-languages call, try to changing > > (sh . t) > > to > > (shell . t) > > -- > Kyle > > I went ahead and tried that. I still get that error. Thanks, Sam
Re: [O] Org Mode and PDF Notes!
Matt Price writes: > On Wed, Nov 11, 2015 at 12:09 PM, Memnon Anon < > memnon+use...@freeshell.org> wrote: > > http://planet.emacsen.org/\ > > But I can't figure out how to add my blog to the list there! Can you > tell me the secret? http://edward.oconnor.cx/2009/11/planet-emacsen-turns-3 , | If you’d like me to add your Emacs feed to Planet Emacsen, send me an | email [mailto:hob...@gmail.com] and I’ll get right on it. ` While you are at it, please ask him to put that info somewhere more visible on the site itself... -- /---\ | SDF and SDF-EU Public Access UNIX System | | http://sdf.org || http://sdf-eu.org | =
Re: [O] Bug: org-babel-tangle error. org-babel-get-header undefined [8.3.2 (release_8.3.2-317-gbd921f @ /home/swflint/.emacs.d/org-mode/lisp/)]
Hello, swfl...@flintfam.org (Samuel W. Flint) writes: > Hey all! > > In an attempt to keep my config file organized, I've been using org. As > of a fairly recent update, when I tangle the document (C-c C-v C-t), I > get the following error "Symbol's function definition is void: > org-babel-get-header". I have no idea why this is happening. I've > attached a backtrace. > > TIA, > > Sam In your org-babel-do-load-languages call, try to changing (sh . t) to (shell . t) -- Kyle
[O] Bug: org-babel-tangle error. org-babel-get-header undefined [8.3.2 (release_8.3.2-317-gbd921f @ /home/swflint/.emacs.d/org-mode/lisp/)]
Hey all! In an attempt to keep my config file organized, I've been using org. As of a fairly recent update, when I tangle the document (C-c C-v C-t), I get the following error "Symbol's function definition is void: org-babel-get-header". I have no idea why this is happening. I've attached a backtrace. TIA, Sam signature.asc Description: PGP signature Debugger entered--Lisp error: (void-function org-babel-get-header) (org-babel-get-header params :var) (mapcar (function cdr) (org-babel-get-header params :var)) (mapcar (function (lambda (pair) (format "%s=%s" (car pair) (org-babel-sh-var-to-sh (cdr pair) sep (mapcar (function cdr) (org-babel-get-header params :var))) (let ((sep (cdr (assoc :separator params (mapcar (function (lambda (pair) (format "%s=%s" (car pair) (org-babel-sh-var-to-sh (cdr pair) sep (mapcar (function cdr) (org-babel-get-header params :var org-babel-variable-assignments:sh(((:colname-names) (:rowname-names) (:result-params "replace") (:result-type . value) (:comments . "noweb") (:shebang . "#!/bin/zsh") (:cache . "no") (:padline . "") (:noweb . "tangle") (:tangle . "~/bin/ediff") (:exports . "code") (:results . "replace") (:tangle-mode . 493) (:hlines . "no") (:session . "none"))) funcall(org-babel-variable-assignments:sh ((:colname-names) (:rowname-names) (:result-params "replace") (:result-type . value) (:comments . "noweb") (:shebang . "#!/bin/zsh") (:cache . "no") (:padline . "") (:noweb . "tangle") (:tangle . "~/bin/ediff") (:exports . "code") (:results . "replace") (:tangle-mode . 493) (:hlines . "no") (:session . "none"))) (and (fboundp assignments-cmd) (funcall assignments-cmd params)) (org-babel-expand-body:generic body params (and (fboundp assignments-cmd) (funcall assignments-cmd params))) (if (fboundp expand-cmd) (funcall expand-cmd body params) (org-babel-expand-body:generic body params (and (fboundp assignments-cmd) (funcall assignments-cmd params (if (assoc :no-expand params) body (if (fboundp expand-cmd) (funcall expand-cmd body params) (org-babel-expand-body:generic body params (and (fboundp assignments-cmd) (funcall assignments-cmd params) (let* ((body (if (org-babel-noweb-p params :tangle) (org-babel-expand-noweb-references info) (nth 1 info))) (body (if (assoc :no-expand params) body (if (fboundp expand-cmd) (funcall expand-cmd body params) (org-babel-expand-body:generic body params (and (fboundp assignments-cmd) (funcall assignments-cmd params))) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert body) (if (string-match "-r" extra) (progn (goto-char ...) (while ... ...))) (run-hooks (quote org-babel-tangle-body-hook)) (buffer-string)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)) (let* ((info (org-babel-get-src-block-info)) (start-line (save-restriction (widen) (+ 1 (line-number-at-pos (point) (file (buffer-file-name (buffer-base-buffer))) (src-lang (nth 0 info)) (params (nth 2 info)) (extra (nth 3 info)) (cref-fmt (or (and (string-match "-l \"\\(.+\\)\"" extra) (match-string 1 extra)) org-coderef-label-format)) (link (let ((link (org-no-properties (org-store-link nil (and (string-match org-bracket-link-regexp link) (match-string 1 link (source-name (intern (or (nth 4 info) (format "%s:%d" (or (condition-case nil ... ...) "No heading") block-counter (expand-cmd (intern (concat "org-babel-expand-body:" src-lang))) (assignments-cmd (intern (concat "org-babel-variable-assignments:" src-lang))) (body (let* ((body (if (org-babel-noweb-p params :tangle) (org-babel-expand-noweb-references info) (nth 1 info))) (body (if (assoc :no-expand params) body (if ... ... ... (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ... ... ... ...) (and ... ...)) (comment (if (or (string= "both" (cdr (assoc :comments params))) (string= "org" (cdr (assoc :comments params (progn (funcall org-babel-process-comment-text (buffer-substring (max ... ...) (point)) (result (list start-line file link source-name params body comment))) (if only-this-block (list (cons src-lang (list result))) result)) org-babel-tangle-single-block(1) (let ((by-lang (assoc src-lang blocks)) (block (org-babel-tangle-single-block counter))) (if by-lang (setcdr by-lang (cons block (cdr by-lang))) (setq blocks (cons (cons src-lang (list block)) blocks (if (or (string= (cdr (assq :tangle (nth 2 info))) "no") (and tangle-file (not (equal tangle-file src-tfile))) (and language (not (string= language src-lang nil (let ((by-lang (assoc src-lang blocks)) (block (org-babel-tangle-single-block counter))) (if by-lang (setcdr by-lang (cons block (cdr by-lang))) (setq blocks (cons (cons src-lang (list block)) blocks) (let* ((info (org-babel-get-src-block-info (quote light))) (src-lang (nth 0 info)) (src-tfile (
Re: [O] [PATCH 5/8] ox-taskjuggler.el: add 'org-taskjuggler-multivalued-property'
Rasmus writes: > Kosyrev Serge <_deepf...@feelingofgreen.ru> writes: >> +(defun org-taskjuggler-multivalued-property (property element) >> + "Obtain PROPERTY of ELEMENT, treating it as a multi-valued property. > > Isn't the docstring a bit tautological? Does property mean the same in > the beginning and the end of the sentence? Sorry if I’m missing something > obvious here... The first occurence "binds" the parameter name within the semantic structure of the sentence, so to speak, whereas the second one provides the description of what is done to the obtained entity. Coming from the Common Lisp background, the uppercased argument names are often used for this kind of semantic "binding", and in these cases the need to explain what is done to the "bound" names isn't obviated. It's merely a cultural default, so I have no particularly strong feeling about the docstring. If you have a better idea, we can discuss that : -) -- с уважениeм, Косырев Сергей руководитель отдела технологий виртуализации Positive Technologies
Re: [O] html export: what do codehighlighton/off functions do?
Manuel Koell writes: > Can someone please tell me what these functions do? > > ``` > > function CodeHighlightOn(elem, id) { var target = > document.getElementById(id); if(null != target) { > elem.cacheClassElem = elem.className; elem.cacheClassTarget = > target.className; target.className = "code-highlighted"; > elem.className = "code-highlighted"; } } function > CodeHighlightOff(elem, id) { var target = > document.getElementById(id); if(elem.cacheClassElem) > elem.className = elem.cacheClassElem; if(elem.cacheClassTarget) > target.className = elem.cacheClassTarget; } > > > ``` > > The only thing I could think of is to toggle some classes, but I can't seem > to find some real world example out there. This javascript code is included > on every export, doesn't matter if you've src/example blocks in your org > file or not. It is used for "coderefs" links. Example from unit tests: #+BEGIN_SRC emacs-lisp (+ 1 1) (ref:sc) #+END_SRC [[(sc)]] It will highlight the appropriate line in the html export. Are you asking us to remove the javascript conditionally on whether we think it will be used? This sounds hard. You can remove the JS via the buffer option html-scripts or via org-html-head-include-scripts. Hope it helps, Rasmus -- I hear there's rumors on the, uh, Internets. . .
Re: [O] [PATCH 5/8] ox-taskjuggler.el: add 'org-taskjuggler-multivalued-property'
Kosyrev Serge <_deepf...@feelingofgreen.ru> writes: > * ox-taskjuggler.el (org-taskjuggler-multivalued-property): new function > to operate on multivalued properties. > --- > contrib/lisp/ox-taskjuggler.el | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git a/contrib/lisp/ox-taskjuggler.el b/contrib/lisp/ox-taskjuggler.el > index 82aaa7e..8036af3 100644 > --- a/contrib/lisp/ox-taskjuggler.el > +++ b/contrib/lisp/ox-taskjuggler.el > @@ -836,6 +836,16 @@ channel." > ;; Closing report. > "}\n")) > > +(defun org-taskjuggler-multivalued-property (property element) > + "Obtain PROPERTY of ELEMENT, treating it as a multi-valued property. Isn't the docstring a bit tautological? Does property mean the same in the beginning and the end of the sentence? Sorry if I’m missing something obvious here... -- Vote for proprietary math!
Re: [O] [PATCH 8/8] ox-taskjuggler.el: allow trimming the task ID from its title
Kosyrev Serge <_deepf...@feelingofgreen.ru> writes: > * ox-taskjuggler.el (org-taskjuggler-trim-ids-from-titles): new custom You should capitalize after the colon and end with a period. Also, custom → defcustom (IMO). > (org-taskjuggler--build-task): trim task ids from titles, when the new > custom variable asks for this (enabled by default). As above. > +(defcustom org-taskjuggler-trim-ids-from-titles t > + "Non-NIL trims the part detected as prefix from resulting task titles." > + :group 'org-export-taskjuggler > + :type 'boolean) I don’t think you need to capitalize nil. Also, why is it plural? > ;;; Hooks > @@ -887,9 +892,16 @@ a unique id will be associated to it." >(- org-lowest-priority > org-highest-priority) > (concat > ;; Opening task. > - (format "task %s \"%s\" {\n" > - (org-taskjuggler-get-id task info) > - (org-taskjuggler-get-name task)) > + (let* ((id (org-taskjuggler-get-id task info)) > + (raw-name (org-taskjuggler-get-name task)) > + (id-len (length id)) > + (raw-name-len (length raw-name)) > + (name (if org-taskjuggler-trim-ids-from-titles > + (if (= raw-name-len id-len) > + raw-name > + (subseq raw-name (1+ id-len))) > + raw-name))) I would use eq, but I’m not sure it’s important. Why does org-taskjuggler-get-name potentially return the ID? Isn’t that closer to the misbehavior here? (Keep in mind I’m not familiar with the codebase in question). Rasmus -- And I faced endless streams of vendor-approved Ikea furniture. . .
Re: [O] [PATCH 2/8] ox-taskjuggler.el: factor 'org-export-map-special-nodes'
Kosyrev Serge <_deepf...@feelingofgreen.ru> writes: > * ox-taskjuggler.el (org-taskjuggler-map-special-nodes): > new function to capture mapping over tagged special nodes. > (org-taskjuggler-project-plan): factor to use the new function. > ;;; Translator Functions > +(defun org-taskjuggler-map-special-nodes (tag tree f) > + (org-element-map tree 'headline > +(lambda (hl) > + (and (member tag (org-export-get-tags hl info)) Should it look care about case? Otherwise member-ignore-case. > + (funcall f hl))) > +info nil 'headline)) > (defun org-taskjuggler-project-plan (contents info) >"Build TaskJuggler project plan. > @@ -647,13 +653,10 @@ Return complete project plan as a string in TaskJuggler > syntax." > ;; `org-taskjuggler-resource-tag'. Only gather top level > ;; resources. > (apply 'append > - (org-element-map tree 'headline > - (lambda (hl) > - (and (member org-taskjuggler-resource-tag > -(org-export-get-tags hl info)) > -(org-element-map (org-element-contents hl) > 'headline > - 'identity info nil 'headline))) > - info nil 'headline > + (org-taskjuggler-map-special-nodes > + org-taskjuggler-resource-tag tree > + (lambda (hl) (org-element-map (org-element-contents hl) > 'headline > + 'identity info nil 'headline)) Do you need org-taskjuggler-map-special-nodes elsewhere (sorry, I can’t keep all of your patches in mind at the same time)? Rasmus -- ツ
Re: [O] [PATCH] ox-taskjuggler.el: allow direct 'depends' specification
Aaron Ecay writes: > Hi Kosyrev, > > 2015ko azaroak 8an, Kosyrev Serge-ek idatzi zuen: >> >> * ox-taskjuggler.el (org-taskjuggler-valid-task-attributes): add depends >> to the list of valid task attributes >> --- >> contrib/lisp/ox-taskjuggler.el | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/contrib/lisp/ox-taskjuggler.el b/contrib/lisp/ox-taskjuggler.el >> index 2bd47e6..cfb28f2 100644 >> --- a/contrib/lisp/ox-taskjuggler.el >> +++ b/contrib/lisp/ox-taskjuggler.el >> @@ -301,7 +301,7 @@ but before any resource and task declarations." >>:type '(string :tag "Preamble")) >> >> (defcustom org-taskjuggler-valid-task-attributes > > Is this an open-ended list that an average user could meaningfully add > to? If not, perhaps it should be a defconst. (I don’t know anything > about the taskjuggler format, so I’m sure whatever decision you make > will be OK.) Would a user be able to meaningfully add something to the list? Or does each attribute need some lisp glue to be transformed from Org to the taskjuggler format? In case of the latter, it should be a defvar IMO. Also, as suggested by Aaron it would be great if you could add pointers to the taskjuggler documentation. Thanks, Rasmus -- History is what should never happen again
[O] html export: what do codehighlighton/off functions do?
Can someone please tell me what these functions do? ``` function CodeHighlightOn(elem, id) { var target = document.getElementById(id); if(null != target) { elem.cacheClassElem = elem.className; elem.cacheClassTarget = target.className; target.className = "code-highlighted"; elem.className = "code-highlighted"; } } function CodeHighlightOff(elem, id) { var target = document.getElementById(id); if(elem.cacheClassElem) elem.className = elem.cacheClassElem; if(elem.cacheClassTarget) target.className = elem.cacheClassTarget; } ``` The only thing I could think of is to toggle some classes, but I can't seem to find some real world example out there. This javascript code is included on every export, doesn't matter if you've src/example blocks in your org file or not. Thanks
Re: [O] Org Mode and PDF Notes!
Ramon Diaz-Uriarte writes: > > so we get the location of the highlight (and its properties), but not the > textual contents. And this is the case whether I make the annotation with > EzPDF or Okular or, for that matter, with pdf-tools itself. > > So it seems RepliGO is actually giving you a lot more by default :-) > >> >> Politza and I are discussing this here: >> https://github.com/politza/pdf-tools/issues/137 >> >> that might be a good place to ocntinue the conversation. >> > > I'll do. In the meantime, I think this is a limitation coming from > poppler. Other people have mentioned similar things (e.g., > http://coda.caseykuhlman.com/entries/2014/pdf-extract.html) and using other > tools that depend on poppler (such as Leela: > https://github.com/TrilbyWhite/Leela) also will not give us the text > itself. I don't think this is a limitation of poppler so much as the way that pdf annotations work. Typically, the subject/text field is not populated by the text of the highlighted region. Rather, a highlight annotation specifies bounds, color, style, etc. Basically what Repligo does (I wouldn't recommend using it, as it is closed source and severely out of date) is to grab the text *at the time of highlighting* and add it to the notes field. I don't know of any other annotation tool that does the same thing. Applications built on poppler could do it, though they currently do not. For extracting the text of highlighted regions *after the fact*, I've had good luck with this script that relies on the pdf-reader gem for ruby: https://gist.github.com/danlucraft/5277732 Matt
Re: [O] Org Mode and PDF Notes!
On Thu, Nov 12, 2015 at 7:23 AM, Ramon Diaz-Uriarte wrote: > > > > On Wed, 11-11-2015, at 21:33, Matt Price wrote: > >> > >> > >> instead of the text. Bummer! I wonder if RepliGO gives you a lot more > >> than the rest, or if I am doing something silly. > >> > >> I think that there is no standard way of storing the highlight > contents. I > > chose Repligo over EZPDF because it gives you access to the text of the > > highlights! > > > I'll try to see if I can get repligo (I had it a few years ago) > > > > > Okular, I think, stores your annotations in its own database, rather than > > in the pdf. You can (I think!) attach the annotations to the pdf from > > inside Okular. At leasts, that's what I remember from when I was looking > > around. > > Actually, Okular stores the annotations in the PDF itself if you do "Save > As". (It still keeps an internal db, but I never use it anymore). It is > easy to check by doing that and then opening the file with another reader > in another machine (e.g., in an android). > > > my bad, thx. > > > > > Repligo stores the highlighted text in the "subject" field of the > > annotation. It's possible that the content of the annotation is stored in > > some other field, like "content". Maybe you can try: > > > > M-: (pdf-annot-get-annots) and look at the output in the *Messages* > > buffer. Can you see any evidence of the the text? Can you share what you > > learned? > > Nope, no evidence of the text. I get things such as > > (((buffer . #) (page . 13) (edges > 0.113553 0.31717 0.868657 0.361746) (type . highlight) (id . annot-13-0) > (flags . 4) (color . "#00") (contents . "") (modified 22081 45188) > (label . "TF201") (subject . "Highlight") (opacity . 1.0) ...) > > > so we get the location of the highlight (and its properties), but not the > textual contents. And this is the case whether I make the annotation with > EzPDF or Okular or, for that matter, with pdf-tools itself. > > So it seems RepliGO is actually giving you a lot more by default :-) > > Try replacing (text (assoc-default 'subject annot)) with (text (pdf-info-gettext page (assoc-default 'edges annot))) in the lambda function in pdf-annot-markups-as-org-text. This will fail on cropped pdfs if you have added highlights using the most recent pdf-tools, which stores negative values in the 'edges field, but I've found it works otherwise. I'd love to hear if it works for you too. (I know you're following the relevant bug report on the pdf-tools github repo). > > > > > Politza and I are discussing this here: > > https://github.com/politza/pdf-tools/issues/137 > > > > that might be a good place to ocntinue the conversation. > > > > I'll do. In the meantime, I think this is a limitation coming from > poppler. Other people have mentioned similar things (e.g., > http://coda.caseykuhlman.com/entries/2014/pdf-extract.html) and using > other > tools that depend on poppler (such as Leela: > https://github.com/TrilbyWhite/Leela) also will not give us the text > itself. > > > > >> > >> Until I found pdf-tools, I had planned to write a node wrapper for > pdf.js > > and grab the annotations that way. But I don't really know how to do > that, > > so this turned out to be easier :-) > > > > Anyway, I've judated the post, and it's now possible to create links to > > individualt annotations, though you will have to use my updated version > of > > org-pdfview, until/unless Markus accepts my patch. > > > I just updated packages, and things are working perfectly: I am jumping to > the page and location. > > > > Thanks, > > > R. > > > > >
Re: [O] Org Mode and PDF Notes!
On Wed, 11-11-2015, at 21:33, Matt Price wrote: >> >> >> instead of the text. Bummer! I wonder if RepliGO gives you a lot more >> than the rest, or if I am doing something silly. >> >> I think that there is no standard way of storing the highlight contents. I > chose Repligo over EZPDF because it gives you access to the text of the > highlights! I'll try to see if I can get repligo (I had it a few years ago) > > Okular, I think, stores your annotations in its own database, rather than > in the pdf. You can (I think!) attach the annotations to the pdf from > inside Okular. At leasts, that's what I remember from when I was looking > around. Actually, Okular stores the annotations in the PDF itself if you do "Save As". (It still keeps an internal db, but I never use it anymore). It is easy to check by doing that and then opening the file with another reader in another machine (e.g., in an android). > > Repligo stores the highlighted text in the "subject" field of the > annotation. It's possible that the content of the annotation is stored in > some other field, like "content". Maybe you can try: > > M-: (pdf-annot-get-annots) and look at the output in the *Messages* > buffer. Can you see any evidence of the the text? Can you share what you > learned? Nope, no evidence of the text. I get things such as (((buffer . #) (page . 13) (edges 0.113553 0.31717 0.868657 0.361746) (type . highlight) (id . annot-13-0) (flags . 4) (color . "#00") (contents . "") (modified 22081 45188) (label . "TF201") (subject . "Highlight") (opacity . 1.0) ...) so we get the location of the highlight (and its properties), but not the textual contents. And this is the case whether I make the annotation with EzPDF or Okular or, for that matter, with pdf-tools itself. So it seems RepliGO is actually giving you a lot more by default :-) > > Politza and I are discussing this here: > https://github.com/politza/pdf-tools/issues/137 > > that might be a good place to ocntinue the conversation. > I'll do. In the meantime, I think this is a limitation coming from poppler. Other people have mentioned similar things (e.g., http://coda.caseykuhlman.com/entries/2014/pdf-extract.html) and using other tools that depend on poppler (such as Leela: https://github.com/TrilbyWhite/Leela) also will not give us the text itself. >> >> Until I found pdf-tools, I had planned to write a node wrapper for pdf.js > and grab the annotations that way. But I don't really know how to do that, > so this turned out to be easier :-) > > Anyway, I've judated the post, and it's now possible to create links to > individualt annotations, though you will have to use my updated version of > org-pdfview, until/unless Markus accepts my patch. I just updated packages, and things are working perfectly: I am jumping to the page and location. Thanks, R. -- Ramon Diaz-Uriarte Department of Biochemistry, Lab B-25 Facultad de Medicina Universidad Autónoma de Madrid Arzobispo Morcillo, 4 28029 Madrid Spain Phone: +34-91-497-2412 Email: rdia...@gmail.com ramon.d...@iib.uam.es http://ligarto.org/rdiaz
Re: [O] Org Mode and PDF Notes!
> On Wed, 11 Nov 2015 15:58:24 -0500, Matt Price said: > I meant INTERLEAVE_PDF. I just opened an issue: > https://github.com/rudolfochrist/interleave/issues/13 so who knows, > maybe... Sound like a good idea. I'm currently a little short on time,but perhaps I can look into that this weekend. -Sebastian
Re: [O] Org Mode and PDF Notes!
> On Wed, 11 Nov 2015 15:48:15 -0500, Kaushal Modi > said: > May be you can work with the interleave.el dev to add in your ideas > and code. I had worked with him to make interleave support pdf-tools > and it was a pleasure to work with him. You're so kind! It was also a pleasure for me. Best, Sebastian
Re: [O] Org Mode and PDF Notes!
* Matt Price wrote: > --047d7b41411eff32e6052444d409 > Content-Type: text/plain; charset=UTF-8 > > I've just written up a post on my workflow for PDF's Since my blog has, I > think, a readership of 0 (surely there's a way to get emacsers to follow > me? ah well), I will post a link here in the hopes that someone will be > interested: > > http://matt.hackinghistory.ca/2015/11/11/note-taking-with-pdf-tools/ Thanks for your blog post and the URL! I did something very similar a couple of years ago while writing my PhD thesis: https://github.com/novoid/extract_pdf_annotations_to_orgmode And I also have a blog which I use for Emacs/Org-mode stuff from time to time: http://karl-voit.at/ This reminds me of implementing a tag-based RSS/Atom-feed for Emacs-related stuff to my blogging system ... -- mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML to Org-mode: > get Memacs from https://github.com/novoid/Memacs < https://github.com/novoid/extract_pdf_annotations_to_orgmode + more on github
Re: [O] truncated footnote
Hello, Samuel Wales writes: > * bug? in maint, commenting a paragraph will truncate footnotes > in xanadu[fn:b3e0f07] > > um > > # comment > > [fn:b3e0f07] > did kublai khan > > # was it "seemly"? > > a stately pleasure dome > > decree Fixed. Thank you. Regards, -- Nicolas Goaziou