Re: [O] orgstruct: broken global visibility cycling, when in comments

2013-06-15 Thread Christopher Schmidt
Nathaniel Cunningham nathaniel.cunning...@gmail.com writes:
 I have orgstruct-heading-prefix-regexp set to ^;;.

Does setting orgstruct-heading-prefix-regexp to ;; make a difference?

Christopher



Re: [O] orgstruct in emacs -nw

2013-05-23 Thread Christopher Schmidt
 I tried to use the orgstruct minor mode, but it didn't seem to do
 anything, although I used exactly the same setup Bastien showed in his
 interview[1].

 After a while, I realized it was because I was using emacs in an
 xterm.  Steps to reproduce below.[2]

Some bindings, such as M-TAB, C-n or C-p, should work fine.

 Wrong setup, a bug or intentional?

This is a bug.  Can you please give this patch a try and see if it
corrects the issue?  Apply it on master (06cdb2d).  Thanks!
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8960,26 +8960,30 @@ buffer.  It will also recognize item context in multiline items.
 (let ((f (or (car-safe cell) cell))
 	  (disable-when-heading-prefix (cdr-safe cell)))
   (when (fboundp f)
-	(dolist (binding (nconc (where-is-internal f org-mode-map)
-(where-is-internal f outline-mode-map)))
-	  ;; TODO use local-function-key-map
-	  (dolist (rep '((tab . TAB)
-			 (return . RET)
-			 (escape . ESC)
-			 (delete . DEL)))
-	(setq binding (read-kbd-macro
-			   (let ((case-fold-search))
-			 (replace-regexp-in-string
-			  (regexp-quote (cdr rep))
-			  (car rep)
-			  (key-description binding))
-	  (let ((key (lookup-key orgstruct-mode-map binding)))
-	(when (or (not key) (numberp key))
-	  (condition-case nil
-		  (org-defkey orgstruct-mode-map
-			  binding
-			  (orgstruct-make-binding f binding disable-when-heading-prefix))
-		(error nil
+	(let ((new-bindings))
+	  (dolist (binding (nconc (where-is-internal f org-mode-map)
+  (where-is-internal f outline-mode-map)))
+	(push binding new-bindings)
+	;; TODO use local-function-key-map
+	(dolist (rep '((tab . TAB)
+			   (return . RET)
+			   (escape . ESC)
+			   (delete . DEL)))
+	  (setq binding (read-kbd-macro
+			 (let ((case-fold-search))
+			   (replace-regexp-in-string
+(regexp-quote (cdr rep))
+(car rep)
+(key-description binding)
+	  (cl-pushnew binding new-bindings :test 'equal)))
+	  (dolist (binding new-bindings)
+	(let ((key (lookup-key orgstruct-mode-map binding)))
+	  (when (or (not key) (numberp key))
+		(condition-case nil
+		(org-defkey orgstruct-mode-map
+binding
+(orgstruct-make-binding f binding disable-when-heading-prefix))
+		  (error nil)
   (run-hooks 'orgstruct-setup-hook))
 
 (defun orgstruct-make-binding (fun key disable-when-heading-prefix)

Christopher


Re: [O] Bug in structmode++?

2013-05-12 Thread Christopher Schmidt
The Dude rafal.kowal...@mac.com writes:
 No, you're not alone.  I'm experiencing the same behavior and I'm
 running the exact same versions.   It's really annoying.

 org-version: 8.0.2; emacs-version: 24.3.1

Please give the current master a try.

Christopher



Re: [O] Bug in structmode++?

2013-05-07 Thread Christopher Schmidt
Bastien b...@gnu.org writes:
 orgstruct(++)-mode used to set auto-fill-function to
 'org-auto-fill-function.  This behaviour is too intrusive so we
 removed it.  You either need to indent secondary lines by hand or set
 auto-fill-function back to org-auto-fill-function.

 I don't remember why it was too intrusive, it worked fine for me.

We overwrite the major mode's custom value of auto-fill-function.  This
is not The Right Thing in each and every case.

In message-mode this is not important,

(defun message-do-auto-fill ()
  Like `do-auto-fill', but don't fill in message header.
  (unless (message-point-in-header-p)
(do-auto-fill)))

org-auto-fill-function does not do much harm here.  That is not the case
for most prog modes, though.

You can easily get the old behaviour back by setting auto-fill-function
to org-auto-fill-function after you activate orgstruct{,++}-mode.

 orgstruct++'s hijacker of org-insert-heading-respect-content did not
 respect item bodies.  I fixed this in master a few minutes ago.

 I just tried with orgstruct-mode and I still have the problem.

orgstruct-mode does not respect item-body context - see this form in
orgstruct-make-binding:

(org-context-p 'headline 'item
   ,(when (memq fun
'(org-insert-heading
  org-insert-heading-respect-content
  org-meta-return))
  '(when orgstruct-is-++
 'item-body)))

I think that's a feature.

 With orgstruct++-mode, M-RET on the second line of an item inserts an
 item correctly, but there is another problem (also for
 orgstruct-mode): M-RET on the first line of a two-lines item will
 insert the new item in the middle of the item...

So does vanilla org-mode?


Most people use orgstruct{,++}-mode in message-mode, right?  I think it
makes sense to use vanilla org here.  That is, make an indirect buffer
of the message-mode buffer, narrow the buffer to the message body and
set the major mode to org-mode.  This should give one all the power of
Org, including links, footnotes, font-lock and so on, without that
orgstruct-mess.

Christopher



Re: [O] Bug in structmode++?

2013-05-06 Thread Christopher Schmidt
Nicolas Goaziou n.goaz...@gmail.com writes:
 Igor Sosa Mayor joseleopoldo1...@gmail.com writes:

 Thanks Nicolas. At least, I dont feel alone anymore... Is there any
 chance this getting fixed somehow? I used to use it very often in my
 emails and I miss it.

 I miss it, too.

 I didn't follow recent changes to orgstruct-mode, so I cannot help
 here.  I hope that someone more knowledgeable than I am will jump in.

orgstruct(++)-mode used to set auto-fill-function to
'org-auto-fill-function.  This behaviour is too intrusive so we removed
it.  You either need to indent secondary lines by hand or set
auto-fill-function back to org-auto-fill-function.

orgstruct++'s hijacker of org-insert-heading-respect-content did not
respect item bodies.  I fixed this in master a few minutes ago.

741bc5c * origin/master master org.el: Execute org-insert-heading
and org-insert-heading-respect-content in orgstruct++-mode when the
context around point is an item-body.

Christopher



Re: [O] Visibility cycling applied on several windows

2013-04-02 Thread Christopher Schmidt
Thorsten Jolitz tjol...@gmail.com writes:
 maybe this is what you need (untested):

 http://www.gnu.org/software/emacs/manual/html_node/emacs/Indirect-Buffers.html

No, an indirect buffer shares its parent's text properties.

Christopher



Re: [O] [bug] orgstruct has suddenly become overly opinionated about legal keystrokes

2013-03-29 Thread Christopher Schmidt
Eric Schulte schulte.e...@gmail.com writes:
 I'm seeing this same problem when editing email with the latest Org-mode
 and OrgStruct mode.

 Meta-RET raises the error

   orgstruct-error: This key has no function outside structure elements

This corner case is worked around in master now.

310e76b org.el (orgstruct-make-binding): Keep modifiers when translating 
keys

Christopher



Re: [O] org-check.org confusion

2013-03-20 Thread Christopher Schmidt
Loyall, David david.loy...@nebraska.gov writes:
 Dear orgmode users: what does that represent?

(info (emacs)Interlocking)

Christopher



Re: [O] S-M-right problem in orgstruct-mode

2013-03-10 Thread Christopher Schmidt
Bastien b...@altern.org writes:

Hi there,

 Alan Schmitt alan.schm...@polytechnique.org writes:

 even though the cursor is on a structure element. Maybe a more
 information this function is disabled would work (if it's possible).
 But as I said, it's a nitpick.

thank you very much for testing the patch.

 I agree with Alan, let's update the user-error to something more
 informative -- Christopher, thanks a lot for the patch!  Feel free
 to commit and push when you want.

Disabled commands are no-ops now.  I pushed this to origin/master.

03b1edf org.el: Disable {pro,de}motion commands in orgstruct-mode if 
orgstruct-heading-prefix-regexp is non-nil

Christopher



Re: [O] ox-html.el removal

2013-03-10 Thread Christopher Schmidt
Detlef Steuer detlef.ste...@gmx.de writes:
 But: The papers the FSF asked you to sign were constructed for exactly
 this case I assume.

That's not right.

https://www.gnu.org/licenses/why-assign.html

I am not a copyright lawyer.  So is everyone else subscribed to this
list.  The FSF's copyright clerk should assist on this issue.

#+BEGIN my2cents
If Jambunathan does not want code he wrote to be part of Org any more,
I'd respect his wish.  At first sight this is a loss for Org.  This
does not need to be the end, though.  GSoC is coming up, rewriting
specific exporter look like great projects.

Jambunathan did not mention what is going to happen to his code.

Jambu, are you going to maintain the code you wrote separately.  If so,
is code free, libre and upwards compatible to future Org releases?
#+END

A long yet somewhat relevant read:

https://lwn.net/Articles/529522/
http://thread.gmane.org/gmane.comp.encryption.gpg.gnutls.devel/6465

Christopher



Re: [O] S-M-right problem in orgstruct-mode

2013-03-09 Thread Christopher Schmidt
Bastien b...@altern.org writes:
 Alan Schmitt alan.schm...@polytechnique.org writes:

 and do a shift-meta-right on the second line, I get:

 #+BEGIN_SRC emacs-lisp
 ;;; * Test 1
 ** Test2
 #+END_SRC

 I confirm this issue.

 The easiest thing to do is to prevent some commands to run when
 `orgstruct-mode' is on and `orgstruct-heading-prefix-regexp' is
 non-nil.

I agree.  I will come up with a patch ASAP.

( In the long term this should be fixed properly.  Considering that
  point is already on an actual headline, Org just needs to add or
  remove a star.  This should not be too hard with org-heading-regexp. )

Christopher



Re: [O] S-M-right problem in orgstruct-mode

2013-03-09 Thread Christopher Schmidt
Bastien b...@altern.org writes:
 Christopher Schmidt christop...@ch.ristopher.com writes:
 ( In the long term this should be fixed properly.  Considering that
   point is already on an actual headline, Org just needs to add or
   remove a star.  This should not be too hard with
   org-heading-regexp. )

 Beware that there are *many* commands conditionally called by
 org-metaright, org-metaleft, etc.: org-do-demote, org-do-promote and
 the like.

 It would be too much to make all these commands take the value of
 `orgstruct-heading-prefix-regexp' into account, even if we end up
 using a macro `org-with-heading-prefix-regexp' and calling these
 commands from within the macro.  Perhaps accepting some limitations
 will be the right thing, not sure.

That is not necessary.  The hijacking command already makes sure
org-heading-regexp takes orgstruct-heading-prefix-regexp into account.
Nonetheless It is still a lot of work.

Alan, here is patch for master that should solve the issue.  It disables
org-{pr,de}mote and org-{,shift}meta{left,right} in orgstruct-mode iff
orgstruct-heading-prefix-regexp is non-nil.  Could you please give it a
try and tell us what you think?
diff --cc lisp/org.el
index 811506a,a7670dc..000
--- a/lisp/org.el
+++ b/lisp/org.el
@@@ -8743,72 -8695,78 +8743,80 @@@ buffer.  It will also recognize item co
  
  (defun orgstruct-setup ()
Setup orgstruct keymap.
-   (dolist (f
-'(org-meta
-  org-shift
-  org-shiftmeta
-  org-shifttab
-  org-backward-element
-  org-backward-heading-same-level
-  org-ctrl-c-ret
- 	 org-ctrl-c-minus
- 	 org-ctrl-c-star
-  org-cycle
-  org-forward-heading-same-level
-  org-insert-heading
-  org-insert-heading-respect-content
-  org-kill-note-or-show-branches
-  org-mark-subtree
-  org-narrow-to-subtree
-  org-promote-subtree
-  org-reveal
-  org-show-subtree
-  org-sort
-  org-up-element
-  outline-demote
-  outline-next-visible-heading
-  outline-previous-visible-heading
-  outline-promote
-  outline-up-heading
-  show-children))
- (dolist (f (if (stringp f)
-(let ((flist))
-  (dolist (postfix
-   '(-return tab left right up down)
-   flist)
-(let ((f (intern (concat f postfix
-  (when (fboundp f)
-(push f flist)
-  (list f)))
-   (dolist (binding (nconc (where-is-internal f org-mode-map)
-   (where-is-internal f outline-mode-map)))
- ;; TODO use local-function-key-map
- (dolist (rep '((tab . TAB)
-(return . RET)
-(escape . ESC)
-(delete . DEL)))
-   (setq binding (read-kbd-macro (replace-regexp-in-string
- 	 (regexp-quote (car rep))
- 	 (cdr rep)
- 	 (key-description binding)
- (let ((key (lookup-key orgstruct-mode-map binding)))
-   (when (or (not key) (numberp key))
- 	(condition-case nil
- 		(org-defkey orgstruct-mode-map
- 			binding
- 			(orgstruct-make-binding f binding))
- 	  (error nil)))
+   (dolist (cell '((org-demote . t)
+ 		  (org-metaleft . t)
+ 		  (org-metaright . t)
+ 		  (org-promote . t)
+ 		  (org-shiftmetaleft . t)
+ 		  (org-shiftmetaright . t)
+ 		  org-backward-element
+ 		  org-backward-heading-same-level
+ 		  org-ctrl-c-ret
++		  org-ctrl-c-minus
++		  org-ctrl-c-star
+ 		  org-cycle
+ 		  org-forward-heading-same-level
+ 		  org-insert-heading
+ 		  org-insert-heading-respect-content
+ 		  org-kill-note-or-show-branches
+ 		  org-mark-subtree
+ 		  org-meta-return
+ 		  org-metadown
+ 		  org-metaup
+ 		  org-narrow-to-subtree
+ 		  org-promote-subtree
+ 		  org-reveal
+ 		  org-shiftdown
+ 		  org-shiftleft
+ 		  org-shiftmetadown
+ 		  org-shiftmetaup
+ 		  org-shiftright
+ 		  org-shifttab
+ 		  org-shifttab
+ 		  org-shiftup
+ 		  org-show-subtree
+ 		  org-sort
+ 		  org-up-element
+ 		  outline-demote
+ 		  outline-next-visible-heading
+ 		  outline-previous-visible-heading
+ 		  outline-promote
+ 		  outline-up-heading
+ 		  show-children))
+ (let ((f (or (car-safe cell) cell))
+ 	  (disable-when-heading-prefix (cdr-safe cell)))
+   (when (fboundp f)
+ 	(dolist (binding (nconc (where-is-internal f org-mode-map)
+ (where-is-internal f outline-mode-map)))
+ 	  ;; TODO use local-function-key-map
+ 	  (dolist (rep '((tab . TAB)
+ 			 (return . RET)
+ 			 (escape . ESC)
+ 			 (delete . DEL)))
+ 	(setq binding (read-kbd-macro (replace-regexp-in-string
+ 	   (regexp-quote (car rep))
+ 	   (cdr rep)
+ 	   (key-description

Re: [O] S-M-right problem in orgstruct-mode

2013-03-09 Thread Christopher Schmidt
Alan Schmitt alan.schm...@polytechnique.org writes:
 Looking at it there seems to be occurrences of '++' that are a bit
 strange. Was it garbled when attached?

Ooops, I forgot to finalise my merge.
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8658,7 +8658,7 @@ If WITH-CASE is non-nil, the sorting will be case-sensitive.
 ;; command.  There might be problems if any of the keys is otherwise
 ;; used as a prefix key.
 
-(defcustom orgstruct-heading-prefix-regexp 
+(defcustom orgstruct-heading-prefix-regexp nil
   Regexp that matches the custom prefix of Org headlines in
 orgstruct(++)-mode.
   :group 'org
@@ -8743,72 +8743,80 @@ buffer.  It will also recognize item context in multiline items.
 
 (defun orgstruct-setup ()
   Setup orgstruct keymap.
-  (dolist (f
-   '(org-meta
- org-shift
- org-shiftmeta
- org-shifttab
- org-backward-element
- org-backward-heading-same-level
- org-ctrl-c-ret
-	 org-ctrl-c-minus
-	 org-ctrl-c-star
- org-cycle
- org-forward-heading-same-level
- org-insert-heading
- org-insert-heading-respect-content
- org-kill-note-or-show-branches
- org-mark-subtree
- org-narrow-to-subtree
- org-promote-subtree
- org-reveal
- org-show-subtree
- org-sort
- org-up-element
- outline-demote
- outline-next-visible-heading
- outline-previous-visible-heading
- outline-promote
- outline-up-heading
- show-children))
-(dolist (f (if (stringp f)
-   (let ((flist))
- (dolist (postfix
-  '(-return tab left right up down)
-  flist)
-   (let ((f (intern (concat f postfix
- (when (fboundp f)
-   (push f flist)
- (list f)))
-  (dolist (binding (nconc (where-is-internal f org-mode-map)
-  (where-is-internal f outline-mode-map)))
-;; TODO use local-function-key-map
-(dolist (rep '((tab . TAB)
-   (return . RET)
-   (escape . ESC)
-   (delete . DEL)))
-  (setq binding (read-kbd-macro (replace-regexp-in-string
-	 (regexp-quote (car rep))
-	 (cdr rep)
-	 (key-description binding)
-(let ((key (lookup-key orgstruct-mode-map binding)))
-  (when (or (not key) (numberp key))
-	(condition-case nil
-		(org-defkey orgstruct-mode-map
-			binding
-			(orgstruct-make-binding f binding))
-	  (error nil)))
+  (dolist (cell '((org-demote . t)
+		  (org-metaleft . t)
+		  (org-metaright . t)
+		  (org-promote . t)
+		  (org-shiftmetaleft . t)
+		  (org-shiftmetaright . t)
+		  org-backward-element
+		  org-backward-heading-same-level
+		  org-ctrl-c-ret
+		  org-ctrl-c-minus
+		  org-ctrl-c-star
+		  org-cycle
+		  org-forward-heading-same-level
+		  org-insert-heading
+		  org-insert-heading-respect-content
+		  org-kill-note-or-show-branches
+		  org-mark-subtree
+		  org-meta-return
+		  org-metadown
+		  org-metaup
+		  org-narrow-to-subtree
+		  org-promote-subtree
+		  org-reveal
+		  org-shiftdown
+		  org-shiftleft
+		  org-shiftmetadown
+		  org-shiftmetaup
+		  org-shiftright
+		  org-shifttab
+		  org-shifttab
+		  org-shiftup
+		  org-show-subtree
+		  org-sort
+		  org-up-element
+		  outline-demote
+		  outline-next-visible-heading
+		  outline-previous-visible-heading
+		  outline-promote
+		  outline-up-heading
+		  show-children))
+(let ((f (or (car-safe cell) cell))
+	  (disable-when-heading-prefix (cdr-safe cell)))
+  (when (fboundp f)
+	(dolist (binding (nconc (where-is-internal f org-mode-map)
+(where-is-internal f outline-mode-map)))
+	  ;; TODO use local-function-key-map
+	  (dolist (rep '((tab . TAB)
+			 (return . RET)
+			 (escape . ESC)
+			 (delete . DEL)))
+	(setq binding (read-kbd-macro (replace-regexp-in-string
+	   (regexp-quote (car rep))
+	   (cdr rep)
+	   (key-description binding)
+	  (let ((key (lookup-key orgstruct-mode-map binding)))
+	(when (or (not key) (numberp key))
+	  (condition-case nil
+		  (org-defkey orgstruct-mode-map
+			  binding
+			  (orgstruct-make-binding f binding disable-when-heading-prefix))
+		(error nil
   (run-hooks 'orgstruct-setup-hook))
 
-(defun orgstruct-make-binding (fun key)
+(defun orgstruct-make-binding (fun key disable-when-heading-prefix)
   Create a function for binding in the structure minor mode.
 FUN is the command to call inside a table.  KEY is the key that
-should be checked in for a command to execute outside of tables.
+should be checked in for a command to execute outside of tables.
+Non-nil DISABLE-WHEN-HEADING-PREFIX means to disable the command

Re: [O] [bug] orgstruct has suddenly become overly opinionated about legal keystrokes

2013-02-25 Thread Christopher Schmidt
Sebastien Vauban wxhgmqzgwmuf-genee64ty+gs+fvcfc7...@public.gmane.org 
writes:
 [...] is new behavior as of the last couple of weeks.

 ... and I also experience a quite recent change.

 Before, when composing an email, I could edit lists and convert them
 from itemized to enumerated ones, such in:

   - blond   -   1. blond
   - brown   -   2. brown

 ... by S-right'ing on it:

This should be fixed in master.

de5ff23 org.el: Bind org-shift* in orgstruct-mode.

Christopher



Re: [O] TeX-master: TeX-master is let-bound

2013-02-23 Thread Christopher Schmidt
Bastien b...@altern.org writes:

Hi Bastien,

 The problem is not in master anymore,

That's great!

 I add AUCTeX from ELPA, then I emacs -Q and loaded autoload-auctex.el
 to make sure the autoloads were correct.

I can reproduce this.  (Current maint, GNU Emacs 24.2.93.2)

Did you push AUCTeX's directory in load-path?  Does the docstring of
latex-mode mention AUCTeX?

 I have this in my minimal config:

   (add-to-list 'auto-mode-alist '(\\.tex\\' nil TeX-LaTeX-mode))

That is not necessary.

 Please let me know if you have another recipe to reproduce
 the bug, I want to get rid of this issue before 7.9.4.

Unfortunately I see is no other easy way to reproduce this.

(I am fine with wontfix in maint.)

Christopher



Re: [O] [bug] orgstruct has suddenly become overly opinionated about legal keystrokes

2013-02-22 Thread Christopher Schmidt
Eric Schulte schulte.e...@gmail.com writes:
 I use orgstruct mode in my message mode, so that I may easily include
 tables and lists when writing and responding to mail.

orgstruct-mode does not help you with tables.  That is orgtbl-mode.

 This week, I've suddenly noticed that when I press meta-RET in message
mode with orgstruct mode enabled, Org-struct returns the error

   orgstruct-error: This key has no function outside structure elements

 However, orgstruct should (and used to) just pass this key combo
 through to the underlying major mode.

orgstruct-mode tries to but does not find an appropriate key binding.

Does this patch help?  (Apply and restart Emacs.)
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8621,7 +8621,7 @@ buffer.  It will also recognize item context in multiline items.
   (where-is-internal f outline-mode-map)))
 ;; TODO use local-function-key-map
 (dolist (rep '((tab . TAB)
-   (ret . RET)
+   (return . RET)
(esc . ESC)
(del . DEL)))
   (setq binding (read-kbd-macro (replace-regexp-in-string

 This is new behavior as of the last couple of weeks.

That's my fault.  I am sorry.

Christopher


[O] Bug: org-map-entries docstring

2013-02-22 Thread Christopher Schmidt
C-h f org-map-entries RET

The remaining args are treated as settings for the skipping
facilities of the scanner.  The following items can be given here:

  archiveskip trees with the archive tag.
  commentskip trees with the COMMENT keyword
  function or Emacs Lisp form:
 will be used as value for `org-agenda-skip-function',
 so whenever the function returns t, FUNC will not be
 
 called for that entry and search will continue from the
 ^^^
 point where the function leaves it.
 ^^
That is wrong.  Function must return a buffer position or nil.

Christopher



Re: [O] [bug] orgstruct has suddenly become overly opinionated about legal keystrokes

2013-02-22 Thread Christopher Schmidt
Eric Schulte schulte.e...@gmail.com writes:
 Yes this fixes the problem.

Thank you.  I committed this.

14df16d org.el: Use longest form when translating keys.

Christopher



Re: [O] TeX-master: TeX-master is let-bound

2013-02-19 Thread Christopher Schmidt
Over at emacs-devel Tassilo Horn hit on the very same problem.  This is
what Glenn said (har4kdkrnv@fencepost.gnu.org):

Tassilo Horn wrote:

 (let ((crm-separator ,))
   (require 'crm))

This is a long-standing issue. The only solution at the moment is
don't do that.

Christopher



Re: [O] orgstruct-mode with custom headline prefix

2013-02-13 Thread Christopher Schmidt
Christopher Schmidt christop...@ch.ristopher.com writes:
 I will push a fix ASAP.

I did that now.

d6f69f5 org.el: Use let instead of progv in org-run-like-in-org-mode
ea2d107 org.el: Declare orgstruct-mode

Christopher



Re: [O] [BUG] (error Lisp nesting exceeds `max-lisp-eval-depth')

2013-02-13 Thread Christopher Schmidt
Sebastien Vauban wxhgmqzgwmuf-genee64ty+gs+fvcfc7...@public.gmane.org 
writes:
 Since the last pull I made, I can't expand anymore BBDB aliases in
 Gnus...  because of Org!
 Debugger entered--Lisp error: (error Lisp nesting exceeds 
 `max-lisp-eval-depth')

It looks like this is orgstruct-mode and yas-snippet both hijacking the
TAB key and ultimately falling back to each other.  Could you please
give master + this patch a try?
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -8672,7 +8672,8 @@ should be checked in for a command to execute outside of tables.
  'item-body)))
 (org-run-like-in-org-mode ',fun)
 t))
-  (let ((binding (let ((orgstruct-mode)) (key-binding ,key
+  (let* ((orgstruct-mode)
+		 (binding (key-binding ,key)))
 (if (keymapp binding)
 (set-temporary-overlay-map binding)
   (call-interactively

Christopher


Re: [O] [BUG] (error Lisp nesting exceeds `max-lisp-eval-depth')

2013-02-13 Thread Christopher Schmidt
Sebastien Vauban wxhgmqzgwmuf-genee64ty+gs+fvcfc7...@public.gmane.org 
writes:
 What's weird is that I applied the patch, and then did C-M-x with the
 cursor in the function. I did test composing an email, and it still
 did not work.

 I restarted Emacs to be really, really sure, and now it works!

 So, I don't know what's bad in the above procedure (C-M-x of the
 fucntion), but your patch works, yes.

That is expected.  The function is only executed the very first time you
enable orgstruct\(++\)-mode.

orgstruct-mode is an ugly hack.  So is yasnippet.  There is no fix for
this problem, just a workaround that can introduce other issues in
somewhat rare and obscure corner cases.

I applied the patch.

7c27e57 org.el: Disable orgstruct-mode when falling back to original command

Christopher



Re: [O] Bug in orgstruct++?

2013-02-13 Thread Christopher Schmidt
Thorsten Jolitz tjol...@gmail.com writes:
 after upgrading to the newest git-version just moments ago, I had to
 disable orgstruct++ in message-mode because of this error:

 ,
 | org-defkey: Key sequence C-c @ C- starts with non-prefix key C-c @
 `

Fixed in master.

e7403d6 org.el: Ignore errors when bindings keys in orgstruct-setup

Christopher



Re: [O] orgstruct-mode with custom headline prefix

2013-02-12 Thread Christopher Schmidt
Achim Gratz strom...@nexgo.de writes:
 This introduces the following failures in compilation with Emacs 24.2
 and has a high chance of not working at all in some setups:
 --8---cut here---start-8---
 Compiling /home/gratz/lisp/org-mode/lisp/org.el...

 In org-heading-components:
 org.el:7436:16:Warning: reference to free variable `orgstruct-mode'

 In org-run-like-in-org-mode:
 org.el:8841:20:Warning: function `cl-progv-before' from cl package called at
 runtime

 In end of data:
 org.el:23217:1:Warning: the function `cl-progv-after' is not known to be
 defined.
 --8---cut here---end---8---

Great.

 …and no, I have no idea how that single progv macro manages to expand to
 use these two functions.

These internal functions should have been autoloaded.  progv is pretty
obscure and I guess noone has noticed that bug in cl-macs until now.

 Emacs 24.3.93 seems to have that fixed,

So does 24.2.x.

I will push a fix ASAP.

 but complains about this instead:
 In org-heading-components:
 org.el:7436:16:Warning: reference to free variable `orgstruct-mode'

This one is bogus, the variable is defined later on.  I will silence
that warning.

Christopher



Re: [O] orgstruct-mode with custom headline prefix

2013-02-10 Thread Christopher Schmidt
Christopher Schmidt christop...@ch.ristopher.com writes:
 Here is the patch.  Now one just needs

 ;; Local Variables:
 ;; eval: (orgstruct-mode 1)
 ;; orgstruct-heading-prefix-regexp: ;;; 
 ;; End:

This is in master now.  The commit is a3f6570.

Christopher



Re: [O] Off for the next four days

2013-02-01 Thread Christopher Schmidt
Bastien b...@altern.org writes:
 I've released Org 7.9.3e, a minor fixes release, which makes current
 agenda optimizations available to The Rest of The World.

Thank you so much for your hard work.

Would it be possible to set an announce-only mailing list up?

Christopher



Re: [O] orgstruct-mode with custom headline prefix

2013-01-31 Thread Christopher Schmidt
Bastien b...@altern.org writes:
 Can you give an indication on how it impacts the generation of agenda?
 This is a potential blocker.

It should not impact agenda generation at all - neither feature nor
performance-wise.  All non-trivial changes are in parts of the code that
directly relate to orgstruct-mode or
org-\(forward\|backward\)-heading-same-level.  These functions and their
internals are not used non-interactively.

 Also, we won't be able to apply such a change until you assign your
 copyright to the FSF.  I'm not asking you to go through this now
 because I'm not sure we should apply the patch, but just to let you
 know.

I am familiar with the procedure.  The copyright of this patch goes to
the FSF, of course, and I have FSF papers signed.

Christopher



Re: [O] orgstruct-mode with custom headline prefix

2013-01-31 Thread Christopher Schmidt
Bastien b...@altern.org writes:

Hi Bastien,

 Bastien b...@altern.org writes:
 Can you give an indication on how it impacts the generation of
 agenda?  This is a potential blocker.

 It should not impact agenda generation at all - neither feature nor
 performance-wise.  All non-trivial changes are in parts of the code
 that directly relate to orgstruct-mode or
 org-\(forward\|backward\)-heading-same-level.  These functions and
 their internals are not used non-interactively.

 org-outline-regexp-bol, org-\(forward\|backward\)-heading-same-level
 are fundamental vars/functions -- any change here is likely to impact
 the agenda generation.  So while I hope you're right, I'd feel better
 with figures and tests :)

org-outline-regexp-bol value is ^org-outline-regexp.  There is one place
in org where org-outline-regexp-bol is actually set -
org-with-limited-levels.  It is let-bound to (concat ^
org-outline-regexp).

BTW what is the reason for having both org-outline-regexp and
org-outline-regexp-bol?  Matching the latter should be
faster than the former.

org-\(forward\|backward\)-heading-same-level are referenced
non-interactively in three functions - org-forward-element,
org-backward-element and org-copy-subtree.  I checked the implementation
of these functions and I did not see how the new behaviour should break
these functions.

After all, the functions now do what they are supposed to do.  Try this:

* Org
** Achim
** Bastien
** Carsten
* Diary

Place point on Achim and C-c C-b.  Place point on Casten and C-c C-f.

All my agendas generate just fine.  I am not exactly sure how I can
provide figures and tests.  We do not have any agenda test cases in the
first place.

Please take a look at the patch when you have time.  The diff is not
that scary.

Greetings,

Christopher



Re: [O] ...

2013-01-31 Thread Christopher Schmidt
Carsten Dominik carsten.domi...@gmail.com writes:
 Hi Christopher,

 I mant to copy the list, I am doing this again now.

 Wow, I was not aware that Emacs caches by content, this is an important piece 
 of
 information.  I guess this removed the main concern I had.  Thanks for looking
 it up in the code and showing it to me.  I am not sure if I understand that 
 code
 completely, but i trust your judgment.

Please, do not trust me.  This should be brought up to emacs-devel and
the definite answer should be documented in (info (elisp)Regular
Expressions).

Thanks a lot for your input.  Greetings,

Christopher



Re: [O] orgstruct-mode with custom headline prefix (was: ...)

2013-01-31 Thread Christopher Schmidt
Carsten Dominik carsten.domi...@gmail.com writes:
 I was just thinking, if you are setting up two local variables, you
 could set up three and include org-outline-regexp-bol as well.  Or,
 you could just set up org-outline-regexp', and make the function
 org-struct-mode set up the other two as additional local variables.
 This would simplify things.  In fact, I think this would make for a
 more compact and better patch, Christopher, what do you think?

I agree.  I am not sure how to deduce org-heading-regexp from
org-outline-regexp, though.  Maybe we can use a buffer-local
orgstruct-heading-prefix and setup
org-heading-regexp/org-outline-regexp(-bol) from this one?

Here is my patch with org-outline-regexp-bol being a variable and being
set up by the hijacker commands using org-outline-regexp.
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -92,6 +92,7 @@
 ;; job when `orgstruct-mode' is active.
 (defvar org-outline-regexp \\*+ 
   Regexp to match Org headlines.)
+;;;###autoload(put 'org-outline-regexp 'safe-local-variable 'stringp)
 
 (defvar org-outline-regexp-bol ^\\*+ 
   Regexp to match Org headlines.
@@ -101,6 +102,7 @@ sure that we are at the beginning of the line.)
 (defvar org-heading-regexp ^\\(\\*+\\)\\(?: +\\(.*?\\)\\)?[ \t]*$
   Matches an headline, putting stars and text into groups.
 Stars are put in group 1 and the trimmed body in group 2.)
+;;;###autoload(put 'org-heading-regexp 'safe-local-variable 'stringp)
 
 ;; Emacs 22 calendar compatibility:  Make sure the new variables are available
 (when (fboundp 'defvaralias)
@@ -6223,8 +6225,10 @@ and subscripts.
 
 (defvar org-cycle-global-status nil)
 (make-variable-buffer-local 'org-cycle-global-status)
+(put 'org-cycle-global-status 'org-state t)
 (defvar org-cycle-subtree-status nil)
 (make-variable-buffer-local 'org-cycle-subtree-status)
+(put 'org-cycle-subtree-status 'org-state t)
 
 (defvar org-inlinetask-min-level)
 
@@ -7403,13 +7407,24 @@ This is a list with the following elements:
 - the tags string, or nil.
   (save-excursion
 (org-back-to-heading t)
-(if (let (case-fold-search) (looking-at org-complex-heading-regexp))
-	(list (length (match-string 1))
-	  (org-reduced-level (length (match-string 1)))
-	  (org-match-string-no-properties 2)
-	  (and (match-end 3) (aref (match-string 3) 2))
-	  (org-match-string-no-properties 4)
-	  (org-match-string-no-properties 5)
+(if (let (case-fold-search)
+  (looking-at
+   (if orgstruct-mode
+   org-heading-regexp
+ org-complex-heading-regexp)))
+(if orgstruct-mode
+(list (length (match-string 1))
+  (org-reduced-level (length (match-string 1)))
+  nil
+  nil
+  (match-string 2)
+  nil)
+  (list (length (match-string 1))
+(org-reduced-level (length (match-string 1)))
+(org-match-string-no-properties 2)
+(and (match-end 3) (aref (match-string 3) 2))
+(org-match-string-no-properties 4)
+(org-match-string-no-properties 5))
 
 (defun org-get-entry ()
   Get the entry text, after heading, entire subtree.
@@ -8482,12 +8497,12 @@ If WITH-CASE is non-nil, the sorting will be case-sensitive.
 ;; command.  There might be problems if any of the keys is otherwise
 ;; used as a prefix key.
 
-;; Another challenge is that the key binding for TAB can be tab or \C-i,
-;; likewise the binding for RET can be return or \C-m.  Orgtbl-mode
-;; addresses this by checking explicitly for both bindings.
+(defcustom orgstruct-setup-hook nil
+  Hook run after orgstruct-mode-map is filled.
+  :group 'org
+  :type 'hook)
 
-(defvar orgstruct-mode-map (make-sparse-keymap)
-  Keymap for the minor `orgstruct-mode'.)
+(defvar orgstruct-initialized nil)
 
 (defvar org-local-vars nil
   List of local variables, for use by `orgstruct-mode'.)
@@ -8498,26 +8513,13 @@ If WITH-CASE is non-nil, the sorting will be case-sensitive.
 This mode is for using Org-mode structure commands in other
 modes.  The following keys behave as if Org-mode were active, if
 the cursor is on a headline, or on a plain list item (both as
-defined by Org-mode).
-
-M-upMove entry/item up
-M-down	Move entry/item down
-M-left	Promote
-M-right	Demote
-M-S-up	Move entry/item up
-M-S-downMove entry/item down
-M-S-leftPromote subtree
-M-S-right   Demote subtree
-M-q	Fill paragraph and items like in Org-mode
-C-c ^	Sort entries
-C-c -	Cycle list bullet
-TAB Cycle item visibility
-M-RET   Insert new heading/item
-S-M-RET Insert new TODO heading / Checkbox item
-C-c C-c Set tags / toggle checkbox
-  nil  OrgStruct nil
-  (org-load-modules-maybe)
-  (and (orgstruct-setup) (defun orgstruct-setup () nil)))
+defined by Org-mode).
+  nil  OrgStruct (make-sparse-keymap)
+  (when orgstruct-mode
+(org-load-modules-maybe)
+(unless 

Re: [O] orgstruct-mode with custom headline prefix

2013-01-31 Thread Christopher Schmidt
Bastien b...@altern.org writes:
 PS: To make things clear: I'm confident the patch is good, but I will
 put it higher on my patch review process if I know the agenda does not
 slow down :)

Here is the patch.  Now one just needs

;; Local Variables:
;; eval: (orgstruct-mode 1)
;; orgstruct-heading-prefix-regexp: ;;; 
;; End:

It cannot get any easier than this.

2013-01-31  Christopher Schmidt  christop...@ch.ristopher.com

* org.el (org-cycle-global-status, org-cycle-subtree-status): Set
state property.
(org-heading-components): Use org-heading-regexp in
orgstruct-mode.
(orgstruct-heading-prefix-regexp, orgstruct-setup-hook): New
options.
(orgstruct-initialized): New variable.
(orgstruct-mode): Simplify implementation.
(orgstruct-setup): Simplify implementation.  Translate keys to
their most general equivalent.
(orgstruct-make-binding): Generate index on the fly.  Discard
alternative keys.  Bind variables according to
orgstruct-heading-prefix-regexp.
(org-get-local-variables): Honour state property.
(org-run-like-in-org-mode): Do not override variables with
non-default values.
(org-forward-heading-same-level): Do not skip to headlines on
another level.  Handle negative prefix argument correctly.
(org-backward-heading-same-level): Use
org-forward-heading-same-level.
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6223,8 +6223,10 @@ and subscripts.
 
 (defvar org-cycle-global-status nil)
 (make-variable-buffer-local 'org-cycle-global-status)
+(put 'org-cycle-global-status 'org-state t)
 (defvar org-cycle-subtree-status nil)
 (make-variable-buffer-local 'org-cycle-subtree-status)
+(put 'org-cycle-subtree-status 'org-state t)
 
 (defvar org-inlinetask-min-level)
 
@@ -7403,13 +7405,24 @@ This is a list with the following elements:
 - the tags string, or nil.
   (save-excursion
 (org-back-to-heading t)
-(if (let (case-fold-search) (looking-at org-complex-heading-regexp))
-	(list (length (match-string 1))
-	  (org-reduced-level (length (match-string 1)))
-	  (org-match-string-no-properties 2)
-	  (and (match-end 3) (aref (match-string 3) 2))
-	  (org-match-string-no-properties 4)
-	  (org-match-string-no-properties 5)
+(if (let (case-fold-search)
+  (looking-at
+   (if orgstruct-mode
+   org-heading-regexp
+ org-complex-heading-regexp)))
+(if orgstruct-mode
+(list (length (match-string 1))
+  (org-reduced-level (length (match-string 1)))
+  nil
+  nil
+  (match-string 2)
+  nil)
+  (list (length (match-string 1))
+(org-reduced-level (length (match-string 1)))
+(org-match-string-no-properties 2)
+(and (match-end 3) (aref (match-string 3) 2))
+(org-match-string-no-properties 4)
+(org-match-string-no-properties 5))
 
 (defun org-get-entry ()
   Get the entry text, after heading, entire subtree.
@@ -8482,12 +8495,19 @@ If WITH-CASE is non-nil, the sorting will be case-sensitive.
 ;; command.  There might be problems if any of the keys is otherwise
 ;; used as a prefix key.
 
-;; Another challenge is that the key binding for TAB can be tab or \C-i,
-;; likewise the binding for RET can be return or \C-m.  Orgtbl-mode
-;; addresses this by checking explicitly for both bindings.
+(defcustom orgstruct-heading-prefix-regexp 
+  Regexp that matches the custom prefix of Org headlines in
+orgstruct(++)-mode.
+  :group 'org
+  :type 'string)
+;;;###autoload(put 'orgstruct-heading-prefix-regexp 'safe-local-variable 'stringp)
+
+(defcustom orgstruct-setup-hook nil
+  Hook run after orgstruct-mode-map is filled.
+  :group 'org
+  :type 'hook)
 
-(defvar orgstruct-mode-map (make-sparse-keymap)
-  Keymap for the minor `orgstruct-mode'.)
+(defvar orgstruct-initialized nil)
 
 (defvar org-local-vars nil
   List of local variables, for use by `orgstruct-mode'.)
@@ -8498,26 +8518,13 @@ If WITH-CASE is non-nil, the sorting will be case-sensitive.
 This mode is for using Org-mode structure commands in other
 modes.  The following keys behave as if Org-mode were active, if
 the cursor is on a headline, or on a plain list item (both as
-defined by Org-mode).
-
-M-upMove entry/item up
-M-down	Move entry/item down
-M-left	Promote
-M-right	Demote
-M-S-up	Move entry/item up
-M-S-downMove entry/item down
-M-S-leftPromote subtree
-M-S-right   Demote subtree
-M-q	Fill paragraph and items like in Org-mode
-C-c ^	Sort entries
-C-c -	Cycle list bullet
-TAB Cycle item visibility
-M-RET   Insert new heading/item
-S-M-RET Insert new TODO heading / Checkbox item
-C-c C-c Set

Re: [O] orgstruct-mode with custom headline prefix

2013-01-31 Thread Christopher Schmidt
Christopher Schmidt christop...@ch.ristopher.com writes:

This is the memory profiler result.

 a2febd210182d9e1a37b0d7fd9ee007a10abc4bc refs/remotes/origin/HEAD
 Saved working directory and index state WIP on master: a2febd2 Merge 
 branch 'maint'
 HEAD is now at a2febd2 Merge branch 'maint'
 OVERVIEW
 Setting `org-agenda-files' temporarily since emacs -q would overwrite 
 customizations
 File added to front of agenda file list
 CPU and memory profiler started
 
 12.207549810409546


 + normal-top-level 46,533,611  74%
 + command-line-16,385,759  10%
 + command-line  5,800,077   9%
 + eval  2,639,778   4%
 + progn   690,611   1%
 + let  70,947   0%
 + apply20,536   0%
 + org-agenda-get-sexps 12,332   0%
 + load-with-code-conversion 8,188   0%
 + profiler-calltree-walk8,188   0%
 + org-agenda-prepare6,482   0%
 + byte-code 4,272   0%
 + diary-font-lock-keywords  4,144   0%
 + org-agenda-list   1,114   0%
 + file-truename 1,100   0%
 + load  1,040   0%
 # On branch master
 # Changes not staged for commit:
 #   (use git add file... to update what will be committed)
 #   (use git checkout -- file... to discard changes in working 
 directory)
 #
 #modified:   lisp/org.el
 #
 no changes added to commit (use git add and/or git commit -a)
 Dropped refs/stash@{0} (a8007c5e99e8481d82ec8303c75069e150a81874)
 OVERVIEW
 Setting `org-agenda-files' temporarily since emacs -q would overwrite 
 customizations
 File added to front of agenda file list
 CPU and memory profiler started
 
 12.091503858566284


 + normal-top-level 45,399,311  73%
 + command-line-16,522,990  10%
 + command-line  5,875,736   9%
 + eval  3,803,175   6%
 + progn   316,014   0%
 + let  84,388   0%
 + apply16,376   0%
 + org-agenda-get-sexps  8,188   0%
 + load-with-code-conversion 8,188   0%
 + profiler-calltree-walk8,188   0%
 + profiler-report-setup-buffer  8,188   0%
 + org-agenda-list   4,296   0%
 + diary-font-lock-keywords  4,144   0%
 + org-agenda-get-day-entries4,144   0%
 + require   3,120   0%
 + org-agenda-prepare2,338   0%
 + file-truename 2,156   0%
 + tramp-completion-file-name-handler1,040   0%
 + byte-code   104   0%

This is the equally uninteresting cpu result.

a2febd210182d9e1a37b0d7fd9ee007a10abc4bc refs/remotes/origin/HEAD
Saved working directory and index state WIP on master: a2febd2 Merge branch 
'maint'
HEAD is now at a2febd2 Merge branch 'maint'
OVERVIEW
Setting `org-agenda-files' temporarily since emacs -q would overwrite 
customizations
File added to front of agenda file list
CPU profiler started

12.362266302108765

+ normal-top-level   8765  78%
+ command-line   1769  15%
  Automatic GC377   3%
+ eval144   1%
+ command-line-1   68   0%
+ progn 8   0%
+ let   4   0

Re: [O] org-archive-add-header-to-new-files

2013-01-30 Thread Christopher Schmidt
Bastien b...@altern.org writes:
 Thanks for the ChangeLog, would be even greater to have it directly
 within the patch as produced by git format-patch!

 In master, I added `org-archive-file-header-format' which see.

 Thanks for this idea,

Thank you very much.

Christopher



Re: [O] orgstruct-mode with custom headline prefix

2013-01-30 Thread Christopher Schmidt
Christopher Schmidt christop...@ch.ristopher.com writes:
 here is a patch for master that enables the use of a custom headline
 prefix file locally in conjunction with orgstruct-mode.

Here is the patch, now applying cleanly on master again.
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4437,9 +4437,9 @@ in `org-agenda-text-search-extra-files'.
 	  regexps+))
   (setq regexps+ (sort regexps+ (lambda (a b) ( (length a) (length b)
   (if (not regexps+)
-	  (setq regexp org-outline-regexp-bol)
+	  (setq regexp (org-outline-regexp-bol))
 	(setq regexp (pop regexps+))
-	(if hdl-only (setq regexp (concat org-outline-regexp-bol .*?
+	(if hdl-only (setq regexp (concat (org-outline-regexp-bol) .*?
 	  regexp
   (setq files (org-agenda-files nil 'ifmode))
   (when (eq (car org-agenda-text-search-extra-files) 'agenda-archives)
@@ -5018,10 +5018,10 @@ of what a project is and how to check if it stuck, customize the variable
 			  \\)\\))
 	 (tags (nth 2 org-stuck-projects))
 	 (tags-re (if (member * tags)
-		  (concat org-outline-regexp-bol
+		  (concat (org-outline-regexp-bol)
 			  (org-re .*:[[:alnum:]_@#%]+:[ \t]*$))
 		(if tags
-			(concat org-outline-regexp-bol
+			(concat (org-outline-regexp-bol)
 .*:\\(
 (mapconcat 'identity tags \\|)
 (org-re \\):[[:alnum:]_@#%:]*[ \t]*$)
@@ -5547,7 +5547,7 @@ Do we have a reason to ignore this TODO entry because it has a time stamp?
 	  category (org-get-category b0)
 	  category-pos (get-text-property b0 'org-category-position))
 	(save-excursion
-	  (if (not (re-search-backward org-outline-regexp-bol nil t))
+	  (if (not (re-search-backward (org-outline-regexp-bol) nil t))
 	  (throw :skip nil)
 	(goto-char (match-beginning 0))
 	(if (and (eq t org-agenda-skip-timestamp-if-deadline-is-shown)
@@ -5785,7 +5785,7 @@ please use `org-class' instead.
 		 (clockp
 		  (and (looking-at .*\n[ \t]*-[ \t]+\\([^-\n \t].*?\\)[ \t]*$)
 		   (match-string 1)
-	  (if (not (re-search-backward org-outline-regexp-bol nil t))
+	  (if (not (re-search-backward (org-outline-regexp-bol) nil t))
 	  (throw :skip nil)
 	(goto-char (match-beginning 0))
 	(setq hdmarker (org-agenda-new-marker)
@@ -6249,7 +6249,7 @@ FRACTION is what fraction of the head-warning time has passed.
 		(setq marker (org-agenda-new-marker (point)))
 		(setq category (org-get-category)
 		  category-pos (get-text-property (point) 'org-category-position))
-		(if (not (re-search-backward org-outline-regexp-bol nil t))
+		(if (not (re-search-backward (org-outline-regexp-bol) nil t))
 		(throw :skip nil)
 		  (goto-char (match-beginning 0))
 		  (setq hdmarker (org-agenda-new-marker (point))
--- a/lisp/org-ascii.el
+++ b/lisp/org-ascii.el
@@ -422,7 +422,7 @@ publishing directory.
 
 (org-init-section-numbers)
 (while (setq line (pop lines))
-  (when (and link-buffer (string-match org-outline-regexp-bol line))
+  (when (and link-buffer (string-match (org-outline-regexp-bol) line))
 	(org-export-ascii-push-links (nreverse link-buffer))
 	(setq link-buffer nil))
   (setq wrap nil)
--- a/lisp/org-colview-xemacs.el
+++ b/lisp/org-colview-xemacs.el
@@ -858,7 +858,7 @@ around it.
 	  (save-restriction
 	(narrow-to-region beg end)
 	(org-clock-sum
-  (while (re-search-forward org-outline-regexp-bol end t)
+  (while (re-search-forward (org-outline-regexp-bol) end t)
 	(if (and org-columns-skip-archived-trees
 		 (looking-at (concat .*: org-archive-tag :)))
 	(org-end-of-subtree t)
@@ -1093,7 +1093,7 @@ Don't set this, this is meant for dynamic scoping.)
 (defun org-columns-compute (property)
   Sum the values of property PROPERTY hierarchically, for the entire buffer.
   (interactive)
-  (let* ((re org-outline-regexp-bol)
+  (let* ((re (org-outline-regexp-bol))
 	 (lmax 30) ; Does anyone use deeper levels???
 	 (lvals (make-vector lmax nil))
 	 (lflag (make-vector lmax nil))
--- a/lisp/org-colview.el
+++ b/lisp/org-colview.el
@@ -717,7 +717,7 @@ When COLUMNS-FMT-STRING is non-nil, use it as the column format.
 	  (save-restriction
 	(narrow-to-region beg end)
 	(org-clock-sum-today
-  (while (re-search-forward org-outline-regexp-bol end t)
+  (while (re-search-forward (org-outline-regexp-bol) end t)
 	(if (and org-columns-skip-archived-trees
 		 (looking-at (concat .*: org-archive-tag :)))
 	(org-end-of-subtree t)
@@ -952,7 +952,7 @@ Don't set this, this is meant for dynamic scoping.)
 (defun org-columns-compute (property)
   Sum the values of property PROPERTY hierarchically, for the entire buffer.
   (interactive)
-  (let* ((re org-outline-regexp-bol)
+  (let* ((re (org-outline-regexp-bol))
 	 (lmax 30) ; Does anyone use deeper levels???
 	 (lvals (make-vector lmax nil))
 	 (lflag (make-vector lmax nil))
--- a/lisp/org-docbook.el
+++ b/lisp/org-docbook.el
@@ -652,7 +652,7 @@ publishing directory.
 	(catch 'nextline
 
 	  ;; End of quote section

[O] org-archive-add-header-to-new-files

2013-01-28 Thread Christopher Schmidt
Hi Org,

here is a patch to master that allows one to inhibit the addition of the
header line to newly created archive files.

2013-01-28  Christopher Schmidt  christop...@ch.ristopher.com

* org-archive.el (org-archive-add-header-to-new-files): New
option.
(org-archive-subtree): Honour
org-archive-add-header-to-new-files.

--- a/lisp/org-archive.el
+++ b/lisp/org-archive.el
@@ -71,6 +71,12 @@ This variable is obsolete and has no effect anymore, instead add or remove
   :group 'org-archive
   :type 'boolean)
 
+(defcustom org-archive-add-header-to-new-files t
+  Non-nil means to add a header line (\Archived entries from
+file FILE-NAME\) to newly created archive files.
+  :group 'org-archive
+  :type 'boolean)
+
 (defcustom org-archive-subtree-add-inherited-tags 'infile
   Non-nil means append inherited tags when archiving a subtree.
   :group 'org-archive
@@ -278,7 +284,8 @@ this heading.
 	  (let ((org-insert-mode-line-in-empty-file t)
 		(org-inhibit-startup t))
 		(call-interactively 'org-mode)))
-	  (when newfile-p
+	  (when (and newfile-p
+		 org-archive-add-header-to-new-files)
 	(goto-char (point-max))
 	(insert (format \nArchived entries from file %s\n\n
 			(buffer-file-name this-buffer

Christopher


[O] orgstruct-mode with custom headline prefix

2013-01-28 Thread Christopher Schmidt
Hi Org,

here is a patch for master that enables the use of a custom headline
prefix file locally in conjunction with orgstruct-mode.

2013-01-28  Christopher Schmidt  christop...@ch.ristopher.com

* org.el (org-outline-regexp, org-heading-regexp): Make them safe
local variables.
(org-outline-regexp-bol): Remove variable, new function.  All
users of org-outline-regexp-bol changed.
(org-cycle-global-status, org-cycle-subtree-status): Set state
property.
(org-heading-components): Use org-heading-regexp in
orgstruct-mode.
(orgstruct-mode): Simplify docstring.
(orgstruct-setup): Simplify implementation.  Translate keys to
their most general equivalent.
(orgstruct-make-binding): Generate index on the fly, discard
alternative keys.
(org-get-local-variables): Honour state property.
(org-run-like-in-org-mode): Do not override variables with
non-default values.
(org-forward-heading-same-level): Use org-outline-regexp-bol.  Do
not skip to parent heading.
(org-backward-heading-same-level): Use
org-forward-heading-same-level.

--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4437,9 +4437,9 @@ in `org-agenda-text-search-extra-files'.
 	  regexps+))
   (setq regexps+ (sort regexps+ (lambda (a b) ( (length a) (length b)
   (if (not regexps+)
-	  (setq regexp org-outline-regexp-bol)
+	  (setq regexp (org-outline-regexp-bol))
 	(setq regexp (pop regexps+))
-	(if hdl-only (setq regexp (concat org-outline-regexp-bol .*?
+	(if hdl-only (setq regexp (concat (org-outline-regexp-bol) .*?
 	  regexp
   (setq files (org-agenda-files nil 'ifmode))
   (when (eq (car org-agenda-text-search-extra-files) 'agenda-archives)
@@ -5018,10 +5018,10 @@ of what a project is and how to check if it stuck, customize the variable
 			  \\)\\))
 	 (tags (nth 2 org-stuck-projects))
 	 (tags-re (if (member * tags)
-		  (concat org-outline-regexp-bol
+		  (concat (org-outline-regexp-bol)
 			  (org-re .*:[[:alnum:]_@#%]+:[ \t]*$))
 		(if tags
-			(concat org-outline-regexp-bol
+			(concat (org-outline-regexp-bol)
 .*:\\(
 (mapconcat 'identity tags \\|)
 (org-re \\):[[:alnum:]_@#%:]*[ \t]*$)
@@ -5547,7 +5547,7 @@ Do we have a reason to ignore this TODO entry because it has a time stamp?
 	  category (org-get-category b0)
 	  category-pos (get-text-property b0 'org-category-position))
 	(save-excursion
-	  (if (not (re-search-backward org-outline-regexp-bol nil t))
+	  (if (not (re-search-backward (org-outline-regexp-bol) nil t))
 	  (throw :skip nil)
 	(goto-char (match-beginning 0))
 	(if (and (eq t org-agenda-skip-timestamp-if-deadline-is-shown)
@@ -5785,7 +5785,7 @@ please use `org-class' instead.
 		 (clockp
 		  (and (looking-at .*\n[ \t]*-[ \t]+\\([^-\n \t].*?\\)[ \t]*$)
 		   (match-string 1)
-	  (if (not (re-search-backward org-outline-regexp-bol nil t))
+	  (if (not (re-search-backward (org-outline-regexp-bol) nil t))
 	  (throw :skip nil)
 	(goto-char (match-beginning 0))
 	(setq hdmarker (org-agenda-new-marker)
@@ -6249,7 +6249,7 @@ FRACTION is what fraction of the head-warning time has passed.
 		(setq marker (org-agenda-new-marker (point)))
 		(setq category (org-get-category)
 		  category-pos (get-text-property (point) 'org-category-position))
-		(if (not (re-search-backward org-outline-regexp-bol nil t))
+		(if (not (re-search-backward (org-outline-regexp-bol) nil t))
 		(throw :skip nil)
 		  (goto-char (match-beginning 0))
 		  (setq hdmarker (org-agenda-new-marker (point))
--- a/lisp/org-ascii.el
+++ b/lisp/org-ascii.el
@@ -422,7 +422,7 @@ publishing directory.
 
 (org-init-section-numbers)
 (while (setq line (pop lines))
-  (when (and link-buffer (string-match org-outline-regexp-bol line))
+  (when (and link-buffer (string-match (org-outline-regexp-bol) line))
 	(org-export-ascii-push-links (nreverse link-buffer))
 	(setq link-buffer nil))
   (setq wrap nil)
--- a/lisp/org-colview-xemacs.el
+++ b/lisp/org-colview-xemacs.el
@@ -858,7 +858,7 @@ around it.
 	  (save-restriction
 	(narrow-to-region beg end)
 	(org-clock-sum
-  (while (re-search-forward org-outline-regexp-bol end t)
+  (while (re-search-forward (org-outline-regexp-bol) end t)
 	(if (and org-columns-skip-archived-trees
 		 (looking-at (concat .*: org-archive-tag :)))
 	(org-end-of-subtree t)
@@ -1093,7 +1093,7 @@ Don't set this, this is meant for dynamic scoping.)
 (defun org-columns-compute (property)
   Sum the values of property PROPERTY hierarchically, for the entire buffer.
   (interactive)
-  (let* ((re org-outline-regexp-bol)
+  (let* ((re (org-outline-regexp-bol))
 	 (lmax 30) ; Does anyone use deeper levels???
 	 (lvals (make-vector lmax nil))
 	 (lflag (make

Re: [O] TeX-master: TeX-master is let-bound

2013-01-26 Thread Christopher Schmidt
Christopher Schmidt christop...@ch.ristopher.com writes:
 Bastien b...@altern.org writes:
 Can you provide a reproducible recipe?

 I already did, check 87390w5...@ch.ristopher.com.  The issue I
 described will only occur if one uses AUCTeX and AUCTeX has not been
 loaded already.  Nick did not follow the recipe so he was not able to
 reproduce.

Christopher Schmidt christop...@ch.ristopher.com writes:
 Recipe:

 emacs -q # + AUCTeX
 C-x b rms RET
 M-x org-mode RET
 M-: (insert a) RET
 C-x h
 M-x org-export-region-as-latex RET

 # In buffer *Org LaTeX Export*
 C-c C-c

 TeX-command-master: Symbol's value as variable is void: TeX-master

For the record, the first step of my recipe, emacs -q # + AUCTeX, goes
like this:

$ cd /tmp
$ export HOME=/tmp
$ emacs -q --eval (progn (package-refresh-contents) (package-install 
'auctex) (kill-emacs))
$ emacs -q --eval (package-initialize)

Is there anything I can do to help you to help me - i.e. fixing that bug
upstream?

Christopher



Re: [O] TeX-master: TeX-master is let-bound

2013-01-26 Thread Christopher Schmidt
Bastien b...@altern.org writes:
 Christopher Schmidt christop...@ch.ristopher.com writes:

 $ emacs -q --eval (progn (package-refresh-contents) (package-install 
 'auctex) (kill-emacs))

 I can't install auctex through package-install.

Why is that?  What's failing?

( export HOME=/tmp makes Emacs use /tmp/.emacs.d as it's
  user-directory, forcing package.el to not touch your real
  configuration in ~/.emacs.d.)

 Can you give more directions?

There is nothing special about my AUCTeX installation.  Vanilla AUCTeX
should produce the same results.  The only things one needs to take care
of before executing my recipe is that AUCTeX is autoloaded but not
loaded.

Christopher



Re: [O] TeX-master: TeX-master is let-bound

2013-01-26 Thread Christopher Schmidt
Bastien b...@altern.org writes:
 Generating autoloads for tex-jp.el...
 forward-sexp: Scan error: Unbalanced parentheses, 8785, 28213

 When compiling.

I have no idea.  emacs-24 (GNU Emacs 24.2.90.1) works fine.

 I'm off for the week-end, I'll dig this further later on next week.

Thank you very much.

Here is a minimal recipe that produces the effects of the bug.

(progn
  (let ((TeX-master t))
;; require external TeX library
(defvar TeX-master nil)
(defun TeX-func ()
  TeX-master)
;; do stuff with TeX library
;; ...
)
  ;; now do  other stuff with TeX library
  (TeX-func))

Christopher



Re: [O] TeX-master: TeX-master is let-bound

2013-01-25 Thread Christopher Schmidt
Bastien b...@altern.org writes:

Hi Bastien,

thanks for your reply.

 Christopher Schmidt christop...@ch.ristopher.com writes:
 Christopher Schmidt christop...@ch.ristopher.com writes:
 The default value it t anyway.  The docstring suggests that this
 variable should be set via file variables.  I do not think org-mode
 should worry about AUCTeX.

 Ping?

 The default value of TeX-master is t.  Binding a symbol which might
 be defvar'ed within the let-body does not work.  In fact, this might
 break the Emacs instance, rendering any latex-mode buffer unusable.

 Can you provide a reproducible recipe?

I already did, check 87390w5...@ch.ristopher.com.  The issue I
described will only occur if one uses AUCTeX and AUCTeX has not been
loaded already.  Nick did not follow the recipe so he was not able to
reproduce.

 To make a long story short, there is no excuse for the form in
 question.  Please remove it.  Everyone who messes with TeX-master
 should use org-export-latex-final-hook to set TeX-master and/or add a
 local variables list to the buffer.

 I skimmed the previous discussions, and my understanding is that the
 patch will break things for some users, even those who don't mess with
 TeX-master.

It does not break anything for those who do not customise TeX-master.

Those poor souls who do customise TeX-master can easily get back to The
Right Thing using org-export-latex-final-hook.

TeX-master is not meant to be customised by default anyway!

TeX-master is a variable defined in `tex.el'.
Its value is t

  Automatically becomes buffer-local when set.
  This variable is safe as a file local variable if its value
  satisfies the predicate `(lambda (x) (or (stringp x) (member x (quote (t 
nil shared dwim)'.

Documentation:
*The master file associated with the current buffer.
If the file being edited is actually included from another file, you
can tell AUCTeX the name of the master file by setting this variable.
If there are multiple levels of nesting, specify the top level file.
[...]
It is suggested that you use the File Variables (see the info node in
^^^
the Emacs manual) to set this variable permanently for each file.
  ^^^
 Is it so?  If yes, can we make a better patch?

I do not think so.

I do not see what's breaking here.  The users gets what he wanna get.

We could come up with some magic that preloads latex-mode (I proposed
that in 87r4ods...@ch.ristopher.com) and sets TeX-master buffer
locally iff latex-mode actually defines this var.  Yet, this is not how
things should be.  Org cannot, and should not, mess with other
packages.  Customising TeX-master is the bug, and it is on the users
side.

Bastien, thank you so much for looking into this issue.  It has been
bothering for quite some time.

Greetings,

Christopher



Re: [O] TeX-master: TeX-master is let-bound

2013-01-24 Thread Christopher Schmidt
Christopher Schmidt christop...@ch.ristopher.com writes:
 The default value it t anyway.  The docstring suggests that this
 variable should be set via file variables.  I do not think org-mode
 should worry about AUCTeX.

Ping?

The default value of TeX-master is t.  Binding a symbol which might be
defvar'ed within the let-body does not work.  In fact, this might break
the Emacs instance, rendering any latex-mode buffer unusable.

To make a long story short, there is no excuse for the form in question.
Please remove it.  Everyone who messes with TeX-master should use
org-export-latex-final-hook to set TeX-master and/or add a local
variables list to the buffer.

2013-01-24  Christopher Schmidt  christop...@ch.ristopher.com

* org-latex.el (org-export-as-latex): Do not bind TeX-master.

--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -964,7 +964,6 @@ When PUB-DIR is set, use this as the publishing directory.
   (concat filename .tex)
 filename)))
 (auto-insert nil); Avoid any auto-insert stuff for the new file
-(TeX-master (boundp 'TeX-master))
 (buffer (if to-buffer
 (if (eq to-buffer 'string)
 (get-buffer-create *Org LaTeX Export*)
@@ -1105,9 +1104,11 @@ When PUB-DIR is set, use this as the publishing directory.
 (or (eq (char-before) ?\n)
(insert ?\n))

+(when (and to-buffer
+   (not (derived-mode-p 'latex-mode)))
+  (latex-mode))
 (run-hooks 'org-export-latex-final-hook)
-(if to-buffer
-	(unless (eq major-mode 'latex-mode) (latex-mode))
+(unless to-buffer
   (save-buffer))
 (org-export-latex-fix-inputenc)
 (run-hooks 'org-export-latex-after-save-hook)

Thank you,

Christopher


Re: [O] Bug: non-interactive org-export-region-as... modifies kill-ring [7.9.2 (release_7.9.2-103-g488eea)]

2012-12-13 Thread Christopher Schmidt
Bastien b...@altern.org writes:
 Christopher Schmidt christop...@ch.ristopher.com writes:

 Title says it all.  For example evaling (org-export-region-as-latex
 (point-min) (point-max) nil (get-buffer-create res)) via M-: in an
 org-mode buffer will put the export content in the kill ring.  That's
 not nice.  I think only the interactive call should do that.

 There is org-export-copy-to-kill-ring.

 I added a new choice 'if-interactive which is now the default:
 exported text will only be pushed to the kill ring when export
 is done interactively.  You can always set it to nil if you
 want.

Thank you very much.

Christopher



[O] Bug: non-interactive org-export-region-as... modifies kill-ring [7.9.2 (release_7.9.2-103-g488eea)]

2012-12-12 Thread Christopher Schmidt
Title says it all.  For example evaling (org-export-region-as-latex
(point-min) (point-max) nil (get-buffer-create res)) via M-: in an
org-mode buffer will put the export content in the kill ring.  That's
not nice.  I think only the interactive call should do that.

Christopher



[O] Bug: ORG_ADD_CONTRIB does not work the first time [7.9.2]

2012-11-07 Thread Christopher Schmidt
I am using the maint as of today (c20730b).

make ORG_ADD_CONTRIB=org-contacts prefix=/tmp/org install

Running this once in a clean org-mode working tree results in org not
copying org-contacts.el(c) to /tmp/org/emacs/site-lisp/org.  Running the
command a second time does that, though.

This is a bug?!

Christopher



Re: [O] Bug: Messaging when moving in the agenda [7.9.2 (7.9.2-GNU-Emacs-24-3 @ /usr/share/emacs/24.2.50/lisp/org/)]

2012-11-07 Thread Christopher Schmidt
Michael Heerdegen michael_heerde...@web.de writes:
 So, IMHO `org-display-outline-path' should still display its stuff in
 the echo area, but prevent logging in *Messages*.  AFAIK, the way to
 do this is to bind `message-log-max' to nil.

 I'm not sure if this is the right thing in every case, but if the goal
 is to just display something for better orientation etc., there is no
 need for logging.

+1, I totally agree.  These message do not need to be logged into the
*Messages*-buffer because this provides no benefit whatsoever.

Christopher



Re: [O] Bug: ORG_ADD_CONTRIB does not work the first time [7.9.2]

2012-11-07 Thread Christopher Schmidt
Achim Gratz strom...@nexgo.de writes:
 Christopher Schmidt writes:
 I am using the maint as of today (c20730b).

 make ORG_ADD_CONTRIB=org-contacts prefix=/tmp/org install

 Running this once in a clean org-mode working tree results in org not
 copying org-contacts.el(c) to /tmp/org/emacs/site-lisp/org.  Running the
 command a second time does that, though.

 This is a bug?!

 Not any more (as of ca5d5e9).

Thank you very much!

Christopher



Re: [O] Bug: Messaging when moving in the agenda [7.9.2 (7.9.2-GNU-Emacs-24-3 @ /usr/share/emacs/24.2.50/lisp/org/)]

2012-11-07 Thread Christopher Schmidt
Christopher Schmidt christop...@ch.ristopher.com writes:
 +1, I totally agree.  These message do not need to be logged into the
  ^^^
 *Messages*-buffer because this provides no benefit whatsoever.

s/message/messages

Christopher



Re: [O] TeX-master: TeX-master is let-bound

2012-11-01 Thread Christopher Schmidt
Nick Dokos nicholas.do...@hp.com writes:

Hi Nick,

were you able to reproduce my problem?

 Christopher Schmidt christop...@ch.ristopher.com wrote:

 Nick Dokos nicholas.do...@hp.com writes:
  In any case, if you can get rid of the let-bind (or the need to
  muck with TeX-master at all within org), without introducing a
  regression, we are all ears.

 I think adding (require 'tex nil t) before the let form is a nice fix.


 Not really: you end up pulling in auctex even if you are not going to
 use it.

What do you think about

(when to-buffer
  (let ((sym 'latex-mode))
(while (symbolp sym)
  (setq sym (symbol-function sym)))
(when (eq (car-safe sym) 'autoload)
  (load (cadr sym) sym t t

?

Christopher



Re: [O] TeX-master: TeX-master is let-bound

2012-10-30 Thread Christopher Schmidt
Nick Dokos nicholas.do...@hp.com writes:

Hi Nick,

 Christopher Schmidt christop...@ch.ristopher.com wrote:

 Nick Dokos nicholas.do...@hp.com writes:
  What missing variable definition? By the time the export is
  finished, the let-bind is gone. There is no definition of
  TeX-master anywhere, just as if you never had org loaded: why
  should auctex object to that?
 
  So I don't understand why it would break: all the common scenarios
  that I have tried work with no problem for me. I can load an org
  file, export to latex, open the latex file (which loads auctex) and
  do auctex things to it. I don't get any error. What exactly do I
  have to do in order to break it?

 In org-latex.el, within the binding:

 (if to-buffer
 (unless (eq major-mode 'latex-mode) (latex-mode))
   (save-buffer))


 You mean that's where you get the error?

No, this is where AUCTeX is loaded.

 Recipe:

 emacs -q # + AUCTeX
 C-x b rms RET
 M-x org-mode RET
 M-: (insert a) RET
 C-x h

Are you sure that (featurep 'tex) is nil at this point?

 M-x org-export-region-as-latex RET

... if it is nil, (latex-mode) should load AUCTeX, which ultimately
breaks AUCTeX due to the ignored defvar.

 # In buffer *Org LaTeX Export*
 C-c C-c

... this is where I actually get this error:

 TeX-command-master: Symbol's value as variable is void: TeX-master

 I get latex errors saying it cannot find none.tex but no emacs
 errors:
[...]
 Org-mode version 7.9.2 (release_7.9.2-533-g07c889 @ 
 /home/nick/elisp/org-mode/lisp/)
 GNU Emacs 24.2.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.4) of 
 2012-09-21 on alphaville

Org-mode version 7.9.2 (release_7.9.2-497-g8866f8)
GNU Emacs 24.2.50.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.10) of 
2012-10-29

Thank you for your help.

Regards,

Christopher



Re: [O] TeX-master: TeX-master is let-bound

2012-10-30 Thread Christopher Schmidt
Nick Dokos nicholas.do...@hp.com writes:
 Not in my case: (latex-mode) loads the standard tex mode. How do you
 get auctex loaded? I thought it was a separate package that needs
 special initialization: (load auctex.el nil t t) is what the
 documentation says. And I have 11.86 which I believe is latest
 available, but I might be behind the times: I haven't worried about it
 in a few years.

I use the AUCTeX distribution provided by the GNU ELPA.  By default ELPA
packages are enabled after reading the init file and before
running after-init-hook.

FWIW if you start emacs with -q, you have to initialise ELPA packages
manually via M-x package-initialize RET.

Christopher



Re: [O] TeX-master: TeX-master is let-bound

2012-10-29 Thread Christopher Schmidt
Nick Dokos nicholas.do...@hp.com writes:
 In any case, if you can get rid of the let-bind (or the need to muck
 with TeX-master at all within org), without introducing a regression,
 we are all ears.

I think adding (require 'tex nil t) before the let form is a nice fix.

IMO the situation ATM is pretty bad.  If AUCTeX is not loaded pre export
the missing variable definition breaks AUCTeX completely.

Christopher



Re: [O] TeX-master: TeX-master is let-bound

2012-10-29 Thread Christopher Schmidt
Nick Dokos nicholas.do...@hp.com writes:
 What missing variable definition? By the time the export is finished,
 the let-bind is gone. There is no definition of TeX-master anywhere,
 just as if you never had org loaded: why should auctex object to that?

 So I don't understand why it would break: all the common scenarios
 that I have tried work with no problem for me. I can load an org file,
 export to latex, open the latex file (which loads auctex) and do
 auctex things to it. I don't get any error. What exactly do I have to
 do in order to break it?

In org-latex.el, within the binding:

(if to-buffer
(unless (eq major-mode 'latex-mode) (latex-mode))
  (save-buffer))

Recipe:

emacs -q # + AUCTeX
C-x b rms RET
M-x org-mode RET
M-: (insert a) RET
C-x h
M-x org-export-region-as-latex RET

# In buffer *Org LaTeX Export*
C-c C-c

TeX-command-master: Symbol's value as variable is void: TeX-master

Christopher



Re: [O] org-contacts.el does not require org-agenda

2012-10-26 Thread Christopher Schmidt
Bastien b...@altern.org writes:
 Christopher Schmidt christop...@ch.ristopher.com writes:

 org-contacts uses agenda functions but does not require org-agenda.

 No, org-contacts does not use any org-agenda.el function.

I see, some functions prefixed with org-agenda- are defined in org.el.

 It uses some org-agenda.el variables, though.

 What is the problem you did encounter?

emacs -q
M-: (add-to-list 'load-path ~/.emacs.d/apps/org-mode/lisp) RET
M-: (add-to-list 'load-path ~/.emacs.d/apps/org-mode/contrib/lisp) RET
M-x load-library RET org-contacts RET
M-x org-contacts RET Richard Stallman RET

or: Symbol's value as variable is void: org-agenda-archives-mode

Christopher



Re: [O] TeX-master: TeX-master is let-bound

2012-10-26 Thread Christopher Schmidt
Suvayu Ali fatkasuvayu+li...@gmail.com writes:
 I believe the reason was to get rid of auctex prompting for the master
 file name every time an org file is exported to LaTeX.

The default value it t anyway.  The docstring suggests that this
variable should be set via file variables.  I do not think org-mode
should worry about AUCTeX.

Christopher



Re: [O] org-contacts.el does not require org-agenda

2012-10-26 Thread Christopher Schmidt
Bastien b...@altern.org writes:

 Thanks.  I've added (require 'org-agenda) to org-contacts.el.

Thank you very much.

Christopher



Re: [O] TeX-master: TeX-master is let-bound

2012-10-26 Thread Christopher Schmidt
Christopher Witte ch...@witte.net.au writes:
 It probably has something to do with this thread:
 http://lists.gnu.org/archive/html/emacs-orgmode/2012-02/msg00473.html

I do not think so, latex export has nothing to do with reftex.  This is
the commit in questions

http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=3007ddd1

and I am not exactly sure what's correct about the new form.  The old
one looks way better to me.

Christopher



[O] TeX-master: TeX-master is let-bound

2012-10-25 Thread Christopher Schmidt
org-export-as-latex (org-latex.el) let-binds TeX-master.  Later on
feature tex may be loaded.  This is a problem, because in that case the
defvar TeX-master of tex (AUCTeX) is ignored.

Warning: defvar ignored because TeX-master is let-bound

This issue could be fixed by adding (require 'tex nil t).

Christopher



[O] org-contacts.el does not require org-agenda

2012-10-25 Thread Christopher Schmidt
org-contacts uses agenda functions but does not require org-agenda.
This is a bug.

Christopher



Re: [O] TeX-master: TeX-master is let-bound

2012-10-25 Thread Christopher Schmidt
Suvayu Ali fatkasuvayu+li...@gmail.com writes:
 On Thu, Oct 25, 2012 at 05:48:57PM +0100, Christopher Schmidt wrote:
 org-export-as-latex (org-latex.el) let-binds TeX-master.  Later on
 feature tex may be loaded.  This is a problem, because in that case
 the defvar TeX-master of tex (AUCTeX) is ignored.

 Warning: defvar ignored because TeX-master is let-bound

 This issue could be fixed by adding (require 'tex nil t).


 What is your org-version?  AFAIR, this was the case at the beginning
 of this year (Feb-March '12) but I do not think this is an issue
 anymore.

No, it is in both maint and master (org-latex.el:958) right now.  To be
honest, why is TeX-master exactly bound in the first place?

(TeX-master (boundp 'TeX-master))

For the record, I use Org-mode version 7.9.2 (release_7.9.2-62-gde7766),
that is maint from the 15th. of October.



[O] org-export-region-as-latex skips header

2012-10-19 Thread Christopher Schmidt
Org-mode version 7.9.2 (release_7.9.2-52-g921998)

C-x b test RET
insert * dub
M-: (org-export-region-as-latex (point-min) (point-max) nil 'string) RET

org-export-region-as-latex returns

\\section{dub}\n\\label{sec-1}\n\n\\end{document}\n

This does not look right to me.  Where is the header?

Christopher



Re: [O] Bug report: org-habit is not required by default

2012-09-04 Thread Christopher Schmidt
Russell Branca chewbra...@gmail.com writes:
 While playing with org agenda mode and habits, I ran into the error:

 symbol's function definition is void org-is-habit-p

 The underlying problem was that org-habit did not get loaded. After
 manually requiring org-habit everything works as expected.

 If this is expected behavior, then I'm fine manually requiring
 org-habit, but it was mentioned on #emacs that this was probably a
 bug, so I'm sending it in.

This non-issue is documented.  Check (info (org)Tracking your habits).

Christopher



Re: [O] plain text best practice?

2012-06-05 Thread Christopher Schmidt
scraw...@gmail.com writes:

 * Chapter One
   - lots of text
 * Chapter Two
   - lots more text

These are lists (info (org)Plain lists).  I do not think you want
that.

 * Chapter One
 ** paragraph 1
lots of text
 ** paragraph 2
lots of text
 * Chapter Two

This is exactly what org-indent-mode is for.  Check
(info (org)Clean view).

Christopher



Re: [O] org-install not defining org-mode-map?

2012-05-15 Thread Christopher Schmidt
Eric Abrahamsen e...@ericabrahamsen.net writes:

 I must have done something odd here, but…

Yes.

 On emacs startup, org-mode-map is not getting defined for some reason,
 so a bunch of `eval-after-load' forms are throwing errors. I'm using
 org from git, and the following is the first offending section:
 (require 'org-install)
 (eval-after-load 'org
 ; don't let org steal this key
   (define-key org-mode-map (kbd C-') nil))

You have to quote the inner form.

Christopher



Re: [O] More problems with orgstruct++-mode, message-mode and auto fill

2012-05-09 Thread Christopher Schmidt
Bernt Hansen be...@norang.ca writes:

 For now I've dropped orgstruct++-mode from my message-mode hook but
 I'm going to miss this for lists in my emails.

orgstruct-mode/orgtbl-mode work fine and do not break anything.

Christopher



Re: [O] orgstuct++ does not lurk silently in the shadow

2012-04-29 Thread Christopher Schmidt
Bastien b...@gnu.org writes:

 This should be fixed now in master.

Thank you so much for fixing this.

There is still one major issue, though.  Consider this text:

,
|  rms
|  foo
| 
|  org-mode
`

Place the point somewhere in the first or second line and do a M-q.
Vanilla message-mode correctly recognises the paragraph prefix whereas
an use of Org's enhancements breaks this.

Other than that, disabling orgstruct++-mode after enabling it breaks
everything.  I get tons of Lisp nesting exceeds `max-lisp-eval-depth',
even when doing simple things like moving around the buffer or trying to
execute and extended command.

For the record, I use Gnus and Org master (b5f4b52).  This is how my
integration is set up:

#+begin_src emacs-lisp
(add-hook 'gnus-message-setup-hook
  (lambda ()
(turn-on-orgtbl)
(turn-on-orgstruct++)
(set (make-local-variable 'org-footnote-auto-label) 'plain)
(set
 (make-local-variable 'org-footnote-tag-for-non-org-mode-files)
 nil)))

(define-key message-mode-map (kbd C-c f)
  (lambda ()
(interactive)
(save-restriction
  (my-message-narrow-to-body)
  (org-footnote-action

(add-hook 'message-send-hook
  (lambda ()
(save-restriction
  (my-message-narrow-to-body)
  (org-footnote-normalize
#+end-src

Christopher



Re: [O] orgstuct++ does not lurk silently in the shadow

2012-04-29 Thread Christopher Schmidt
Christopher Schmidt christop...@ch.ristopher.com writes:

 There is still one major issue, though.  Consider this text:

 ,
 |  rms
 |  foo
 | 
 |  org-mode
 `

 Place the point somewhere in the first or second line and do a M-q.
 Vanilla message-mode correctly recognises the paragraph prefix whereas
 an use of Org's enhancements breaks this.

It all boils down to orgstruct++-mode setting non-org-vars like
paragraph-start or paragraph-separate to the org values.  This is fine,
even the doc string says so.

,[ C-h f orgstruct++-mode RET ]
| Toggle `orgstruct-mode', the enhanced version of it.
| In addition to setting orgstruct-mode, this also exports all indentation
| and autofilling variables from org-mode into the buffer.  It will also
| recognize item context in multiline items.
`

This does not work with message-mode and any other mode that imposes a
special document structure, though.  I think the docstring and the
manual should note that explicitly, and the line promoting the use of
turn-on-orgstruct++ in message-mode-hook in (info (org)Orgstruct mode)
should be removed.

Christopher



Re: [O] org ELPA package 20120216 cannot be downloaded

2012-03-20 Thread Christopher Schmidt
Tassilo Horn tass...@member.fsf.org writes:

 on IRC someone just reported that org 20120216 as it is listed in the
 GNU ELPA archive won't download.  When trying to install, all you get
 is this error:

   package-handle-response: Error during download request: Not Found

 Probably a dead link or something alike...

I think this is a GNU ELPA problem.  The cronjob that mirrors the
content of the ELPA branch to the actual files that can be accessed via
elpa.gnu.org/packages is no run any more.  It looks like the 14th of
February was the last time it ran.

Christopher



Re: [O] org ELPA package 20120216 cannot be downloaded

2012-03-20 Thread Christopher Schmidt
Christopher Schmidt christop...@ch.ristopher.com writes:

 I think this is a GNU ELPA problem.  The cronjob that mirrors the
 content of the ELPA branch to the actual files that can be accessed
 via elpa.gnu.org/packages is no run any more.  It looks like the 14th
 of February was the last time it ran.

BTW. the script I am referring to[1] is responsible for grabbing org
daily and pushing it to GNU ELPA.

Christopher

[1] 
http://bzr.savannah.gnu.org/lh/emacs/elpa/annotate/head:/admin/package-update.sh#L80



[O] orgstuct++ does not lurk silently in the shadow

2012-03-08 Thread Christopher Schmidt
Hi gurus,

I have a problem with Org-mode version 7.8.03
(release_7.8.03.351.g47eb3) on GNU Emacs 24.0.94.1
(x86_64-unknown-linux-gnu, GTK+ Version 2.24.9) of 2012-03-08.

(info (org)Orgstruct mode) says that one is allowed to use orgtbl-mode
in message-mode.  Unfortunately this does not work as expected.

Recipe:

emacs -q
C-x m
M-q # fill-paragraph ignores the message header
eval: (add-hook 'message-mode-hook 'turn-on-orgstruct++)
C-x m
M-q # fill-paragraph does ignore the message header

The bug is caused by fill-paragraph-function not being set back to
message-fill-paragraph when orgstruct-hijacker-command-22 falls back to
fill-paragraph.

Christopher



[O] orgstruct++ does not lurk silently in the shadow (was: orgstuct++ does not lurk silently in the shadow)

2012-03-08 Thread Christopher Schmidt
Christopher Schmidt christop...@ch.ristopher.com writes:

[...]
 (info (org)Orgstruct mode) says that one is allowed to use
 orgtbl-mode in message-mode.  Unfortunately this does not work as
 expected.

Typo - I meant orgstruct-mode of course.

Christopher