Re: [O] example or source blocks with captions

2011-04-30 Thread Jambunathan K


Sébastien Vauban wxhgmqzgwmuf-genee64ty+gs+fvcfc7...@public.gmane.org
writes:

 Hi Neilen,

 Neilen Marais wrote:
 Is it possible to caption a #+begin_src or #+begin_example block? Doing

 #+CAPTION: dipole_analytical_balanis.mac
 #+begin_example
 
 #+end_example

 doesn't seem to do the trick. I would find this useful to include
 suggested filenames when quoting source on a web page.

 Would such block be better for you?

 #+srcname: dipole_analytical_balanis.mac
 #+begin_src mac
 
 #+end_src

 The source name should be exported in HTML. If not, this is a feature.[1]


A cursory look suggests that

org-export-format-source-code-or-example takes caption as an arg. This
is used only if htmlize or org-export-latex-listings is configured by
the user - Both of these are not part of factory settings and wouldn't
work out of the box. (Seems like the situation could be improved)

ASCII export always exports a caption without fail.

So if I export

* Source Block
** Emacs Lisp Block

--8---cut here---start-8---
#+CAPTION: HelloWorldCaption
#+srcname: HelloWorldSrcName
#+begin_src emacs-lisp
  (defun helloworld () 

(message hello world))
#+end_src  
--8---cut here---end---8---

I get something like 

--8---cut here---start-8---
1 Source Block 
---

1.1 Emacs Lisp Block 
=


  (defun helloworld () 

(message hello world))
--8---cut here---end---8---

meaning that captions are not possibly passed into
org-export-format-source-code-or-example.

A cursory look at org-export-attach-captions-and-attributes where
('org-caption text property is added) suggests that captions are not
getting associated with the src blocks.

In summary, there seems to be a clear intent to attach a caption to
example or source blocks but somehow things are turning out otherwise.

Jambunathan K.

 Best regards,
   Seb

 Footnotes:

 [1] I know for sure it does when the block has grounded parameters (ie, with
 a given value).

-- 




[O] [PATCH] More options in use of headlines as substitute for title field

2011-04-30 Thread Matt Lundin
* lisp/org-bibtex.el (org-bibtex-treat-headline-as-title): New
  defcustom.
  (org-bibtex-headline): Only use headline text (not TODO or other
  metadata) to generate title field and auto key.
  (org-bibtex-fleshout): Allow user to choose whether to treat
  headline as title.
---
This patch consolidates the three patches for org-bibtex I sent last
night. Please delete those patches from the patchwork server.

Thanks! Matt

 lisp/org-bibtex.el |   14 --
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/lisp/org-bibtex.el b/lisp/org-bibtex.el
index f4614fb..8070755 100644
--- a/lisp/org-bibtex.el
+++ b/lisp/org-bibtex.el
@@ -223,6 +223,14 @@ For example setting to 'BIB_' would allow interoperability 
with fireforg.
   :group 'org-bibtex
   :type  'string)
 
+(defcustom org-bibtex-treat-headline-as-title t
+  Treat headline text as title if title property is absent.
+If an entry is missing a title property, use the headline text as
+the property. If this value is t, `org-bibtex-check` will ignore
+a missing title field.
+  :group 'org-bibtex
+  :type 'boolean)
+
 (defcustom org-bibtex-export-arbitrary-fields nil
   When converting to bibtex allow fields not defined in `org-bibtex-fields'.
 This only has effect if org-bibtex-prefix is defined, so as to
@@ -289,7 +297,7 @@ IDs must be unique.
(lambda (field)
  (let ((value (or (org-bibtex-get (from field))
   (and (equal :title field)
-   (org-get-heading)
+   (nth 4 
(org-heading-components))
(when value (cons (from field) value
(flatten
 (val :required (val (to type) org-bibtex-types))
@@ -329,7 +337,9 @@ With optional argument OPTIONAL, also prompt for optional 
fields.
 (keyword (name) (intern (concat : (downcase name
  (name (keyword) (upcase (substring (symbol-name keyword) 1
 (dolist (field (append
-   (remove :title (val :required (val type org-bibtex-types)))
+   (if org-bibtex-treat-headline-as-title
+   (remove :title (val :required (val type 
org-bibtex-types)))
+ (val :required (val type org-bibtex-types)))
(when optional (val :optional (val type 
org-bibtex-types)
   (when (consp field) ; or'd pair of fields e.g., (:editor :author)
 (let ((present (first (remove nil
-- 
1.7.5




Re: [O] Completing with anything

2011-04-30 Thread Michael Markert
On 11 Apr 2011, Michael Markert wrote:
 On 11 Apr 2011, Bastien wrote:

 Julien Danjou jul...@danjou.info writes:

 On Sat, Apr 09 2011, Michael Markert wrote:

 No, but if it's necessary (or helping) I'll do so.

 Well, since org-contacts is part of contrib I think it's not necessary,
 so I'll merge it as it is unless Bastien says I'm wrong.

 You're right.  No need for FSF copyright assignment for code in the
 contrib/ directory, as this directory does not go to the Emacs trunk.

 Still, it's always better to get the assignment process done in case
 code from contrib has to move to Org's core.

 I'll do so then.

 Michael

Today I received the assignment papers and signed them. Next week
they'll be on their way to the FSF.

So feel free to include my code if that hindered you from doing so yet.

Michael


pgp6jgIkBtjBr.pgp
Description: PGP signature


[O] [PATCH] org-get-tags-at: exclude filetags when local is t

2011-04-30 Thread Matt Lundin
* lisp/org.el (org-get-tags-at): Don't include filetags if local is t.

The function org-get-tags-at and the functions that called it were
including inherited file tags even if the user requested only local
tags. This patch fixes the behavior.
---
 lisp/org.el |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index 61668ce..afcd4cb 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -12798,7 +12798,9 @@ ignore inherited ones.
  (or (org-up-heading-safe) (error nil))
  (setq parent t)))
(error nil)
-   (append (org-remove-uniherited-tags org-file-tags) tags)
+   (if local 
+   tags
+ (append (org-remove-uniherited-tags org-file-tags) tags))
 
 (defun org-add-prop-inherited (s)
   (add-text-properties 0 (length s) '(inherited t) s)
-- 
1.7.5




Re: [O] Filtering agenda by tags.

2011-04-30 Thread Mike McLean
On 4/20/11 10:02 AM, Matt Lundin wrote:
 I believe the only option is to write a skip function that uses
 org-entry-get to get all the tags at point.
I have this in my org-setup and use it to generate agenda views that
skip certain tags, whether that tag is local or inherited.

#+begin_src emacs-lisp
  (defun mlm-skip-if-bill-pay()
Skip entries that are Tagged Bill_Pay taking into account inheritance
(let* ((entry-tags (org-get-tags-at (point
  (if (member Bill_Pay entry-tags)
  (progn (outline-next-heading) (point))
nil
)
  )
)
#+end_src

And then the the custom agenda definiitions where I want to exclude
this, I have:

#+begin_src emacs-lisp
(org-agenda-skip-function 'mlm-skip-if-bill-pay)
#+end_src




Re: [O] HTML Postamble is inside Content DIV

2011-04-30 Thread Jonathan BISSON
Sébastien Vauban wxhgmqzgwmuf@... writes:

 
 Hello,
 
 After a couple of tests, I've observed that the postamble is forced to be
 included *inside* the div content.
 
 Proof on Line 1764... These are the ending tags of every HTML page:
 
 #+begin_src emacs-lisp
   (unless body-only (insert \n/div\n/body\n/html\n))
 #+end_src
 
 ... the closing /div referring to the opening of content.
 
 Shouldn't it make sense to be able to insert something *out of* the content
 div?
 
I think so (and the same for preamble)!

I rewrote org-export-as-html and did a custom org-publish-org-to-html to call
it, in order to get them out off the content div (you can look at a first test
on my webpage http://www.bjonnh.net).
It's easy to do it I can send you my file if you are interested.


Cheers,

J.




Re: [O] org-src-fontify-natively makes things very, very slow

2011-04-30 Thread Eric S Fraga
Eric S Fraga e.fr...@ucl.ac.uk writes:

[...]

 The problem with the multiple overlays that were created
 during native fontification is now fixed.  I would be interested
 to know if this improves the situation.

 - Carsten


 Thanks.  I've re-enabled =org-src-fontify-natively= and will let you
 know how I get on!

Carsten,

The past two days I have had this enabled and have been doing a lot of
source code block editing etc.  Everything seems to be working just
fine.  No obvious slowdowns to report.

Thanks,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.226.gc7ed6.dirty)



[O] Documentation suggestion re: buffers containing crypted entries

2011-04-30 Thread Bill Day
I appreciate the warning about encrypted entries, and, I would like to add,
all the hard work and careful thought that has gone into making org-mode
such an incredible piece of software.

I checked the documentation regarding turning off auto-save on pages
containing encrypted entries and saw that the warning was repeated but there
was no advice on how to implement it.  See
http://orgmode.org/worg/org-tutorials/encrypting-files.html

My eventual solution (there may be better ones) was to add a line at the top
of my encrypted page as follows:

# -*- buffer-auto-save-file-name: nil; -*-

This itself generates a warning every time I go to that page, but it seems
to inhibit auto-save. I would like to suggest that a little bit of
explanation of how to turn auto-save on and off be added to the
documentation on encryption with org-mode.

Thank you.

Sincerely,

Bill Day

-- 
Bill Day
williamson@gmail.com


Re: [O] bug in latex export tutorial?

2011-04-30 Thread Eric S Fraga
Robert Goldman rpgold...@sift.info writes:

 On 4/29/11 Apr 29 -1:21 PM, Nick Dokos wrote:

[...]

 amsmath conflicts with wasysym (redefines \iint), so you have to
 redefine your headers to omit wasysym or include amsmath *first*: for
 some reason, if you \usepackage{amsmath} *before* you
 \usepackage{wasysym}, the error does not arise -- presumably, amsmath
 assumes that \iint is not defined beforehand, whereas wasysym does not
 make that assumption.

 The not-very-tasty solution I came up with was to put the following into
 the local variables list at the foot of my file:

 # org-export-latex-default-packages-alist: ((AUTO inputenc t) (T1
 fontenc t) ( fixltx2e nil) ( graphicx t) ( longtable nil)
 ( float nil) ( wrapfig nil) ( soul t) ( t1enc t) (
 textcomp t) ( marvosym t) ( amsmath t) ( wasysym t) (
 latexsym t) ( amssymb t)
 (colorlinks=true,pdfstartview=FitV,linkcolor=blue,citecolor=blue,urlcolor=blue
 hyperref nil) \\tolerance=1000)

 I put this in the file, rather than in my configuration, because it is
 specific to the formatting of this file, and because I share this
 document with others, who need to be able to export from it w/o having
 to reconfigure their org-mode installations.

 I figure that someone can probably suggest a solution that is nicer than
 that!

 Best,
 r

From earlier this year on the mailing list, below is a solution
which works if you more often than not want amsmath; i.e. it's not a
solution for the use case you specify in which you want to share a
single file etc.  However, it's worth repeating this solution for other
use cases.

--8---cut here---start-8---
;; to fix problems with amsmath conflicting with wasysym:
;;
;; From: Lawrence Mitchell we...@gmx.li
;; Subject: [Orgmode] Re: [bug] latex export ignores 
org-export-latex-default-packages-alist?
;; To: emacs-orgmode@gnu.org
;; Date: Wed, 26 Jan 2011 16:01:52 +
(add-to-list 'org-export-latex-packages-alist '( amsmath t))
(setcar (rassoc '(wasysym t) org-export-latex-default-packages-alist) 
integrals)
--8---cut here---end---8---

HTH,
eric

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.226.gc7ed6.dirty)



[O] Dumbquotes in exported source listings

2011-04-30 Thread Avdi Grimm
So I'm writing an eBook with lots of source code listings, using
org-mode-LaTeX-PDF with the minted package providing source code
highlighting. For the most part I'm really, really happy with the
toolchain; thank you to those that pointed me in the direction of
minted.

One issue: my beta reviewers have noted that when copy-and-pasting
source code listings that contain single-quoted strings, they are
getting smart quotes--i.e. the first quote is a backquote, the
second quote is a single quote. This breaks the pasted code.

I'm sure I could track the problem down myself eventually, but I
thought someone here might know which part of the toolchain to look at
first for this quote-munging behavior.

Thanks!

--
Avdi Grimm
http://avdi.org



Re: [O] Dumbquotes in exported source listings

2011-04-30 Thread Ben Finney
Avdi Grimm gro...@inbox.avdi.org writes:

 One issue: my beta reviewers have noted that when copy-and-pasting
 source code listings that contain single-quoted strings, they are
 getting smart quotes--i.e. the first quote is a backquote, the
 second quote is a single quote. This breaks the pasted code.

Those aren't even “smart quotes” (the term usually applied to the quote
characters from Microsoft's standards-violating character set). Those
are what might be called “TeX quotes” (though the convention pre-dates
even TeX), since TeX uses ‘`’ for an opening single quote and ‘``’ for
an opening double quote.

Nowadays with Unicode available ubiquitously we can simply use the
correct typographical quotation marks directly in the plain text file,
but TeX and some other legacy systems don't work very well with Unicode.

-- 
 \  “Often, the surest way to convey misinformation is to tell the |
  `\   strict truth.” —Mark Twain, _Following the Equator_ |
_o__)  |
Ben Finney




Re: [O] Backuping org with git, cron and Dropbox

2011-04-30 Thread Marcelo de Moraes Serpa
Another thing: I'm considering setting the commit cron job to every
hour. So, every hour I would have a fresh copy of org pushed to my
dropbox volume.

I forgot to share the commit.sh (I don't  usually program in bash, so
bear with me :)):

  1 DAYW=$(date | cut -d  -f 1)
  2 NOW=$(date +%d-%m-%Y-%r)
  3
  4 cd ~/org
  5 git add .
  6 git commit -a -m $DAYW-$NOW
  7 git push

Cheers,

Marcelo.

On Sun, May 1, 2011 at 12:29 AM, Marcelo de Moraes Serpa
celose...@gmail.com wrote:
 Hi list,

 I just would like to share the approach I use (just finished setting
 it up) to backup org.

 I keep all my org files on ~/org/*. This is also a git repo. Every
 night at 12:00AM, a cron job will run a sh script that will:

 1) Commit with the current date ( Sat-30-04-2011-11:43:28 PM for example);
 2) push to origin.

 It's simpler than other solution such as backupninja (that I don't if
 would work on dropbox) and keeps also a revision history (per day).

 Here's the remote configuration for git.

  8 [remote origin]
  9   url = /Users/myname/Dropbox/org
  10   fetch = refs/heads/master:refs/heads/origin

 Another thing I should point out is that I'm using (the excellent)
 org-crypt to encrypt sensitive information such as bank accounts data
 and passwords.

 Also, I'm using TimeMachine to backup to an external hard-drive. Time
 machine is not the most efficient of backup solutions but just
 works. I'll see if I can setup backupninja to backup to Dropbox as
 well, if so, I might switch to that.

 Hope might useful for someone out there :)

 Cheers,

 Marcelo.