Re: [O] org-download.el
* https://github.com/abo-abo/org-download/blob/master/org-download.el has: ... (defcustom org-download-backend t "Method to use for downloading." :type '(choice (const :tag "wget" "wget \"%s\" -O \"%s\"") (const :tag "curl" "curl \"%s\" -o \"%s\"") (const :tag "url-retrieve" t)) :group 'org-download) ... ** My guess: You don't have "wget" and/or "curl" on your Mac? On Tue, Jan 13, 2015 at 2:49 AM, Chao Lu wrote: > Dear all, > > Does anyone get org-download.el to work under Mac OSX? I'm struggling to > get it work, but it seems to help a lot, empowering org to handle images a > lot easier. > > I believe I've installed org-download.el correctly, but when I'm dragging > and drop the image into an org buffer, all I get is the link address > inserted into the buffer, no downloading events trigger. > > I double checked a few things before coming here: > - My system has both curl and download. > - I've set the download image dir to ~/Downloads/Foo > - The value of dnd-protocol-alist contains > ("^\\(https?\\|ftp\\|file\\|nfs\\)://" . org-download-dnd) > > The emacs I'm using is "GNU Emacs 24.3.1 (x86_64-apple-darwin, NS > apple-appkit-1038.36) of 2013-03-13 on bob.porkrind.org" > > Is there any thought what I should check? > > Best, > > Chao >
Re: [O] org-download.el
"briangpowell ." writes: > * https://github.com/abo-abo/org-download/blob/master/org-download.el has: > > ... > (defcustom org-download-backend t > "Method to use for downloading." > :type '(choice > (const :tag "wget" "wget \"%s\" -O \"%s\"") > (const :tag "curl" "curl \"%s\" -o \"%s\"") > (const :tag "url-retrieve" t)) > :group 'org-download) > ... > > ** My guess: You don't have "wget" and/or "curl" on your Mac? either that, or they are not in the path used in emacs (are they installed via e.. homebrew?). Depending on how you set the paths, the emacs process might have different paths. Cheers, Rainer > > > On Tue, Jan 13, 2015 at 2:49 AM, Chao Lu wrote: > >> Dear all, >> >> Does anyone get org-download.el to work under Mac OSX? I'm struggling to >> get it work, but it seems to help a lot, empowering org to handle images a >> lot easier. >> >> I believe I've installed org-download.el correctly, but when I'm dragging >> and drop the image into an org buffer, all I get is the link address >> inserted into the buffer, no downloading events trigger. >> >> I double checked a few things before coming here: >> - My system has both curl and download. >> - I've set the download image dir to ~/Downloads/Foo >> - The value of dnd-protocol-alist contains >> ("^\\(https?\\|ftp\\|file\\|nfs\\)://" . org-download-dnd) >> >> The emacs I'm using is "GNU Emacs 24.3.1 (x86_64-apple-darwin, NS >> apple-appkit-1038.36) of 2013-03-13 on bob.porkrind.org" >> >> Is there any thought what I should check? >> >> Best, >> >> Chao >> -- Rainer M. Krug email: Rainerkrugsde PGP: 0x0F52F982 signature.asc Description: PGP signature
[O] [Bug] org-drill leeches
Hi group and Paul, some of my drill items have become tagged as leech. This causes the next drill session to fail. I fixed this like so: #v+ 1 file changed, 1 insertion(+), 1 deletion(-) contrib/lisp/org-drill.el | 2 +- Modified contrib/lisp/org-drill.el diff --git a/contrib/lisp/org-drill.el b/contrib/lisp/org-drill.el index 93c37e3..2fe6243 100644 --- a/contrib/lisp/org-drill.el +++ b/contrib/lisp/org-drill.el @@ -2439,7 +2439,7 @@ that many days)." (timestamp (- (org-time-stamp-to-now timestamp))) (use-last-interval-p - (+ (org-drill-entry-days-overdue) + (+ (or (org-drill-entry-days-overdue) 0) (read (or (org-entry-get (point) "DRILL_LAST_INTERVAL") "0" (t nil #v- On the code level the bug occurs when '(org-drill-entry-days-overdue)' returns nil. I'm not sure if this is a sane fix. Could you give it a glance, please? Best regards, Marco -- http://www.wahlzone.de GPG: 0x49010A040A3AE6F2
Re: [O] Table of contents for just one section?
Rasmus writes: > As said, I'd prefer load hyperref via org-latex-hyperref-template, but > it's probably too big a change too late. Though, it would resolve the > "issue" that if I do > >(setq org-latex-default-packages-alist > (delete '("" "hyperref" nil) > org-latex-default-packages-alist)) > > Hypersetup is still inserted. The issue is not to remove hyperref, which is a default package for a good reason. The problem is to require titletoc before hyperref. IOW, this is orthogonal to the problem at hand. > Of course, but isn't it contradicting the docstring of > org-latex-default-packages-alist? No it isn't. It is a defcustom after all, and the manual can ensure the user knows what he is doing. > Unless I've managed to convenience you otherwise I will add a footnote > explaining and recommending the following snippet > > (with-eval-after-load 'ox-latex > (require 'cl) > (let* ((packages (mapcar (lambda (elt) (and (listp elt) (nth 1 elt))) >org-latex-default-packages-alist)) > (pos (position "hyperref" packages :test 'equal)) > (titletocp (member "titletoc" packages))) > (when (and pos (not titletocp)) > (push '("" "titletoc" nil) > (nthcdr pos org-latex-default-packages-alist) It is way too opaque IMO. Suggesting to put ("" "titletoc" nil) before ("" hyperref nil) should be enough. Regards,
[O] End Section with \clearpage
Hi I want to add after some sections a \clearpage which works, But the \clearpage is part of the last header: , | * Subsection to be ended with clearpage | ** Sub-section | some text | *** sub-sub-section | Some more text | | \clearpage | | * Next Subsection | * Last subsection ` Is there a way that I can add this \clearpage at the end of the section *without* being in the last subsection? I guess not? Thanks, Rainer -- Rainer M. Krug email: Rainerkrugsde PGP: 0x0F52F982 signature.asc Description: PGP signature
Re: [O] Table of contents for just one section?
Nicolas Goaziou writes: > Rasmus writes: > >> As said, I'd prefer load hyperref via org-latex-hyperref-template, but >> it's probably too big a change too late. Though, it would resolve the >> "issue" that if I do >> >>(setq org-latex-default-packages-alist >> (delete '("" "hyperref" nil) >> org-latex-default-packages-alist)) >> >> Hypersetup is still inserted. > > The issue is not to remove hyperref, which is a default package for > a good reason. The problem is to require titletoc before hyperref. I was putting this to further support another solution, namely moving hyperref to a single defcustom, allowing hyperref to be inserted after all other header-lines. > IOW, this is orthogonal to the problem at hand. I disagree. >> Unless I've managed to convenience you otherwise I will add a footnote >> explaining and recommending the following snippet >> >> (with-eval-after-load 'ox-latex >> (require 'cl) >> (let* ((packages (mapcar (lambda (elt) (and (listp elt) (nth 1 elt))) >>org-latex-default-packages-alist)) >> (pos (position "hyperref" packages :test 'equal)) >> (titletocp (member "titletoc" packages))) >> (when (and pos (not titletocp)) >> (push '("" "titletoc" nil) >> (nthcdr pos org-latex-default-packages-alist) > > It is way too opaque IMO. Suggesting to put ("" "titletoc" nil) before > ("" hyperref nil) should be enough. That's what it does... But without the need of having a direct copy of org-latex-default-packages-alist in your init.el. I'm not suggesting to put the snippet there without any prose. —Rasmus -- When in doubt, do it!
Re: [O] End Section with \clearpage
Hi, Rainer M Krug writes: > I want to add after some sections a \clearpage which works, But the > \clearpage is part of the last header: > > , > | * Subsection to be ended with clearpage > | ** Sub-section > | some text > | *** sub-sub-section > | Some more text > | > | \clearpage > | > | * Next Subsection > | * Last subsection > ` > > Is there a way that I can add this \clearpage at the end of the section > *without* being in the last subsection? > > I guess not? Use a org-export-filter-section-functions filter to insert "\clearpage" at the end on headlines with the appropriate property or tag. A quick hack: (defun rasmus/get-org-headline-string-element (headline backend info) "Return the org element representation of an element. Won't work on ~verb~/=code=-only headers" (let ((prop-point (next-property-change 0 headline))) (if prop-point (plist-get (text-properties-at prop-point headline) :parent (defun rasmus/org-latex-clearpage (headline backend info) "Insert a clearpage at end of heading if property clearpage is non-nil." (when (org-export-derived-backend-p backend 'latex) (let ((elm (rasmus/get-org-headline-string-element headline backend info))) (when (and elm (org-element-property :CLEARPAGE elm)) (concat headline "\\clearpage\\n") (add-to-list 'org-export-filter-headline-functions 'rasmus/org-latex-clearpage) Example file: * test :PROPERTIES: :clearpage: t :END: ** sub1 ** sub2 —Rasmus -- Summon the Mothership!
Re: [O] Table of contents for just one section?
Rasmus writes: > I was putting this to further support another solution, namely moving > hyperref to a single defcustom, allowing hyperref to be inserted after all > other header-lines. As you pointed out already, moving hyperref after all other header lines introduces problems with another set of packages. Therefore, we could end up with package combinations that this variable couldn't handle. > That's what it does... But without the need of having a direct copy of > org-latex-default-packages-alist in your init.el. I'm not suggesting to > put the snippet there without any prose. `org-latex-default-packages-alist' can be customized, and customization allows to easily add "titletoc" before "hyperref". No need to rely on this confusing snippet. Regards,
Re: [O] contribution: ob-php
Hello, Hex writes: > I use org mode for code review quite a bit. It's awesome to be able to > throw snippets of code in a doc and be able to verify fixes within the > doc. I noticed there's no PHP mode (and totally understand why seeing > as how "literate programming" is a keyword ;) so I wrote one. > > Elsip isn't exactly a language I hit a lot, so it might be pretty > rough. I added the following files: > > lisp/ob-php.el > testing/examples/ob-php-test.org > testing/lisp/test-ob-php.el Thanks for your work. However, we can only apply it on master branch once FSF assignment is completed. It can take a couple of weeks, depending on your location. Also, please use git format-patch with a proper commit message when providing a patch. Some comments follow. > +;; Copyright (C) 2014 Josh Dukes This will need to be the "Free Software Foundation, Inc." > +;; This function expands the body of a source code block by doing > +;; things like prepending argument definitions to the body, it is > +;; be called by the `org-babel-execute:php' function below. > +(defun org-babel-expand-body:php (body params &optional processed-params) > + "Expand BODY according to PARAMS, return the expanded body." You should give the type of BODY (probably a string) and PARAMS (a plist), and describe PROCESSED-PARAMS. > + (if (or (car (assoc :expand params)) nil) (if (car (assq :expand params)) ...) Also, it is probably `cdr' instead of `car'. > + (let ((full-body > + (org-babel-expand-body:generic > + body > + params > + (org-babel-variable-assignments:php params > + (concat " + full-body > + "\n?>")) IMO, this is unnecessarily convoluted (format "" (org-babel-expand-body:generic ...)) > +(let ((vars > +(concat " +(mapconcat > + #'identity > + (org-babel-variable-assignments:php params) > + "\n") > +"\n?>"))) > + (concat vars body Ditto. (concat "" body) > +(defun org-babel-execute:php (body params) Missing docstring. > + (let* ((session (cdr (assoc :session params))) > + (flags (or (cdr (assoc :flags params)) "")) `assoc' -> `assq' > + (src-file (org-babel-temp-file "php-src-")) > + (full-body (org-babel-expand-body:php body params)) > + (session (org-babel-php-initiate-session session)) > + (results > + (progn > + (with-temp-file src-file (insert full-body)) > + (org-babel-eval > + (concat org-babel-php-command > + " " flags " " src-file) "" > +(progn `progn' is implicit around the body of `let' (or `let*'). You can remove it. > + (org-babel-reassemble-table > + (org-babel-result-cond (cdr (assoc :result-params params)) > + (org-babel-read results) > + (let ((tmp-file (org-babel-temp-file "c-"))) > + (with-temp-file tmp-file (insert results)) > + (org-babel-import-elisp-from-file tmp-file))) Is the temporary file necessary? `with-temp-buffer' is cheaper. Use it if possible. > + (org-babel-pick-name > +(cdr (assoc :colname-names params)) (cdr (assoc :colnames params))) > + (org-babel-pick-name > +(cdr (assoc :rowname-names params)) (cdr (assoc :rownames > params))) `assoc' -> `assq' > + > +(defun org-babel-variable-assignments:php (params) > + "Return a list of PHP statements assigning the block's variables." You need to describe PARAMS. > + (mapcar > + (lambda (pair) > + (format "$%s=%s;" > + (car pair) > + (org-babel-php-var-to-php (cdr pair > + (mapcar #'cdr (org-babel-get-header params :var Nitpick: can't you do it with a single `mapcar'? > +(defun org-babel-php-var-to-php (var) > + "Convert an elisp var into a string of php source code > +specifying a var of the same value." First sentence of docstring has to fit on a single line. > + (if (listp var) > + (concat "Array(" (mapconcat #'org-babel-php-var-to-php var ",") ")") > + (format "%S" var))) > + > +(defun org-babel-php-table-or-string (results) > + "If the results look like a table, then convert them into an > +Emacs-lisp table, otherwise return the results as a string." See above. > +++ b/testing/examples/ob-php-test.org I know Babel usually relies on an external Org file for its tests, but this is a pain to debug when one fails. It is not terribly important, but write self-contained tests if you can, i.e., using `org-test-with-temp-text'. > diff --git a/testing/lisp/test-ob-php.el b/testing/lisp/test-ob-php.el > new file mode 100644 > index 000..47a1169 > --- /dev/null > +++ b/testing/lisp/test-ob-php.el [...] > +(ert-deftest ob-php/assert () > + (should t)) You can remove that. Regards, -- Nicolas Goaziou
Re: [O] Fwd: demoting a heading inserts spaces in column-0 text
Daniel Clemente writes: >> >> Another option would be to have another option to indent only planning >> >> info, properties drawer, and every drawer located right after it, à la >> >> `org-log-state-notes-insert-after-drawers'. At least, it couldn't break >> >> structure. > > Is this possible? Why wouldn't it? > This indents drawers located at the top, which I think is good > enough because it's where org puts the common ones by default. > Your examples are more complex, with drawers in the middle of the > text or in the middle of lists. In those cases you might need full > indentation, but people who only use :CLOCK: and SCHEDULED at the > top (and that's the default) could use this option. > This is not about „indenting by type“, but about „indenting until > point X“, and the trick is to find the right X. This is what I explained already. Indenting by type will fail in some cases. Indenting until some location is fine, as long as we are cautious about the said location. > I'd rather have org-adapt-indentation = 'initial-only which works > like like org-adapt-indentation = nil with the extra that „Property > drawers and planning information is inserted indented“. > > That is, new things appear with the same indentation as the element above. > And demoting doesn't indent anything. > > Example: > > > ** something > > > You press C-c C-s and you get: > > > ** something >SCHEDULED: <2051-01-09 Mon> > > > You press S-M-right and you get: > > > *** something >SCHEDULED: <2051-01-09 Mon> > > > The user can then manually decide whether he wants to correct > indentations for each line. I fail to see how this would be useful. In particular, it fails if the section has contents prior to the scheduling step. Also, it doesn't solve Sébastien's problem. Regards,
Re: [O] Table of contents for just one section?
Nicolas Goaziou writes: > Rasmus writes: > >> I was putting this to further support another solution, namely moving >> hyperref to a single defcustom, allowing hyperref to be inserted after all >> other header-lines. > > As you pointed out already, moving hyperref after all other header lines > introduces problems with another set of packages. Therefore, we could > end up with package combinations that this variable couldn't handle. Of which we do not rely at the moment. From a user POW it's easy to load stuff at the end of the preamble e.g. using scrfile (\AfterPackage{}{}) or etoolbox (\AtEndPreamble{}). >> That's what it does... But without the need of having a direct copy of >> org-latex-default-packages-alist in your init.el. I'm not suggesting to >> put the snippet there without any prose. > > `org-latex-default-packages-alist' can be customized, and customization > allows to easily add "titletoc" before "hyperref". No need to rely on > this confusing snippet. Which again will copy the current value into your init, potentially ignoring future updates of the variable (say if we add or remove packages at a later point). [Correct me if I'm wrong]. Anyway, I edited the org.texi as we won't agreement. —Rasmus -- Tack, ni svenska vakttorn. Med plutonium tvingar vi dansken på knä!
[O] Comments in @example in org.texi
Hi, In org.texi, sometimes examples have comments with (·) and sometimes with @r{·}. E.g. @example #+TOC: headlines 1 local (insert local TOC, with direct children only) @end example And @example #+INCLUDE: "~/.emacs" :lines "5-10" @r{Include lines 5 to 10, 10 excluded} @end example Is there any logic behind when @r{·} and when (·) is used? Or should we try to make it more coherent? Thanks, Rasmus -- This is the kind of tedious nonsense up with which I will not put
Re: [O] Comments in @example in org.texi
Hello, Rasmus writes: > In org.texi, sometimes examples have comments with (·) and sometimes with > @r{·}. E.g. > >@example >#+TOC: headlines 1 local (insert local TOC, with direct children only) >@end example > > And > >@example >#+INCLUDE: "~/.emacs" :lines "5-10" @r{Include lines 5 to 10, 10 > excluded} >@end example > > Is there any logic behind when @r{·} and when (·) is used? I don't think so. > Or should we try to make it more coherent? IMO @r{.} should be used everywhere in these situations. Regards, -- Nicolas Goaziou
[O] Args out of range: #, 0, 1
Hello, I sometimes (or often?) have the above error when pressing `C-c C-v C-d' onto some region (to put it in a code block). Org is supposed to ask me which language it is for, and then wrap my selection with the right #+begin/end_src markers. Instead, I get the "args out of range" error. I tried to edebug the function `org-babel-demarcate-block' and the error arises quite at the beginning: on the `match-string 0', on the second line of the `let*'. The error is generated because `org-babel-where-is-src-block-head' returned nil... I now have two problems at least: - I can't reproduce it in a minimal Emacs, and there... edebug ends in an error (I wanted to compare the execution steps), as you can see on the right screen of http://screencast.com/t/A5ldV2yHNna. Why is edebug crashing? - It seems normal that `org-babel-where-is-src-block-head' returns nil when we use `C-c C-v C-d' to create the first code block in a buffer which did not contain any... and it works in my minimal Emacs... (iff edebug is turned off) Any idea of the problem, then? Clearly, there is some extra cause I did not identify yet. Can you help? Best regards, Seb -- Sebastien Vauban
Re: [O] Table of contents for just one section?
Rasmus writes: >> As you pointed out already, moving hyperref after all other header lines >> introduces problems with another set of packages. Therefore, we could >> end up with package combinations that this variable couldn't handle. > > Of which we do not rely at the moment. Of course, but I'm just pointing out that silently postponing the problem is worse than admitting there is one and let the user sort it out, with guidance. We should really stay away from the LaTeX packages mess. > From a user POW it's easy to load > stuff at the end of the preamble e.g. using scrfile (\AfterPackage{}{}) or > etoolbox (\AtEndPreamble{}). For an intermediate LaTeX user, this is easy. It is also for an intermediate Org user (e.g., who knows how to modify `org-latex-classes'). For beginners in both topics, there is the footnote in org.texi. > Which again will copy the current value into your init, potentially > ignoring future updates of the variable (say if we add or remove packages > at a later point). [Correct me if I'm wrong]. You're right. But I don't see why we should try to get around this common issue specifically for this problem, even though it exists for every defcustom. There is :version keyword for this matter. > Anyway, I edited the org.texi as we won't agreement. Thank you. I don't want to separate "hyperref" from `org-latex-default-packages-alist' and treat it differently. Regards,
Re: [O] Args out of range: #, 0, 1
Hello, Sebastien Vauban writes: > I tried to edebug the function `org-babel-demarcate-block' and the error > arises quite at the beginning: on the `match-string 0', on the second > line of the `let*'. The error means we tried to access portions from 0 to 1 in a buffer. That doesn't exist. The reason is that the match data was built when matching on a string (where 0 is a valid position), and we're trying to use it on a buffer. It simply means that we're trying to access the match data without actually checking that we matched something. Reproduce with: (progn (string-match "\\(\\(\\(\\(.\\)\\)\\)\\)" "foo") ; this sets the match data (with-temp-buffer (org-babel-demarcate-block))) ; tries to access the match data, ; but never matched anything successfully > - I can't reproduce it in a minimal Emacs, and there... edebug ends in > an error (I wanted to compare the execution steps), as you can see on > the right screen of http://screencast.com/t/A5ldV2yHNna. > > Why is edebug crashing? Did you perhaps kill the buffer where org-babel-demarcate-block was instrumented for edebug ? > - It seems normal that `org-babel-where-is-src-block-head' returns nil > when we use `C-c C-v C-d' to create the first code block in a buffer > which did not contain any... and it works in my minimal Emacs... (iff > edebug is turned off) > > Any idea of the problem, then? I think the `progn' in org-babel-demarcate-block should be `and'. (I also think that the fact that the match data is set according to org-babel-src-block-regexp when calling org-babel-where-is-src-block-head should be documented in that function. Relying on undocumented side effects is nasty.) HTH, -- Nico
Re: [O] Order of drawers will be checked i nnew org version
Mail von Marco Wahl, Mon, 12 Jan 2015 at 22:01:15 +0100: Hello, > See etc/ORG-NEWS or > http://orgmode.org/cgit.cgi/org-mode.git/plain/etc/ORG-NEWS. Find there > also a repair function (thanks to Nicolas.) Mea culpa. And thanks for the hint. After applying the code to all my org files everything worked well again. Stefan -- Stefan-W. Hahn It is easy to make things. It is hard to make things simple.
Re: [O] Args out of range: #, 0, 1
Hello, Sebastien Vauban writes: > I sometimes (or often?) have the above error when pressing `C-c C-v C-d' > onto some region (to put it in a code block). > > Org is supposed to ask me which language it is for, and then wrap my > selection with the right #+begin/end_src markers. Instead, I get the > "args out of range" error. This should be fixed. Thank you for reporting it. Regards, -- Nicolas Goaziou
Re: [O] Comments in @example in org.texi
Nicolas Goaziou writes: >> Or should we try to make it more coherent? > > IMO @r{.} should be used everywhere in these situations. I pushed a commit that removs the ()-comments I could find. —Rasmus -- m-mm-mmm- bacon!
Re: [O] org-download.el
Thanks for the advice, but I've wget and curl installed through Mac ports. $ which crul=> /usr/texbin/curl $ which wget => /usr/texbin/wget And the value of my exec-path is: ("/usr/bin" "/bin" "/usr/sbin" "/sbin" "/Applications/Documents/Emacs.app/Contents/MacOS/libexec" "/Applications/Documents/Emacs.app/Contents/MacOS/bin" "/Applications/Mathematics/MATLAB_R2014a.app/bin" "/Applications/Documents/Emacs.app/Contents/MacOS/bin" "*/usr/texbin*" "/opt/local/bin" "/usr/local/bin") which has included /usr/texbin Any thoughts? Thanks. On Tue, Jan 13, 2015 at 3:58 AM, Rainer M Krug wrote: > "briangpowell ." writes: > > > * https://github.com/abo-abo/org-download/blob/master/org-download.el > has: > > > > ... > > (defcustom org-download-backend t > > "Method to use for downloading." > > :type '(choice > > (const :tag "wget" "wget \"%s\" -O \"%s\"") > > (const :tag "curl" "curl \"%s\" -o \"%s\"") > > (const :tag "url-retrieve" t)) > > :group 'org-download) > > ... > > > > ** My guess: You don't have "wget" and/or "curl" on your Mac? > > either that, or they are not in the path used in emacs (are they > installed via e.. homebrew?). > > Depending on how you set the paths, the emacs process might have > different paths. > > Cheers, > > Rainer > > > > > > > On Tue, Jan 13, 2015 at 2:49 AM, Chao Lu wrote: > > > >> Dear all, > >> > >> Does anyone get org-download.el to work under Mac OSX? I'm struggling to > >> get it work, but it seems to help a lot, empowering org to handle > images a > >> lot easier. > >> > >> I believe I've installed org-download.el correctly, but when I'm > dragging > >> and drop the image into an org buffer, all I get is the link address > >> inserted into the buffer, no downloading events trigger. > >> > >> I double checked a few things before coming here: > >> - My system has both curl and download. > >> - I've set the download image dir to ~/Downloads/Foo > >> - The value of dnd-protocol-alist contains > >> ("^\\(https?\\|ftp\\|file\\|nfs\\)://" . org-download-dnd) > >> > >> The emacs I'm using is "GNU Emacs 24.3.1 (x86_64-apple-darwin, NS > >> apple-appkit-1038.36) of 2013-03-13 on bob.porkrind.org" > >> > >> Is there any thought what I should check? > >> > >> Best, > >> > >> Chao > >> > > -- > Rainer M. Krug > email: Rainerkrugsde > PGP: 0x0F52F982 >
[O] [PATCH] org-rss-headline
Hi guys, I'm a happy user of ox-rss.el, but was annoyed the other day when I wanted to export an article with a headline containing markup. The problem is that org-rss-headlines uses the raw-value of the headline to export the title, which could contain any markup. Here's a patch that uses the :EXPORT_TITLE property if present, :raw-value if not. diff --git a/contrib/lisp/ox-rss.el b/contrib/lisp/ox-rss.el index fddaa1d..5617d26 100644 --- a/contrib/lisp/ox-rss.el +++ b/contrib/lisp/ox-rss.el @@ -244,11 +244,12 @@ communication channel." (format-time-string "%a, %d %b %Y %H:%M:%S %z" (org-time-string-to-time pubdate0) - (title (replace-regexp-in-string - org-bracket-link-regexp - (lambda (m) (or (match-string 3 m) - (match-string 1 m))) - (org-element-property :raw-value headline))) + (title (or (org-element-property :EXPORT_TITLE headline) + (replace-regexp-in-string + org-bracket-link-regexp + (lambda (m) (or (match-string 3 m) + (match-string 1 m))) + (org-element-property :raw-value headline (publink (or (and hl-perm (concat (or hl-home hl-pdir) hl-perm)) (concat Please tell me what you think. Cheers Nico -- Nicolas Petton http://nicolas-petton.fr
[O] org-insert-link and gnus: format of the list of links
Hello I can't remember to have set anything special, but when I type org-insert-link I obtain a link of all my emails (using Xemacs 21.5.33, org-mode 7.8 and the latest git version of gnus.) The list is as follows gnus:nnimap+UCMgmail:INBOX#5493f390.5050...@ucm.es (Email from Jorge J. Gómez Sanz: To: destinatarios-no-revelados: Date: Fri, 19 Dec 2014 10:44:48 +0100 Subj: sobre la petición para ser ent ) etc etc - is there any variable responsible for this listing? - could the Subject of the message be displayed before the To and dates, because it would make it easier for me to recognise the messages. thanks Uwe Brauer smime.p7s Description: S/MIME cryptographic signature
Re: [O] Comments in @example in org.texi
Rasmus writes: > I pushed a commit that removs the ()-comments I could find. Thank you. Regards,
Re: [O] [PATCH] org-rss-headline
Hello, Nicolas Petton writes: > I'm a happy user of ox-rss.el, but was annoyed the other day when I > wanted to export an article with a headline containing markup. What problem did you encounter? > The problem is that org-rss-headlines uses the raw-value of the headline > to export the title, which could contain any markup. Actually, an export back-end isn't expected to use :raw-value. One way to handle this is to create an anonymous export back-end that strips unwanted objects, or export them differently (e.g., a link is exported as its description, if any, or its path). See, for example `org-html--format-toc-headline'. > Here's a patch that uses the :EXPORT_TITLE property if present, > :raw-value if not. :EXPORT_TITLE is meant to replace #+TITLE: during a subtree export. There is ALT_TITLE property, but this is usually used in table of contents. Regards, -- Nicolas Goaziou
Re: [O] [PATCH] org-rss-headline
Nicolas Goaziou writes: > Hello, > > Nicolas Petton writes: > >> I'm a happy user of ox-rss.el, but was annoyed the other day when I >> wanted to export an article with a headline containing markup. > > What problem did you encounter? If the headline contains *bold* text for example, the RSS item title will have the extras * characters, since it's using the :raw-value. > >> The problem is that org-rss-headlines uses the raw-value of the headline >> to export the title, which could contain any markup. > > Actually, an export back-end isn't expected to use :raw-value. > > One way to handle this is to create an anonymous export back-end that > strips unwanted objects, or export them differently (e.g., a link is > exported as its description, if any, or its path). See, for example > `org-html--format-toc-headline'. > >> Here's a patch that uses the :EXPORT_TITLE property if present, >> :raw-value if not. > > :EXPORT_TITLE is meant to replace #+TITLE: during a subtree export. > There is ALT_TITLE property, but this is usually used in table of > contents. Ok. What about an :RSS_TITLE property? Or should I have a look at `org-html--format-toc-headline' and submit a different patch? Nico -- Nicolas Petton http://nicolas-petton.fr
Re: [O] Args out of range: #, 0, 1
Hello both Nicolas, Nicolas Richard wrote: > Sebastien Vauban writes: >> I tried to edebug the function `org-babel-demarcate-block' and the >> error arises quite at the beginning: on the `match-string 0', on the >> second line of the `let*'. > > The error means we tried to access portions from 0 to 1 in a buffer. > That doesn't exist. The reason is that the match data was built when > matching on a string (where 0 is a valid position), and we're trying > to use it on a buffer. It simply means that we're trying to access the > match data without actually checking that we matched something. > > Reproduce with: > (progn (string-match "\\(\\(\\(\\(.\\)\\)\\)\\)" "foo") ; this sets the match > data >(with-temp-buffer > (org-babel-demarcate-block))) ; tries to access the match data, >; but never matched anything > successfully > >> - I can't reproduce it in a minimal Emacs, and there... edebug ends >> in an error (I wanted to compare the execution steps), as you can see >> on the right screen of http://screencast.com/t/A5ldV2yHNna. >> >> Why is edebug crashing? > > Did you perhaps kill the buffer where org-babel-demarcate-block was > instrumented for edebug ? I cannot exclude that. In the minimal Emacs, I loose so many effective key bindings that it takes me a while to do what I want to do ;-) >> - It seems normal that `org-babel-where-is-src-block-head' returns >> nil when we use `C-c C-v C-d' to create the first code block in >> a buffer which did not contain any... and it works in my minimal >> Emacs... (iff edebug is turned off) >> >> Any idea of the problem, then? > > I think the `progn' in org-babel-demarcate-block should be `and'. > > (I also think that the fact that the match data is set according to > org-babel-src-block-regexp when calling > org-babel-where-is-src-block-head should be documented in that > function. Relying on undocumented side effects is nasty.) Thanks for the explanation. This still leaves me with one question: how do we reproduce the problem? What's the trigger for it? PS- @NicolasG, thanks for fixing it... Best regards, Seb -- Sebastien Vauban
Re: [O] Args out of range: #, 0, 1
Sebastien Vauban writes: > This still leaves me with one question: how do we reproduce the problem? > What's the trigger for it? Mostly luck. i.e. you need to have called a function that callled string-match on a string, with a regexp containing (at least) 4 grouping constructs, and the 4th matched at the beginning of that string (beginning position 0) but only one character (end position 1) [1]. And then later call org-babel-demarcate-block. Between the two, many things may have happened as long as the match data was preserved. [1] I gave an example of such a call to string-match -- my example wasn't super useful I admit. In your case, it could be anything : not necessarily an org function. Many functions use string-match internally. > PS- @NicolasG, thanks for fixing it... And also thanks for mentionning org-babel-src-block-regexp... and completely rewriting org-babel-where-is-src-block-head. Very impressive! -- Nicolas.
Re: [O] [PATCH] org-rss-headline
Nicolas Petton writes: > If the headline contains *bold* text for example, the RSS item title > will have the extras * characters, since it's using the :raw-value. OK. But what is expected instead? HTML markup? Nothing at all? > Ok. What about an :RSS_TITLE property? Or should I have a look at > `org-html--format-toc-headline' and submit a different patch? I think we can have both: an anonymous export back-end that strips markup from headline, and a property (RSS_TITLE is fine) to override the headline. WDYT? Regards,
Re: [O] [PATCH] org-rss-headline
Nicolas Goaziou writes: > Nicolas Petton writes: > >> If the headline contains *bold* text for example, the RSS item title >> will have the extras * characters, since it's using the :raw-value. > > OK. But what is expected instead? HTML markup? Nothing at all? I'd say the content of headline without any markup. > >> Ok. What about an :RSS_TITLE property? Or should I have a look at >> `org-html--format-toc-headline' and submit a different patch? > > I think we can have both: an anonymous export back-end that strips > markup from headline, and a property (RSS_TITLE is fine) to override the > headline. > > WDYT? LGTM. I'll provide another patch shortly > > Regards, -- Nicolas Petton http://nicolas-petton.fr
[O] hook for inserting headlines
Is there a hook that is run with creating a new headline in org mode? I have several properties that I always set for working todos & I'd like to have them automatically created when I make a new headline (say when I hit return at the end of it) IE: ,*** this is a sample headline ,*** this is a sample headline :PROPERTIES: :END: And maybe even an interactive schedule/deadline prompt? I have a function to create the properties drawer but don't know how to hook it to headline creation. Thanks! Subhan This message is intended for the sole use of the individual and entity to which it is addressed and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you.
Re: [O] hook for inserting headlines
On 2015-01-14, at 01:18, Subhan Michael Tindall wrote: > Is there a hook that is run with creating a new headline in org mode? I have > several properties that I always set for working todos & I'd like to have > them automatically created when I make a new headline (say when I hit return > at the end of it) > IE: > ,*** this is a sample headline > > ,*** this is a sample headline > :PROPERTIES: > > :END: > > And maybe even an interactive schedule/deadline prompt? > I have a function to create the properties drawer but don't know how to hook > it to headline creation. Why not create a specialized function which might ask for the title of the headline and insert that headline along with the properties? Or even insert an /empty/ headline with these properties and place the point after the string of asterisks and a space, so that you can type the title? Or, if we are at it, why not use Yasnippet for that? Not exactly what you want, but maybe this is what you /need/? If not, I guess that advising org-return /might/ be the way to go. (For instance, you might check whether the user hits RET with the point at the end of a headline with empty contents.) > Thanks! > Subhan Hth, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University