Re: [O] What happened to org-complete?
on Sat Jul 02 2011, Ryan Reynolds wrote: > On Jul 2, 2011, at 21:06, Dave Abrahams wrote: >>> >>> >> Doesn't every OS GUI bind >> `M-TAB' to a window switcher by default? > > The default Meta key in Mac OS is Option, and window switcher is > Command-Tab. Yes, but of course, like I'm sure many other people, I bind Command to Meta so my fingers don't get totally confused when switching platforms ;-) -- Dave Abrahams BoostPro Computing http://www.boostpro.com
Re: [O] What happened to org-complete?
On Jul 2, 2011, at 21:06, Dave Abrahams wrote: >>> >> >> > Doesn't every OS GUI bind > `M-TAB' to a window switcher by default? The default Meta key in Mac OS is Option, and window switcher is Command-Tab. So while it's not a completely useless default, it does leave 2 out of 3 major OSes out in the cold. -- A. Ryan Reynolds
Re: [O] What happened to org-complete?
on Sat Jul 02 2011, Nick Dokos wrote: > Dave Abrahams wrote: > >> I used to have >> >> (define-key org-mode-map "\M-/" 'org-complete) >> >> in my .emacs. Now that there is no org-complete function, what should I >> bind to `M /' in org buffers? >> > > I think pcomplete, normally bound to M-TAB: > > , > | pcomplete is an interactive compiled Lisp function in `pcomplete.el'. > | > | (pcomplete &optional INTERACTIVELY) > | > | Support extensible programmable completion. > | To use this function, just bind the TAB key to it, or add it to your > | completion functions list (it should occur fairly early in the list). > ` Thanks for the info, Nick Oops, that doesn't do what I want. Is there a way to get pcomplete to fall back to use dabbrev-expand when it can't complete something another way? I'd RTFM but pcomplete seems to be completely undocumented! [No wonder I didn't stumble across pcomplete: Doesn't every OS GUI bind `M-TAB' to a window switcher by default?] -- Dave Abrahams BoostPro Computing http://www.boostpro.com
Re: [O] Move to item to the bottom
Nicolas, the function works quite well! Thanks. Just one last request: Is it possible to not follow the item until the bottom? The issue is that, once running it and when the item is sent to the bottom of the file, the pointer is also put there and the buffer scrolls down with it. Cheers, M> On Sat, Jul 2, 2011 at 2:25 PM, Nicolas Goaziou wrote: > Hello, > > Bastien writes: > > > Nicolas Goaziou writes: > > > >> It needs a better optimization (my excuse for > >> `org-list-delete-item'). I will work on it tonight. > > > > Thanks! > > I've pushed a draft to: > > git://github.com/ngz/org-mode-lists.git move-cycle > > > The branch is made of two patches. The first one implements the > all-mighty (but not-so useful) `org-list-send-item' function. Here is > its doc-string: > > Send ITEM to destination DEST. > > STRUCT is the list structure. > > DEST can have various values. > > If DEST is a buffer position, the function will assume it points > to another item in the same list as ITEM, and will move the > latter just before the former. > > If DEST is `begin' (resp. `end'), ITEM will be moved at the > beginning (resp. end) of the list it belongs to. > > If DEST is a string like "N", where N is an integer, ITEM will > be moved at the Nth position in the list. > > If DEST is `kill-ring', ITEM will be deleted and its body will be > added to the kill-ring. > > If DEST is nil, ITEM will be deleted. > > This function returns, destructively, the new list structure. > > > The second one changes the behavior of `org-move-item-up' (and not > `org-move-item-down, for comparison). When the user tries to move the > first item of a list up, the function will ask him whether he wants to > roll it back to the end of the list, or not. > > I'm not particularly convinced by that feature, but I implemented it > nonetheless for 2 reasons: > 1. it doesn't add yet another key-binding; > 2. it doesn't prevent macros to stop at the beginning of the list > (when using C-u 0 ). > > So, what do you all think about it? > > > Regards, > > -- > Nicolas Goaziou >
[O] Orgmode Capture to Insert a Mairix Link in VM
Hi Gmane! , | Problem -- inserting a Mairix type link when calling Orgmode capture in | VM. Also, opening the link from an Orgmode buffer should retrieve the | message thread through a Mairix search and display it in a VM folder. ` Rest ("rather crude solution") here: http://robert-adesam.blogspot.com/2011/07/orgmode-capture-to-insert-mairix-link.html
Re: [O] What happened to org-complete?
Dave Abrahams wrote: > > Hi all, > > I used to have > > (define-key org-mode-map "\M-/" 'org-complete) > > in my .emacs. Now that there is no org-complete function, what should I > bind to `M /' in org buffers? > I think pcomplete, normally bound to M-TAB: , | pcomplete is an interactive compiled Lisp function in `pcomplete.el'. | | (pcomplete &optional INTERACTIVELY) | | Support extensible programmable completion. | To use this function, just bind the TAB key to it, or add it to your | completion functions list (it should occur fairly early in the list). ` Nick
[O] What happened to org-complete?
Hi all, I used to have (define-key org-mode-map "\M-/" 'org-complete) in my .emacs. Now that there is no org-complete function, what should I bind to `M /' in org buffers? Thanks, -- Dave Abrahams BoostPro Computing http://www.boostpro.com
Re: [O] Function: Extract link location to killring
Bastien writes: > These two snippets could live on Worg -- can anyone add this to > org-hacks.el (or any relevant place)? Done. Hope everythings okay, will check the html export when I wake up. , | commit d0d55a275fa2a78b864ed8eec48ed205aaae42f5 | Author: Memnon Anon | Date: Sun Jul 3 02:14:56 2011 +0200 | | org-hacks.org: Reorganization, added "copy link dest to killring" hack | | Rationale: | * Remove "Enhancing the Org experience" | Everything in org-hacks enhances the org experience. | This headline conveys no information, even worse, it | can easily end up a kitchen sink for all kinds of | information that eventually no one will find anymore. | Distributed hacks to new headlines: | | * New Headlines | - Structure Movement and Editing | - Org Table | - Capture and Remember | - Handling Links | | * Remove Speed Commands | Speed commands are no hack but a regular feature for quite | a while now. So far, there was only a link to the manual | and "add your stuff here". Definately worth a headline | when there is actually content to put in there. ` Memnon
Re: [O] Subtly hightling task backgrounds
On Jul 1, 2011, at 3:53 AM, Bastien wrote: > John Wiegley writes: > >> To achieve this, I have the following in my todo file: > > Nice -- maybe a more general implementation would be to let > users assign a color to a category, which is really one defcustom > away from your code. Would you be willing to submit a patch in > that direction? I would love to, but I'm just too overtaxed at work now. I invite anyone else to hack my patch to death, though. :) John
Re: [O] #+call: and file link
Aloha Christian, Thanks! That's just what I wanted. All the best, Tom Christian Moe writes: > Aloha, > > Try this (should be one line): > > #+call: dated-events-plot[:file out.pdf](bcal=test, theme="gray") > :results file > > Yours, > Christian > > > > On 7/2/11 8:45 PM, Thomas S. Dye wrote: >> Aloha all, >> >> I have a generic R function that creates a plot and returns a link to >> the file in the #+results: line. >> >> When I #+call: the function as follows the plot file is output >> correctly, but the #+results: line doesn't contain a link. >> >> #+call: dated-events-plot[:file out.pdf](bcal=test, theme="gray") >> >> #+results: dated-events-plot[:file out.pdf](bcal=test, theme="gray") >> : out.pdf >> >> How can I #+call: my generic function so the #+results: line contains a >> link? >> >> All the best, >> Tom >> > -- Thomas S. Dye http://www.tsdye.com
Re: [O] Move to item to the bottom
Hello, Bastien writes: > Nicolas Goaziou writes: > >> It needs a better optimization (my excuse for >> `org-list-delete-item'). I will work on it tonight. > > Thanks! I've pushed a draft to: git://github.com/ngz/org-mode-lists.git move-cycle The branch is made of two patches. The first one implements the all-mighty (but not-so useful) `org-list-send-item' function. Here is its doc-string: Send ITEM to destination DEST. STRUCT is the list structure. DEST can have various values. If DEST is a buffer position, the function will assume it points to another item in the same list as ITEM, and will move the latter just before the former. If DEST is `begin' (resp. `end'), ITEM will be moved at the beginning (resp. end) of the list it belongs to. If DEST is a string like "N", where N is an integer, ITEM will be moved at the Nth position in the list. If DEST is `kill-ring', ITEM will be deleted and its body will be added to the kill-ring. If DEST is nil, ITEM will be deleted. This function returns, destructively, the new list structure. The second one changes the behavior of `org-move-item-up' (and not `org-move-item-down, for comparison). When the user tries to move the first item of a list up, the function will ask him whether he wants to roll it back to the end of the list, or not. I'm not particularly convinced by that feature, but I implemented it nonetheless for 2 reasons: 1. it doesn't add yet another key-binding; 2. it doesn't prevent macros to stop at the beginning of the list (when using C-u 0 ). So, what do you all think about it? Regards, -- Nicolas Goaziou
Re: [O] #+call: and file link
Aloha, Try this (should be one line): #+call: dated-events-plot[:file out.pdf](bcal=test, theme="gray") :results file Yours, Christian On 7/2/11 8:45 PM, Thomas S. Dye wrote: Aloha all, I have a generic R function that creates a plot and returns a link to the file in the #+results: line. When I #+call: the function as follows the plot file is output correctly, but the #+results: line doesn't contain a link. #+call: dated-events-plot[:file out.pdf](bcal=test, theme="gray") #+results: dated-events-plot[:file out.pdf](bcal=test, theme="gray") : out.pdf How can I #+call: my generic function so the #+results: line contains a link? All the best, Tom
[O] #+call: and file link
Aloha all, I have a generic R function that creates a plot and returns a link to the file in the #+results: line. When I #+call: the function as follows the plot file is output correctly, but the #+results: line doesn't contain a link. #+call: dated-events-plot[:file out.pdf](bcal=test, theme="gray") #+results: dated-events-plot[:file out.pdf](bcal=test, theme="gray") : out.pdf How can I #+call: my generic function so the #+results: line contains a link? All the best, Tom -- Thomas S. Dye http://www.tsdye.com
Re: [O] [PATCH 2/2] doc/org.texi: Add a new node for OpenDocumentText exporter
> +If you are using Org that comes bundled with Emacs, then you can install the > +OpenDocumentText exporter using the package manager. To do this, customize > +the variable @code{package-archives} to include > +@uref{http://orgmode.org/pkg/releases/} as one of the package archives. > +@end enumerate If you are not in agreement with the above paragraph please delete it from the info manual. Otherwise you can copy the 3 files that you find in the below URL. http://repo.or.cz/w/org-mode/org-jambu.git/tree/HEAD:/packages/emacs-24.1 to the URL of your choosing under http://orgmode.org/pkg and update the manual accordingly. Just a suggestion. Jambunathan K.
[O] [PATCH 2/2] doc/org.texi: Add a new node for OpenDocumentText exporter
>From 1177aa67678e2c9b0fd1d65cd0d87436fd63a08e Mon Sep 17 00:00:00 2001 From: Jambunathan K Date: Sat, 2 Jul 2011 22:40:18 +0530 Subject: [PATCH 2/2] doc/org.texi: Add a new node for OpenDocumentText exporter --- doc/org.texi | 180 +++-- 1 files changed, 173 insertions(+), 7 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index afa1623..d3753ce 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -574,6 +574,7 @@ Exporting * HTML export:: Exporting to HTML * LaTeX and PDF export::Exporting to @LaTeX{}, and processing to PDF * DocBook export:: Exporting to DocBook +* OpenDocumentText export:: Exporting to OpenDocumentText * TaskJuggler export:: Exporting to TaskJuggler * Freemind export:: Exporting to Freemind mind maps * XOXO export:: Exporting to XOXO @@ -610,6 +611,16 @@ DocBook export * Images in DocBook export::How to insert figures into DocBook output * Special characters:: How to handle special characters +OpenDocument export + +* OpenDocumentText export commands::How to invoke OpenDocumentText export +* Applying Custom Styles:: How to apply custom styles to the output +* Converting to Other formats:: How to convert to formats like doc, docx etc +* Links in OpenDocumentText export:: How links will be interpreted and formatted +* Tables in OpenDocumentText export::How Tables are handled +* Images in OpenDocumentText export::How to insert figures +* Additional Documentation:: How to handle special characters + Publishing * Configuration:: Defining projects @@ -9378,11 +9389,13 @@ the web, while the XOXO format provides a solid base for exchange with a broad range of other applications. @LaTeX{} export lets you use Org-mode and its structured editing functions to easily create @LaTeX{} files. DocBook export makes it possible to convert Org files to many other formats using -DocBook tools. For project management you can create gantt and resource -charts by using TaskJuggler export. To incorporate entries with associated -times like deadlines or appointments into a desktop calendar program like -iCal, Org-mode can also produce extracts in the iCalendar format. Currently -Org-mode only supports export, not import of these different formats. +DocBook tools. OpenDocumentText export allows seamless colloboration across +organizational boundaries. For project management you can create gantt and +resource charts by using TaskJuggler export. To incorporate entries with +associated times like deadlines or appointments into a desktop calendar +program like iCal, Org-mode can also produce extracts in the iCalendar +format. Currently Org-mode only supports export, not import of these +different formats. Org supports export of selected regions when @code{transient-mark-mode} is enabled (default in Emacs 23). @@ -9395,6 +9408,7 @@ enabled (default in Emacs 23). * HTML export:: Exporting to HTML * LaTeX and PDF export::Exporting to @LaTeX{}, and processing to PDF * DocBook export:: Exporting to DocBook +* OpenDocumentText export:: Exporting to OpenDocumentText * TaskJuggler export:: Exporting to TaskJuggler * Freemind export:: Exporting to Freemind mind maps * XOXO export:: Exporting to XOXO @@ -10416,7 +10430,7 @@ Here is a simple example Org document that is intended for beamer export. For more information, see the documentation on Worg. -@node DocBook export, TaskJuggler export, LaTeX and PDF export, Exporting +@node DocBook export, OpenDocumentText export, LaTeX and PDF export, Exporting @section DocBook export @cindex DocBook export @cindex PDF export @@ -10613,7 +10627,156 @@ special characters included in XHTML entities: " @end example -@node TaskJuggler export, Freemind export, DocBook export, Exporting +@c begin opendocument + +@node OpenDocumentText export, TaskJuggler export, DocBook export, Exporting +@section OpenDocumentText export +@cindex OpenDocumentText export +@cindex K, Jambunathan + +Org-mode 7.6 supports export to OpenDocumentText format using +@file{org-odt.el} module contributed by Jambunathan K. This module can be +enabled in one of the following ways based on your mode of installation. + +@enumerate +@item +If you have downloaded the Org from the Web, either as a distribution +@file{.zip} or @file{.tar} file, or as a Git archive, enable the @code{odt} +option in variable @code{org-modules}. +@item +If you are using Org that comes bundled with Emacs, then you can install the +OpenDocumentText exporter using the package manager. To do this, customize +the variable @code{package-archives} to include +@uref{http://orgmode.org/pkg/releases/} as one of the package archives. +@end enumerate + +@menu +* OpenDocumentText export commands::How to invoke OpenDocumentText export +* Applying Cu
[O] [PATCH 1/2] org-lparse/org-odt: Add docstring. Silence byte-compiler
I am attaching two org-odt patches for inclusion. Both are desirable and not mandatory. >From 38d0dcbc921d69ba55c3a5bb3a219204800370c9 Mon Sep 17 00:00:00 2001 From: Jambunathan K Date: Sat, 2 Jul 2011 16:51:38 +0530 Subject: [PATCH 1/2] org-lparse/org-odt: Add docstring. Silence byte-compiler. * contrib/lisp/org-odt.el (org-odt-unit-test): Removed. This doesn't belong to production code. * contrib/lisp/org-lparse.el (org-lparse-and-open) (org-lparse-to-buffer, org-lparse-backend) (org-lparse-other-backend, org-lparse-body-only) (org-lparse-to-buffer): Update docstring. --- contrib/lisp/org-lparse.el | 52 +-- contrib/lisp/org-odt.el| 11 - 2 files changed, 40 insertions(+), 23 deletions(-) diff --git a/contrib/lisp/org-lparse.el b/contrib/lisp/org-lparse.el index cff8fd6..b37b683 100755 --- a/contrib/lisp/org-lparse.el +++ b/contrib/lisp/org-lparse.el @@ -50,8 +50,6 @@ ;;; See README.org file that comes with this library for answers to ;;; FAQs and more information on using this library. -;;; Use M-x `org-odt-unit-test' for test driving the odt exporter - ;;; Code: (require 'org-exp) @@ -59,10 +57,11 @@ ;;;###autoload (defun org-lparse-and-open (target-backend native-backend arg) - "Export the outline as HTML and immediately open it with a browser. -If there is an active region, export only the region. -The prefix ARG specifies how many levels of the outline should become -headlines. The default is 3. Lower levels will become bulleted lists." + "Export the outline to TARGET-BACKEND via NATIVE-BACKEND and open exported file. +If there is an active region, export only the region. The prefix +ARG specifies how many levels of the outline should become +headlines. The default is 3. Lower levels will become bulleted +lists." ;; (interactive "Mbackend: \nP") (interactive (let* ((input (if (featurep 'ido) 'ido-completing-read 'completing-read)) @@ -102,8 +101,9 @@ emacs --batch ;;;###autoload (defun org-lparse-to-buffer (backend arg) - "Call `org-lparse` with output to a temporary buffer. -No file is created. The prefix ARG is passed through to `org-lparse'." + "Call `org-lparse' with output to a temporary buffer. +No file is created. The prefix ARG is passed through to +`org-lparse'." (interactive "Mbackend: \nP") (let ((tempbuf (format "*Org %s Export*" (upcase backend (org-lparse backend backend arg nil nil tempbuf) @@ -508,9 +508,36 @@ then that converter is used. Otherwise (defvar org-lparse-toc) (defvar org-lparse-entity-control-callbacks-alist) (defvar org-lparse-entity-format-callbacks-alist) -(defvar org-lparse-backend) -(defvar org-lparse-body-only) -(defvar org-lparse-to-buffer) +(defvar org-lparse-backend nil + "The native backend to which the document is currently exported. +This variable is let bound during `org-lparse'. Valid values are +one of the symbols corresponding to `org-lparse-native-backends'. + +Compare this variable with `org-export-current-backend' which is +bound only during `org-export-preprocess-string' stage of the +export process. + +See also `org-lparse-other-backend'.") + +(defvar org-lparse-other-backend nil + "The target backend to which the document is currently exported. +This variable is let bound during `org-lparse'. This variable is +set to either `org-lparse-backend' or one of the symbols +corresponding to OTHER-BACKENDS specification of the +org-lparse-backend. + +For example, if a document is exported to \"odt\" then both +org-lparse-backend and org-lparse-other-backend are bound to +'odt. On the other hand, if a document is exported to \"odt\" +and then converted to \"doc\" then org-lparse-backend is set to +'odt and org-lparse-other-backend is set to 'doc.") + +(defvar org-lparse-body-only nil + "Bind this to BODY-ONLY arg of `org-lparse'.") + +(defvar org-lparse-to-buffer nil + "Bind this to TO-BUFFER arg of `org-lparse'.") + (defun org-do-lparse (arg &optional hidden ext-plist to-buffer body-only pub-dir) "Export the outline to various formats. @@ -1240,6 +1267,7 @@ But it has the disadvantage, that no cell- or row-spanning is allowed." (org-lparse-do-format-table-table lines) (buffer-substring-no-properties (point-min) (point-max +(defvar table-source-languages) ; defined in table.el (defun org-lparse-format-table-table-using-table-generate-source (backend lines &optional @@ -1948,7 +1976,7 @@ Replaces invalid characters with \"_\"." (defun org-lparse-format-section-number (&optional snumber level) (and org-export-with-section-numbers - (not body-only) snumber level + (not org-lparse-body-only) snumber level (org-lparse-format 'FONTIFY snumber (format "section-number-%d" level (defun org-lparse-warn (msg) diff --git a/contrib/lisp/org-odt.el b/contrib/lisp/org-odt.el index c0b6491..3d28c60 100644 --- a/contrib/lisp/org-odt.el +++ b/contrib/lisp/org-odt.el @@
Re: [O] problem with command-line call to emacsclient
> (defun test-kill-buffer (fname exp-function) > (let ((buf (find-file fname))) > (funcall exp-function) > (kill-buffer buf))) > > (test-kill-buffer "/tmp/abc.txt" 'some-function-to-call) > > will do the trick. > > Regards, Olaf Olaf -- Beauteous, thank you, that did indeed do the trick. -- Herb
Re: [O] Typo in 'org-without-partial-completion'
At Sat, 02 Jul 2011 10:40:31 -0400, Nick Dokos wrote: > > David Maus wrote: > > > > #+begin_src emacs-lisp > > (defmacro org-without-partial-completion (&rest body) > > `(when (and (boundp 'partial-completion-mode) > > (fboundp 'partial-completion-mode)) > >(unwind-protect > >(progn > > (partial-completion-mode -1) > > ,@body) > > (partial-completion-mode 1 > > #+end_src > > > > This avoids leaking if 'body happens to uses a symbol 'pc-mode-p in a > > different context. > > > > Won't this turn on the mode even if it was off before the macro ws called? > And if so, isn't that a problem? Yes and yes. (and (boundp 'partial-completion-mode) partial-completion-mode (fboundp 'partial-completion-mode)) Is the right condition. Bound, non-nil and callable. @Bastien: Pushed fix for this to master. Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de pgp86YD9MvVKA.pgp Description: PGP signature
Re: [O] Bugs and patches hunt before tomorrow
At Sat, 02 Jul 2011 16:05:23 +0200, Bastien wrote: > > Dear all, > > if there is important bugs and patches left, please resubmit > them before tomorrow, as we will release 7.6 tomorrow. And resubmit of this one: http://article.gmane.org/gmane.emacs.orgmode/43235 From 6ad9f33ccb2d8702dd1d4375dd82998f72078e60 Mon Sep 17 00:00:00 2001 From: David Maus Date: Sun, 26 Jun 2011 20:02:42 +0200 Subject: [PATCH] Properly handle relative symlinks when publishing * org-publish.el (org-publish-cache-ctime-of-src): Properly handle relative symlinks. At Thu, 07 Apr 2011 01:11:00 -0400, Nick Dokos wrote: > > org-publish-cache-ctime-of-src tries (but does not always succeed) to > deal with symlinks: file-symlink-p returns the target as a string, but > if the target is relative to the symlink, that's not going to fly. > e.g. if c is a symlink like this > > /a/b/c->../d/f > > then (file-symlink-p "/a/b/c") -> "../d/f" > but if the current directory is any place other than /a/b, the target > will not be found, the file attributes are going to be nil and > the function will blow up. --- lisp/org-publish.el |9 ++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/org-publish.el b/lisp/org-publish.el index 56cc80a..5646430 100644 --- a/lisp/org-publish.el +++ b/lisp/org-publish.el @@ -1157,9 +1157,12 @@ Returns value on success, else nil." (defun org-publish-cache-ctime-of-src (filename) "Get the FILENAME ctime as an integer." - (let ((src-attr (file-attributes (if (stringp (file-symlink-p filename)) - (file-symlink-p filename) -filename + (let* ((symlink-maybe (or (file-symlink-p filename) filename)) +(src-attr (file-attributes (if (file-name-absolute-p symlink-maybe) + symlink-maybe + (expand-file-name + symlink-maybe + (file-name-directory filename)) (+ (lsh (car (nth 5 src-attr)) 16) (cadr (nth 5 src-attr) -- 1.7.2.5 pgpryIvWR3iTp.pgp Description: PGP signature
Re: [O] Bugs and patches hunt before tomorrow
At Sat, 02 Jul 2011 16:05:23 +0200, Bastien wrote: > > Dear all, > > if there is important bugs and patches left, please resubmit > them before tomorrow, as we will release 7.6 tomorrow. Three patches, byte compiler complains with Emacs 22, one for a accidentally scoped variable in org-latex's preprocessor. Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de From ef2ebd1e72ee3b96ffb82acf61e99255dbf712b7 Mon Sep 17 00:00:00 2001 From: David Maus Date: Sat, 2 Jul 2011 16:15:14 +0200 Subject: [PATCH 1/3] Call kill-buffer with argument nil * ob-haskell.el (org-babel-haskell-export-to-lhs): Call kill-buffer with argument indiciating to kill current buffer. Emacs 22 compatibility. GNU Emacs 22.3.2 (i686-pc-linux-gnu) of 2011-05-28 on x60s C-h f kill-buffer RET kill-buffer is an interactive built-in function in `C source code'. It is bound to C-x k. (kill-buffer buffer) Kill the buffer buffer. The argument may be a buffer or the name of a buffer. With a nil argument, kill the current buffer. --- lisp/ob-haskell.el |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/ob-haskell.el b/lisp/ob-haskell.el index 4e3e797..822f90a 100644 --- a/lisp/ob-haskell.el +++ b/lisp/ob-haskell.el @@ -192,7 +192,7 @@ constructs (header arguments, no-web syntax etc...) are ignored." (save-excursion ;; export to latex w/org and save as .lhs (find-file tmp-org-file) (funcall 'org-export-as-latex nil) - (kill-buffer) + (kill-buffer nil) (delete-file tmp-org-file) (find-file tmp-tex-file) (goto-char (point-min)) (forward-line 2) @@ -202,7 +202,7 @@ constructs (header arguments, no-web syntax etc...) are ignored." (replace-match (save-match-data (org-remove-indentation (match-string 0))) t t)) (setq contents (buffer-string)) - (save-buffer) (kill-buffer)) + (save-buffer) (kill-buffer nil)) (delete-file tmp-tex-file) ;; save org exported latex to a .lhs file (with-temp-file lhs-file (insert contents)) -- 1.7.2.5 From 18ceb101fd2b701eefed279b6a13a04119ae016e Mon Sep 17 00:00:00 2001 From: David Maus Date: Sat, 2 Jul 2011 16:27:43 +0200 Subject: [PATCH 2/3] Add missing :group keyword in defcustom * org-html.el (org-export-html-protect-char-alist): Add missing :group keyword in defcustom. --- lisp/org-html.el |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/lisp/org-html.el b/lisp/org-html.el index 6e3bc19..b775834 100644 --- a/lisp/org-html.el +++ b/lisp/org-html.el @@ -565,6 +565,7 @@ a file." ("<" . "<") (">" . ">")) "Alist of characters to be converted by `org-html-protect'." + :group 'org-export-html :type '(repeat (cons (string :tag "Character") (string :tag "HTML equivalent" -- 1.7.2.5 From f88f16c47c3bd23ab6139992259a941b82a52451 Mon Sep 17 00:00:00 2001 From: David Maus Date: Sat, 2 Jul 2011 16:30:00 +0200 Subject: [PATCH 3/3] Use org-string-match-p for backward compatibility with Emacs22 * org-freemind.el (org-freemind-convert-links-helper) (org-freemind-convert-text-p, org-freemind-write-mm-buffer) (org-freemind-get-node-style): Use org-string-match-p for backward compatibility with Emacs22. --- lisp/org-freemind.el |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/org-freemind.el b/lisp/org-freemind.el index 5ea941d..e418659 100644 --- a/lisp/org-freemind.el +++ b/lisp/org-freemind.el @@ -308,7 +308,7 @@ MATCHED is the link just matched." (let* ((link (match-string 1 matched)) (text (match-string 2 matched)) (ext (file-name-extension link)) - (col-pos (string-match-p ":" link)) + (col-pos (org-string-match-p ":" link)) (is-img (and (image-type-from-file-name link) (let ((url-type (substring link 0 col-pos))) (member url-type '("file" "http" "https") @@ -414,7 +414,7 @@ MATCHED is the link just matched." (defun org-freemind-convert-text-p (text) "Convert TEXT to html with paragraphs." ;; (string-match-p "[^ ]" " a") - (setq org-freemind-bol-helper-base-indent (string-match-p "[^ ]" text)) + (setq org-freemind-bol-helper-base-indent (org-string-match-p "[^ ]" text)) (setq text (org-freemind-escape-str-from-org text)) (setq text (replace-regexp-in-string "\\([[:space:]]\\)\\(/\\)\\([^/]+\\)\\(/\\)\\([[:space:]]\\)" "\\1\\3\\5" text)) @@ -658,7 +658,7 @@ Otherwise give an error say the file exists." (defun org-freemind-write-mm-buffer (org-buffer mm-buffer node-at-line) (with-current-buffer org-buffer (dolist (node-style org-freemind-node-styles) - (when (string-match-p (car node-style) buffer-file-name) + (when (org-string-match-p (car node-style) buffer-file-name) (setq org-freemind-node-style (cadr node-style ;;(message "org-freemind-node-style =%s" org-f
Re: [O] Typo in 'org-without-partial-completion'
David Maus wrote: > #+begin_src emacs-lisp > (defmacro org-without-partial-completion (&rest body) > `(when (and (boundp 'partial-completion-mode) > (fboundp 'partial-completion-mode)) >(unwind-protect >(progn > (partial-completion-mode -1) > ,@body) > (partial-completion-mode 1 > #+end_src > > This avoids leaking if 'body happens to uses a symbol 'pc-mode-p in a > different context. > Won't this turn on the mode even if it was off before the macro ws called? And if so, isn't that a problem? Nick
[O] Bugs and patches hunt before tomorrow
Dear all, if there is important bugs and patches left, please resubmit them before tomorrow, as we will release 7.6 tomorrow. Have a good day! -- Bastien
Re: [O] Typo in 'org-without-partial-completion'
At Sat, 02 Jul 2011 11:26:59 +0200, Bastien wrote: > > Hi David and Paul, > > David Maus writes: > > > #+begin_src emacs-lisp > > (defmacro org-without-partial-completion (&rest body) > > `(when (and (boundp 'partial-completion-mode) > > (fboundp 'partial-completion-mode)) > >(unwind-protect > >(progn > > (partial-completion-mode -1) > > ,@body) > > (partial-completion-mode 1 > > #+end_src > > That's clearly better -- thanks for this. I applied this change, > thanks for this improvement! > > Paul, please let me know if things don't behave as expected. da086f9606d1875b5270dd367d7f5326b7ed8e9a ;) david > (sloppy-mode -1) -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de pgp7ujEyaQWqH.pgp Description: PGP signature
Re: [O] caching and code execution on export
Fantastic, the latest git version now works as expected. Thank you! On Fri, Jul 1, 2011 at 3:57 PM, Eric Schulte wrote: > Ista Zahn writes: > >> Hi all, >> I'm giving org-babel another go after a recent retreat back to Sweave. >> I'm having problems with code being executed on export, even when >> :cache yes is in force. Please see the following example. > > Thanks for pointing this out. There were some export-specific header > arguments included in the cache calculation. I've just pushed up a fix > which fixes this issue. Please let me know if you notice any further > problems. > >> Also, a quick question that I can't seem to find the answer to: what >> is the difference between "#+source " and "#+srcname "? >> > > No difference, I believe that #+function is another valid alias. > > Thanks -- Eric > > -- > Eric Schulte > http://cs.unm.edu/~eschulte/ > -- Ista Zahn Graduate student University of Rochester Department of Clinical and Social Psychology http://yourpsyche.org
Re: [O] [PATCH] Documentation on placement options in LaTeX export
Hi Suvayu, sorry for the late answer, I just tried to apply your patch but there are conflicts with the most recent version of org.texi -- would you mind getting the latest git org-mode.git and replay your changes against it? I could then apply your patch. Thanks! -- Bastien
Re: [O] Bug: org-time-stamp loses repeater interval
Hi Karl, Karl Voit writes: > Remark regarding the order of the two entries: the last thing that > gets added/modified is always the last one in this line. So if I > create SCHEDULED and DEADLINE, DEADLINE is the second (last) in the > line. When I modify SCHEDULED afterwards, it is SCHEDULED that gets > positioned at the end of the line. Same for modifications of > DEADLINE. I've pushed fixes so that org-time-stamp, org-scheduled and org-deadline put timestamps in a more stable way. Please check against the latest git repo and report any problem. Thanks! -- Bastien
Re: [O] Bug: org-time-stamp loses repeater interval
Hi Nick, Nick Dokos writes: > The other thing that I *think* I ran into is that occasionally, with a > DEADLINE and SCHEDULED on the same line, changing one would change the > *order*. I did wonder whether org was chronologically ordering them, but > that was not the case. It is now -- most recent timestamp being put first, on the front of the line. Of course, I hope one day DEADLINE and SCHEDULED will just be ordinary properties... so that we can use the org-set-property API instead of going down all the hassle of positioning things "manually" (please don't look at the code of `org-add-planning-info'!!) Best, -- Bastien
Re: [O] Bug: org-time-stamp loses repeater interval
I want to enforce a policy of having SCHEDULED, DEADLINED and CLOSED always on the *same line* -- which is the default behavior when using the command. Would that break too many .org files? -- Bastien
Re: [O] ob-lilypond
Hi On 1 Jul 2011, at 20:27, Eric Schulte wrote: >>> > I can't reproduce this problem, for example the following works for me > on the latest version of Org-mode. I think perhaps you may not be on > the latest git HEAD. > > Thanks again for this great contribution -- Eric > > ** define a block with a name for noweb expansion > :PROPERTIES: > :tangle: yes > :noweb:yes > :END: > > #+source: simple(something="something") > #+begin_src emacs-lisp > something > #+end_src > > another block including the first block > #+begin_src emacs-lisp > <> > #+end_src > > -- > Eric Schulte > http://cs.unm.edu/~eschulte/ OK - It appears I was getting the differing results since I wasn't passing in default parameters to my ruby blocks being called by noweb... was... #+srcname: gen_arpeggio(key,root) now... #+srcname: gen_arpeggio(key="c",root="c") Regards Martyn
Re: [O] FAQ?
Hi all, Marcel van der Boom writes: > Definitely, especially the part about what is considered a proper > outline according to org-mode. Patch welcome! Or even just a paragraph and a section's title for this FAQ. -- Bastien
Re: [O] org table calc and lisp for hh:mm timetable
Hi all, Carsten Dominik writes: > How about introducing another flag for the formula to turn > on time string processing like this? I've implemented this. You can now use the "T" flag to compute durations: | Task 1 | Task 2 | Total | |++-| | 35:00 | 35:00 | 1:10:00 | #+TBLFM: @2$3=$1+$2;T The "T" flag works also for Elisp formulas. | Task 1 | Task 2 | Total | |++-| | 35:00 | 35:00 | 1:10:00 | #+TBLFM: @2$3='(+ $1 $2);T Time values must be of the form [HH:]MM:SS. Thanks to everyone for ideas about this! Of course, timestamp manipulation is what comes next. But please test this and report any problem. Best, -- Bastien
Re: [O] Org-mode is not able to manage complex calendar events
* Bastien wrote: > Hi Karl, Hi! > Karl Voit writes: > > The idea behind some helper commands to let people construct diary > sexp is that: > > - it won't complexify Org's syntax about timestamps > - such help commands can be maintained and improved independantly > from Org I see the benefits of maintaining and re-use of things already invented. This seems to be a trade-off: easy to use vs. maintaining/re-use. I am happy to be able to be a part of creating a user friendly sexp assistant which enables flexible and easy to use user experience for complicated timestamps. > Moreover, the search for a nice interface to building diary sexp > could help understanding what could be the best syntax for Org itself. Good point. > It's not that I'm too lazy to implement (I'm a bit, of course), but > I really think the syntax of timestamps should be "improved" very > carefully... it's the core of Org. Full ack. -- Karl Voit
Re: [O] problem with command-line call to emacsclient
Herbert Sitz writes: > I'm making a call to an emacsclient and trying to figure out how to get the > buffer to unload at the end of the function I'm calling. I know kill-buffer > isn't supposed to unload the buffer but I can't figure out what will. I've > tried server-edit and server-kill-buffer in place of kill-buffer below and > they > also haven't worked. The buffer gets "pushed to the kill buffer", but remains > loaded. > > The problem with having buffer remain loaded is when I redo the command-line > call after editing the org file outside of emacs it prompts user for whether > to > reload changed file. One option would be to simply disable that prompt, I > guess, but I'd rather be able to clear the buffer. > > Here's the function I'm calling: > -- > (defun vimorg-export-publish (fname exp-function) > (find-file fname) > (funcall exp-function nil) > (kill-buffer) ) > - I tried this in *scratch* and it works fine: (defun test-kill-buffer (fname) (find-file fname) (kill-buffer)) C-x C-e (test-kill-buffer "/tmp/abc.txt") C-x C-e Repeat the steps and leave out the "(kill-buffer)" and the file /tmp/abc.txt remains in emacs. > > And here's sample command line that calls it. Strange characters are because > it's on Windows system, but it works fine other than that the buffer is not > unloaded at end of vimorg-export-publish function: > - > c:\users\herbert\emacsclientw.exe --eval ^"(vimorg-export-publish > \^"~/myorgfile.org\^" 'org-export-as-html-and-open )^" > -- So it must be something with (funcall exp-function) or exp-function, which prevents unloading `fname'. Maybe org-export-as-html-and-open changes buffers. So, I guess either a save-excursion around (funcall ...) or: (defun test-kill-buffer (fname exp-function) (let ((buf (find-file fname))) (funcall exp-function) (kill-buffer buf))) (test-kill-buffer "/tmp/abc.txt" 'some-function-to-call) will do the trick. Regards, Olaf
Re: [O] how to change the headline starter *
Hi Darlan, Darlan Cavalcante Moreira writes: > I don't think this is possible. The "*" as a headline starter seems to be > hard-coded in org. I confirm this is not possible, it's hardcoded in outline-mode, and Org is derived from this mode. As this is a FAQ, I added an entry in Worg/org-faq.org Cheers, -- Bastien
Re: [O] problem with utf8 todo keywords
Hi Carsten, Carsten Dominik writes: > Try this: > > (add-hook 'org-mode-hook >(lambda () > (modify-syntax-entry (string-to-char "\u25b6") "w") > (modify-syntax-entry (string-to-char "\u25b8") "w"))) > > > Matt, maybe this information could go into the FAQ? Added -- the section is "Can I use a arbitrary character in a TODO keyword?" Thanks for the tip, -- Bastien
Re: [O] :table-line-pos is not document in the manual
Hi Darlan, Darlan Cavalcante Moreira writes: > While reading the manual, I noticed that the :table-line-pos property is > not documented. It is documented in the org-capture-templates variable, > but not in the manual. Just a follow-up on this: I see it has already been fixed and appear in the manual. -- Bastien
Re: [O] Function: Extract link location to killring
Memnon, Eric, Memnon Anon writes: > (defun my-extract-link () > "Extract the link location at point and put it on the killring." > (interactive) > (when (org-in-regexp org-bracket-link-regexp 1) > (kill-new (org-link-unescape (org-match-string-no-properties 1) Eric S Fraga writes: > And if you do this, saving it as a kmacro, you can generate code that > does this: > > #+begin_src emacs-lisp > (fset 'getlink > (lambda (&optional arg) > "Keyboard macro." > (interactive "p") > (kmacro-exec-ring-item (quote ("\C-c\C-l\C-a\C-k\C-g" 0 "%d")) arg))) > #+end_src > > You can then bind /getlink/ to a key or execute it directly with > M-x getlink RET These two snippets could live on Worg -- can anyone add this to org-hacks.el (or any relevant place)? Thanks in advance! -- Bastien
Re: [O] Typo in 'org-without-partial-completion'
Hi David and Paul, David Maus writes: > #+begin_src emacs-lisp > (defmacro org-without-partial-completion (&rest body) > `(when (and (boundp 'partial-completion-mode) > (fboundp 'partial-completion-mode)) >(unwind-protect >(progn > (partial-completion-mode -1) > ,@body) > (partial-completion-mode 1 > #+end_src That's clearly better -- thanks for this. I applied this change, thanks for this improvement! Paul, please let me know if things don't behave as expected. -- Bastien
[O] [Accepted] Add org-lparse and org-odt as contrib modules
Patch 818 (http://patchwork.newartisans.com/patch/818/) is now "Accepted". Maintainer comment: Removed org-lparse.el from org-modules This relates to the following submission: http://mid.gmane.org/%3C817h817nfj.fsf%40gmail.com%3E Here is the original message containing the patch: > Content-Type: text/plain; charset="utf-8" > MIME-Version: 1.0 > Content-Transfer-Encoding: 7bit > Subject: [O] Add org-lparse and org-odt as contrib modules > Date: Sat, 02 Jul 2011 01:31:28 - > From: Jambunathan K > X-Patchwork-Id: 818 > Message-Id: <817h817nfj@gmail.com> > To: emacs-orgmode@gnu.org > > -- > > > >From 9b97d19c1184d3cf2cc82831e3d29067cf91f014 Mon Sep 17 00:00:00 2001 > From: Jambunathan K > Date: Sat, 2 Jul 2011 01:56:01 +0530 > Subject: [PATCH] Add org-lparse and org-odt as contrib modules > > * lisp/org.el (org-modules): Add org-lparse and org-odt as > contrib modules. > * contrib/README: Ditto > --- > contrib/README |2 ++ > lisp/org.el|2 ++ > 2 files changed, 4 insertions(+), 0 deletions(-) > > diff --git a/contrib/README b/contrib/README > index c076c89..05a2635 100644 > --- a/contrib/README > +++ b/contrib/README > @@ -33,12 +33,14 @@ org-interactive-query.el --- Interactive modification of > tags query > org-invoice.el --- Help manage client invoices in OrgMode > org-jira.el --- Add a jira:ticket protocol to Org > org-learn.el --- SuperMemo's incremental learning algorithm > +org-lparse.el--- Library for building custom exporters > org-mac-iCal.el --- Imports events from iCal.app to the Emacs diary > org-mac-link-grabber.el --- Grab links and URLs from various Mac > applications > org-mairix.el --- Hook mairix search into Org for different > MUAs > org-man.el--- Support for links to manpages in Org-mode > org-mime.el --- org html export for text/html MIME emails > org-mtags.el --- Support for some Muse-like tags in Org-mode > +org-odt.el--- OpenDocumentText exporter for Org-mode > org-panel.el --- Simple routines for us with bad memory > org-registry.el --- A registry for Org links > org-screen.el--- Visit screen sessions through Org-mode links > diff --git a/lisp/org.el b/lisp/org.el > index 6824f38..0edeb9d 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -329,12 +329,14 @@ to add the symbol `xyz', and the package must have a > call to > > (const :tag "C jira: Add a jira:ticket protocol to > Org-mode" org-jira) > (const :tag "C learn: SuperMemo's incremental learning > algorithm" org-learn) > + (const :tag "C lparse:Library for building custom > exporters" org-lparse) > (const :tag "C mairix:Hook mairix search into Org-mode for > different MUAs" org-mairix) > (const :tag "C notmuch: Provide org links to notmuch > searches or messages" org-notmuch) > (const :tag "C mac-iCal Imports events from iCal.app to the > Emacs diary" org-mac-iCal) > (const :tag "C mac-link-grabber Grab links and URLs from various Mac > applications" org-mac-link-grabber) > (const :tag "C man: Support for links to manpages in > Org-mode" org-man) > (const :tag "C mtags: Support for muse-like tags" > org-mtags) > + (const :tag "C odt: OpenDocumentText exporter for > Org-mode" org-odt) > (const :tag "C panel: Simple routines for us with bad > memory" org-panel) > (const :tag "C registry: A registry for Org-mode links" > org-registry) > (const :tag "C org2rem: Convert org appointments into > reminders" org2rem) > -- > 1.7.2.3 > >
Re: [O] Org-mode is not able to manage complex calendar events
Hi Karl, Karl Voit writes: > For example. > > Or an extended syntax of the existing timestamps as I suggested > somewhere in this thread: > > <2011-07-01 Fri +1w> <-2011-07-08 Fri> > > ... or similar for an exception of a recurring event. thanks for the suggestion, I saw it in your previous email. The idea behind some helper commands to let people construct diary sexp is that: - it won't complexify Org's syntax about timestamps - such help commands can be maintained and improved independantly from Org Moreover, the search for a nice interface to building diary sexp could help understanding what could be the best syntax for Org itself. It's not that I'm too lazy to implement (I'm a bit, of course), but I really think the syntax of timestamps should be "improved" very carefully... it's the core of Org. > I'd be glad to be of help in terms of brainstorming or «usability > evaluation». Thanks for bringing this issue to discussion! -- Bastien
Re: [O] [PATCH] Add org-lparse and org-odt as contrib modules
Jambunathan K writes: >>From 9b97d19c1184d3cf2cc82831e3d29067cf91f014 Mon Sep 17 00:00:00 2001 > From: Jambunathan K > Date: Sat, 2 Jul 2011 01:56:01 +0530 > Subject: [PATCH] Add org-lparse and org-odt as contrib modules Applied, thanks. I removed org-lparse.el from org-modules, I think users don't need to know about this module, which is already loaded by org-odt.el -- let me know if I miss something here. -- Bastien
Re: [O] [PATCH] Fix some #+ blocks fontification when there is no lang attribute
Eric Schulte writes: > Fixed. Thanks for reporting -- Eric Er, thanks for fixing this typo Eric. -- Bastien
Re: [O] Move to item to the bottom
Nicolas Goaziou writes: > That's what I thought. You are talking about headlines whereas my code > was about plain lists: FWIW, I was also talking about plain lists, not headlines. -- Bastien
Re: [O] foot note / enumeration question
Hello, Robert Klein writes: > A file of > > #+begin_example > * Title > > This is a text [fn:: the > 1. footnote] with a footnote. > #+end_example > > begins an enumeration inside the footenote and then > forgets to close the footnote (which in LaTeX export > gets closed at the next \section or so). > > I'm not sure what the expected behavior should be -- I'd > obviously prefer no enumerations in footnotes :) Is there > a way to specify this in the header, e.g. > enum-in-footnotes: nil or similar? Just thinking when > someone pute literary references in footnotes this could > be useful (e.g.: [fn:: My fun. pp. 3-5, 12. edition, O'Really, > 1996. London, New York...] ) This confusing case shouldn't happen, unless the user somehow does it on purpose. Indeed, Org prevents auto-filling to break a line where it would create a new list item. This looks to me as a false problem ; I don't think we should write some workaround for it. Regards, -- Nicolas Goaziou
Re: [O] Move to item to the bottom
Hello, Marcelo de Moraes Serpa writes: >> Or are we talking about two different things? > > Not sure, maybe. What I mean is: > > gtd.org file: > > * TODO Blah > * TODO Foo > * TODO bar [...] That's what I thought. You are talking about headlines whereas my code was about plain lists: - Blah - Foo - bar Forget about it then. To achieve the desired effect, you may simply use this: #+begin_src emacs-lisp (defun ngz-move-headline-at-bottom () "Move current headline to the last position in the same tree." (interactive) (unless (org-at-heading-p) (error "Not at an headline")) (while (ignore-errors (org-move-subtree-down #+end_src Regards, -- Nicolas Goaziou
Re: [O] Typo in 'org-without-partial-completion'
At Thu, 30 Jun 2011 21:28:08 +0200, David Maus wrote: > > At Thu, 30 Jun 2011 11:12:15 +0200, > Bastien wrote: > > > > Hi Paul, > > > > Paul Sexton writes: > > > > > I think there's an error in 'org-without-partial-completion' in > > > org-macs.el. > > > The variable pc-mode gets bound to the value of partial-completion-mode - > > > but > > > this is a VARIABLE (t if that mode is enabled). Funcalling the value of > > > the variable produces an error, unsurprisingly. This breaks insertion of > > > properties with 'org-set-property'. > > > > > > Fixing it involves quoting the the symbol as shown below: > > > > > > > > > (defmacro org-without-partial-completion (&rest body) > > >`(let ((pc-mode (and (boundp 'partial-completion-mode) > > > 'partial-completion-mode))) ; <-- quote added > > > (unwind-protect > > > (progn > > > (when pc-mode (funcall pc-mode -1)) > > > ,@body) > > > (when pc-mode (funcall pc-mode 1) > > > > I've just reverted this modification, per Sebastian report. > > > > Can you be more precise about the problem it creates with > > org-set-property? > > > > Can you check if this version fixes the problems, if any? > > > > #+begin_src emacs-lisp > > (defmacro org-without-partial-completion (&rest body) > > `(let ((pc-mode ,(and (boundp 'partial-completion-mode) > > 'partial-completion-mode))) > > (unwind-protect > > (progn > >(when pc-mode (funcall pc-mode -1)) > >,@body) > >(when pc-mode (funcall pc-mode 1) > > #+end_src emacs-lisp > > No, I think this won't work. On compile time the byte compiler will > expand the macro and place the expansion in the byte compiled > lisp. Thus it will evaluate the ,(and ...) condition at compile time. > > http://www.gnu.org/software/emacs/elisp/html_node/Compiling-Macros.html#Compiling-Macros > > #+begin_quote > When a macro call appears in a Lisp program being compiled, the Lisp > compiler calls the macro definition just as the interpreter would, and > receives an expansion. But instead of evaluating this expansion, it > compiles the expansion as if it had appeared directly in the > program. As a result, the compiled code produces the value and side > effects intended for the macro, but executes at full compiled > speed. This would not work if the macro body computed the value and > side effects itself—they would be computed at compile time, which is > not useful. > #+end_quote > > What about this: > > #+begin_src emacs-lisp > (defmacro org-without-partial-completion (&rest body) > `(let ((pc-mode-p (and (boundp 'partial-completion-mode) >(fboundp 'partial-completion-mode >(when pc-mode-p > (unwind-protect > (progn >(partial-completion-mode -1) >,@body) >(partial-completion-mode 1) > #+end_src > > This will turn off partial-completion-mode if the symbol is non-nil > and callable. Or even better: #+begin_src emacs-lisp (defmacro org-without-partial-completion (&rest body) `(when (and (boundp 'partial-completion-mode) (fboundp 'partial-completion-mode)) (unwind-protect (progn (partial-completion-mode -1) ,@body) (partial-completion-mode 1 #+end_src This avoids leaking if 'body happens to uses a symbol 'pc-mode-p in a different context. Best, -- David -- OpenPGP... 0x99ADB83B5A4478E6 Jabber dmj...@jabber.org Email. dm...@ictsoc.de pgpgpK7S42BCW.pgp Description: PGP signature