Re: [Orgmode] [PATCH] sha1 hash of latex fragments to avoid regeneration
Hi Eric, this is fantastic, thank you for implementing it. I have wanted some speedup for this for a long time. I think your implementation still suffers from one issue: The produced image also depends on the variables org-format-latex- options, org-format-latex-header, org-export-latex-package-alist, and on the `forbuffer' flag (because images made for display in the buffer and fo HTML export generaly need different resolution). One way to deal with this would be to make a list containing the values of these four variables and using prin1-to-string to convert this list into a string, and then to prepend this string to TXT when creating the hash. Now, I am sure that you are already planning to do the same for ditaa images etc? That would be a treat, because ditaa can be terribly slow for complex figures, and this would speed up the cycle when writing document by quite a bit. There is one further issue: Cleaning up images that are no longer used. With the LaTeX fragments it is not a big problem, because there live in a special directory. This would be a bigger concern for ditaa images etc which tend to live in the same directory as the source. Maybe that could be solved by 1. Making sure that each image still have a name like "blue", so that the name now would be "blus_loonghashvalue.png" or so. 2. Maybe creating a command that will look for orphaned images and remove them, by looking for the hash in the name and checking access times. I am not sure if this is needed, and not sure what would be the best way to implement it. After looking at these things, I would be *very* happy to accept this patch. - Carsten On Nov 16, 2009, at 1:07 AM, Eric Schulte wrote: Hi, The attached patch changes the latex fragment image generation so that it saves images into files named by the sha1 hash of the latex source code. By checking for the existence of image files before image generation the regeneration of identical images is avoided. In practice I find that this greatly speeds up export to html and the `org-preview-latex-fragment' command. Cheers -- Eric From 13e1c48fa6cac43b0c87ca0fbc8e349f7a9fa864 Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Sun, 15 Nov 2009 17:00:09 -0700 Subject: [PATCH] latex fragment images cached using sha1 hash keys Latex fragment images are now saved in files named by the sha1 hash of the latex text used to create the image. By checking if files exist before images generation the regeneration of identical latex images is avoided. --- lisp/ChangeLog |6 ++ lisp/org.el| 18 +++--- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 339f248..f18755c 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2009-11-16 Eric Schulte + + * org.el (org-format-latex): Latex images are now saved to files + named by the sha1 hash of the latex source text avoiding + regeneration of identical images. + 2009-11-15 Carsten Dominik * org-wl.el (org-wl-store-link): Handle the case that diff --git a/lisp/org.el b/lisp/org.el index bf6573b..46348fc 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -14550,15 +14550,9 @@ Some of the options can be changed using the variable (opt org-format-latex-options) (matchers (plist-get opt :matchers)) (re-list org-latex-regexps) -(cnt 0) txt link beg end re e checkdir +(cnt 0) txt hash link beg end re e checkdir executables-checked m n block linkfile movefile ov) -;; Check if there are old images files with this prefix, and remove them -(when (file-directory-p todir) - (mapc 'delete-file - (directory-files -todir 'full -(concat (regexp-quote prefixnodir) "_[0-9]+\\.png$" ;; Check the different regular expressions (while (setq e (pop re-list)) (setq m (car e) re (nth 1 e) n (nth 2 e) @@ -14576,9 +14570,10 @@ Some of the options can be changed using the variable (setq txt (match-string n) beg (match-beginning n) end (match-end n) cnt (1+ cnt) - linkfile (format "%s_%04d.png" prefix cnt) - movefile (format "%s_%04d.png" absprefix cnt) link (concat block "[[file:" linkfile "]]" block)) +(setq hash (sha1 txt) + linkfile (format "%s_%s.png" prefix hash) + movefile (format "%s_%s.png" absprefix hash)) (if msg (message msg cnt)) (goto-char beg) (unless checkdir ; make sure the directory exists @@ -14592,8 +14587,9 @@ Some of the options can be changed using the variable "dvipng" "needed to convert LaTeX fragments to images") (setq executables-checked t)) - (org-create-formula-image -txt movefile opt forbuffer) +(unless (file-exists-p movefile)
[Orgmode] Bug: Enabling Flyspell mode gave an error [6.33trans]
I get this error everytime I fire up org-mode. I just upgraded to Emacs 23 yesterday, and started seeing this error. I searched around for fixed, and tried a few things but I can't seem to get flyspell to work. Emacs : GNU Emacs 23.1.1 (i386-apple-darwin9.8.0, NS apple-appkit-949.54) of 2009-08-16 on black.local Package: Org-mode version 6.33trans current state: == (setq org-after-todo-state-change-hook '(org-clock-out-if-current) org-export-preprocess-hook '(org-export-blocks-preprocess) org-tab-first-hook '(org-hide-block-toggle-maybe) org-src-mode-hook '(org-src-mode-configure-edit-buffer) org-confirm-shell-link-function 'yes-or-no-p org-agenda-before-write-hook '(org-agenda-add-entry-text) org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-show-empty-lines org-optimize-window-after-visibility-change) org-mode-hook '((lambda nil (org-add-hook (quote change-major-mode-hook) (quote org-show-block-all) (quote append) (quote local)) ) ) org-confirm-elisp-link-function 'yes-or-no-p org-occur-hook '(org-first-headline-recenter) ) ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Search in headings before searching in leaves
I thought it would be a rather useful behavior for isearch to search only in the displayed text. That is to say, if I have a structure such as * Folded Heading 1... * Folded Heading 2... [ whose body has 1 bazillion occurrences of SearchTerm ] * Folded Heading With SearchTerm... * Folded Heading 4... when I do an isearch I would like to jump to the heading (and if I continue pressing C-s cycle back to the occurrences of SearchTerm within Heading 2. Are there existing hacks for org mode or outline mode that would result in such behavior?.. If not, consider this a feature request :) --Leo ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Minor buglet in orgmode Makefile
On Mon, Nov 16, 2009 at 7:49 AM, Robert P. Goldman wrote: > I just pulled an update from git for the first time in a long while, and when > I > tried to build org-mode, it failed with an undefined function error for the > function org-float-time in org-ascii. > > It only took me a moment to find the fix --- it seems like we just need to > push > org-compat up the list of lisp files ahead of org-ascii, since org-compat > provides the function definition org-ascii craves. > I got the same error. This is what I did. $ make clean && make Everything went fine. Thanks and Regards Noorul ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: Request for advice on OrgMobile
Robert P. Goldman sift.info> writes: > > I just installed OrgMobile and I'm delighted with it. > > But I was wondering --- it seems to create only my custom agendas by default. > Is there any way to persuade it to create the daily and weekly agendas on > export? I'd really like to have those at my fingertips. > OK, I see --- never mind! I just create custom agenda commands that mirror what the normal 1-day and 7-day agendas (C-c a a) do, using the org-agenda-ndays to control them. This seems like a normal enough thing to want to do that one might simply add it as an option to org-mobile's configuration (in org-mobile-push, I assume). I might have a whack at providing a patch if no one better does it first ;-) ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] More on GTD, browse todos by priority or creation date
Hi, I just found out this wonderful tool, and have gone through all the tutorials. What I haven't figured out is how to browse todo items by priority or creation date. Let me explain in details. On reading the tutorials, I just found that that I've developed a methodology to handle things I need to do almost exactly as David Allen's Getting Things Done. Moreover, the methodology is backed up with my home- grown simple emacs todo-mode (~200 lines), which allows me, - track everything that need to be done - track their logged/creation time - assign priority to each todo item - put arbitrary amount of info under each item All these are important to me, because most of the todo items are unrelated and belongs to the Someday/Maybe class, which get mind swept into my huge todo file, for me to recall all the things that I thought about doing. What to do next is not only decided based on context, how much time available and my energy level, but also most importantly, their priorities. My todo-mode allows arbitrary priority levels, and todo item's priority can be changed with a single click. Ok, enough off-track babbling, what I want to know is that weather org- mode can somewhat allows me to assign arbitrary levels of priority to my todo list, and let me browse them in their priority order (so that high priority items get done first). The creation date is another way for me to browse my todo items to see what have been on the list for too long. Thanks for your feedbacks -- Tong (remove underscore(s) to reply) http://xpt.sourceforge.net/techdocs/ http://xpt.sourceforge.net/tools/ ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Request for advice on OrgMobile
I just installed OrgMobile and I'm delighted with it. But I was wondering --- it seems to create only my custom agendas by default. Is there any way to persuade it to create the daily and weekly agendas on export? I'd really like to have those at my fingertips. Thanks! ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Minor buglet in orgmode Makefile
I just pulled an update from git for the first time in a long while, and when I tried to build org-mode, it failed with an undefined function error for the function org-float-time in org-ascii. It only took me a moment to find the fix --- it seems like we just need to push org-compat up the list of lisp files ahead of org-ascii, since org-compat provides the function definition org-ascii craves. Cheers, R ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Ignore some lines when using org-plot/gnuplot
Don't worry about a late reply. Sometimes I need a lot of time just to read the E-Mails here in the list (this is one of the most active lists I have ever seen and a really good one to follow) and I wonder how you guys not only read it but also fix bugs and implement new features. Thanks for this Eric. It sure opens a lot of possibilities. - Darlan At Sat, 14 Nov 2009 20:34:55 -0700, Eric Schulte wrote: > > Darlan Cavalcante Moreira writes: > > > Hi everybody, > > > > Is there a way to ignore some lines when using org-plot/gnuplot to plot a > > table > > in Org? I have a table with some expenses, but the last two lines are the > > total > > calculated from the previous lines. I'd like to plot only the expenses and > > ignore the last two lines. > > > > In the docs there is the option "deps" to specify which columns should be > > plotted but I can't find an equivalent for lines (there is a line option > > but I > > understand that it is used to send some extra command to gnuplot). > > > > Hi Darlan, > > Sorry about the extremely delayed reply. I don't believe that what > you've described is possible in the current implementation of org-plot. > It is possible however using org-babel which supports gnuplot. > Org-babel now allows indexing into the values of variable assignments. > > So for example a simple gnuplot example could graph the contents of a > table by assigning that table to a variable > > #+tblname: squares > | 1 | 1 | > | 2 | 4 | > | 3 | 9 | > | 4 | 16 | > | 5 | 25 | > | 6 | 36 | > > #+begin_src gnuplot :var data=squares :results silent > plot data using 1:2 with lines > #+end_src > > with this new change it is possible to assign only part of the table to > a variable as you've described above. For example > > #+tblname: squares-with-sum > | 1 | 1 | > | 2 | 4 | > | 3 | 9 | > | 4 | 16 | > | 5 | 25 | > | 6 | 36 | > |+| > | 21 | 91 | > > #+begin_src gnuplot :var data=squares-with-sum[0:-3] :results silent > plot data using 1:2 with lines > #+end_src > > For more information on indexing see the documentation of the > `org-babel-ref-index-list' function. > > Thanks for motivating this new feature -- Eric > > > > > > > - Darlan > > > > > > ___ > > Emacs-orgmode mailing list > > Remember: use `Reply All' to send replies to the list. > > Emacs-orgmode@gnu.org > > http://lists.gnu.org/mailman/listinfo/emacs-orgmode ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] [PATCH] sha1 hash of latex fragments to avoid regeneration
Hi, The attached patch changes the latex fragment image generation so that it saves images into files named by the sha1 hash of the latex source code. By checking for the existence of image files before image generation the regeneration of identical images is avoided. In practice I find that this greatly speeds up export to html and the `org-preview-latex-fragment' command. Cheers -- Eric >From 13e1c48fa6cac43b0c87ca0fbc8e349f7a9fa864 Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Sun, 15 Nov 2009 17:00:09 -0700 Subject: [PATCH] latex fragment images cached using sha1 hash keys Latex fragment images are now saved in files named by the sha1 hash of the latex text used to create the image. By checking if files exist before images generation the regeneration of identical latex images is avoided. --- lisp/ChangeLog |6 ++ lisp/org.el| 18 +++--- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 339f248..f18755c 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2009-11-16 Eric Schulte + + * org.el (org-format-latex): Latex images are now saved to files + named by the sha1 hash of the latex source text avoiding + regeneration of identical images. + 2009-11-15 Carsten Dominik * org-wl.el (org-wl-store-link): Handle the case that diff --git a/lisp/org.el b/lisp/org.el index bf6573b..46348fc 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -14550,15 +14550,9 @@ Some of the options can be changed using the variable (opt org-format-latex-options) (matchers (plist-get opt :matchers)) (re-list org-latex-regexps) - (cnt 0) txt link beg end re e checkdir + (cnt 0) txt hash link beg end re e checkdir executables-checked m n block linkfile movefile ov) -;; Check if there are old images files with this prefix, and remove them -(when (file-directory-p todir) - (mapc 'delete-file - (directory-files - todir 'full - (concat (regexp-quote prefixnodir) "_[0-9]+\\.png$" ;; Check the different regular expressions (while (setq e (pop re-list)) (setq m (car e) re (nth 1 e) n (nth 2 e) @@ -14576,9 +14570,10 @@ Some of the options can be changed using the variable (setq txt (match-string n) beg (match-beginning n) end (match-end n) cnt (1+ cnt) - linkfile (format "%s_%04d.png" prefix cnt) - movefile (format "%s_%04d.png" absprefix cnt) link (concat block "[[file:" linkfile "]]" block)) +(setq hash (sha1 txt) + linkfile (format "%s_%s.png" prefix hash) + movefile (format "%s_%s.png" absprefix hash)) (if msg (message msg cnt)) (goto-char beg) (unless checkdir ; make sure the directory exists @@ -14592,8 +14587,9 @@ Some of the options can be changed using the variable "dvipng" "needed to convert LaTeX fragments to images") (setq executables-checked t)) - (org-create-formula-image - txt movefile opt forbuffer) +(unless (file-exists-p movefile) + (org-create-formula-image + txt movefile opt forbuffer)) (if overlays (progn (mapc (lambda (o) -- 1.6.4.73.gc144 ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] Re: html export - howto change UP|HOME link style?
> This patch fixes it. I've put the LINK_UP and ..._HOME directly after > the tag: > > > - HERE --- > > How can I now style them with css ...without messing with the other links? > By defining links in "body" for UP and HOME and defining links again in "content" for rest? Eraldo ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
Re: [Orgmode] the great^n grand-daddy of orgmode? :)
Awesome indeed, and amusing. As is the picture of the occasional struggle between Man and his Interface, which perhaps never will go away. (Appreciations however, for those who try to minimize it). Thanks. ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Re: contact management in org-mode?
Matt Lundin writes: I'd agree with Russell's conclusion that if one does not use an emacs mail client, then there is not much point to using BBDB. But if one uses Gnus or the like, the integration BBDB offers (e.g., automated addition of new addresses, auto-notes, TAB completion for addresses, etc.) is still difficult to surpass. Until someone codes some nice integration between an org-mode address database and emacs mail clients, switching to an org database would require one to forgo all the nice automation that BBDB offers. (Do you really want to enter all new email addresses manually in an org file?) I've found BBDB to be incredibly convenient. But I use Gnus for email. If I were using Gmail or Thunderbird or Mutt, I wouldn't use BBDB at all. I do not like the telephone and BBDB eases the displeasure. I guess it's the same with writing checks and addressing envelopes. So I keep important phone numbers and addresses at my fingertips with BBDB and all Internet related business in my Gmail Contacts and Labels. Gnus I use for reading news. ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] [PATCH] Info: clarify all allowed values of PROPERTY in COLUMN definition
Add cross reference to Special properties/Column atrributes node to clarify what may be used in the PROPERTY definition --8<---cut here---start->8--- index d2b4d3c..3c6fe1a 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -4589,6 +4589,7 @@ optional. The individual parts have the following meaning: @var{width} @r{An integer specifying the width of the column in characters.} @r{If omitted, the width will be determined automatically.} @var{property}@r{The property that should be edited in this column.} +@r{Special properties may be used here (@pxref{Special properties})} (title) @r{The header text for the column. If omitted, the} @r{property name is used.} @{...@var{summary-type}@} @r{The summary type. If specified, the column values for} --8<---cut here---end--->8--- ___ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode
[Orgmode] Colors for pre elem. on orgmode.org
Hi, the colors on orgmode.org are made from an Emacs setup with a dark background. Because of the light background on the Web, code examples with syntax highlighting are hard to read. I even avoid #+BEGIN_SRC and use #+BEGIN_EXAMPLE instead. I played a little locally, and found, that the following simple change makes highlighted source code readable. Just put this in an exported HTML file, just before the `' tag and keep the original styles in place, to see the results: pre { background-color:#33; color:white; }These are just the changed values. Unfortunately, this changes the appearance significantly. Dark background for all code. As an alternative, we could change all foreground colors, in that we keep the tint, but reduce the brightness of each. That way we would keep the appearance and have readable code. I've changed the background to be slightly lighter. Just put this in an exported HTML file, just before the `' tag and keep the original styles in place, to see the results: