emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* help with modifying a bit of code in .emacs
@ 2007-12-13 19:11 Graham Smith
  2007-12-14  1:27 ` William Henney
  2007-12-14  2:08 ` Chris Leyon
  0 siblings, 2 replies; 5+ messages in thread
From: Graham Smith @ 2007-12-13 19:11 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1433 bytes --]

I have been using the set up provided by John Wiegley on a Mac and have
tried to to use it with Emacs32 wbut with some problems as the
custom-set-variables command seemed to badly interact with the Emacs32w
custom-set-variables.

I have been trying to rewrite the code to avoid the custom-set-variables in
.emacs but have finally come unstuck with this bit:

;(setq org-agenda-custom-commands
;             '(("d" todo #("DELEGATED" nil)
;          ("c" todo #("DONE|DEFERRED|CANCELLED" nil)
;          ("w" todo #("WAITING" nil)
;              ("W" agenda "" ((org-agenda-ndays 21)))
;     ("A" agenda ""
;        ((org-agenda-skip-function
;         (lambda nil
;               (org-agenda-skip-entry-if (quote notregexp)
"\\=.*\\[#A\\]")))
;               (org-agenda-ndays 1)
;               (org-agenda-overriding-header "Today's Priority #A tasks:
")))
;("u" alltodo ""
;((org-agenda-skip-function
;  (lambda nil
;    (org-agenda-skip-entry-if (quote scheduled) (quote deadline)
;                  (quote regexp) "<[^>\n]+>")))
;(org-agenda-overriding-header "Unscheduled TODO entries: "))))))

I am getting An error has occurred while loading `c:/Home/.emacs':

"Invalid read syntax: Invalid string property list" error when launching
Emacs and narrowed it down to this bit of code. Can anyone point out where
this is wrong. The rest of it loads OK, its just this bit which is failing.

Can anyone help.

Many thanks,

Graham

[-- Attachment #1.2: Type: text/html, Size: 2398 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: help with modifying a bit of code in .emacs
  2007-12-13 19:11 help with modifying a bit of code in .emacs Graham Smith
@ 2007-12-14  1:27 ` William Henney
  2007-12-14  8:56   ` Graham Smith
  2007-12-14  2:08 ` Chris Leyon
  1 sibling, 1 reply; 5+ messages in thread
From: William Henney @ 2007-12-14  1:27 UTC (permalink / raw)
  To: Graham Smith; +Cc: emacs-orgmode

Hi Graham

On Dec 13, 2007 1:11 PM, Graham Smith <myotisone@gmail.com> wrote:
> I have been using the set up provided by John Wiegley on a Mac and have
> tried to to use it with Emacs32 wbut with some problems as the
> custom-set-variables command seemed to badly interact with the Emacs32w
> custom-set-variables.
>

I have no specific help to offer, but you should be able to narrow
down the problem further by turning on debugging of your init file.
Starting from a unix command line, this would be "emacs --debug-init
&", but I have no idea whether this would work on windows. If you
can't work out how to do this on windows, you could use a more
roundabout method as follows:

1. temporarily remove/comment the problematic code from your .emacs
and put it in a separate file, say "bad-code.el"
2. restart emacs
3. turn on debugging with
   M-x set-variable RET debug-on-error RET t RET
4. evaluate the problematic code by doing
   M-x load-file RET path/to/bad-code.el RET

In principle, either of these methods should give you a lisp backtrace
indicating exactly what the offending command is. Even if you don't
understand the backtrace, it might help someone else to diagnose your
problem.

Cheers

Will


-- 

  Dr William Henney, Centro de Radioastronomía y Astrofísica,
  Universidad Nacional Autónoma de México, Campus Morelia

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: help with modifying a bit of code in .emacs
  2007-12-13 19:11 help with modifying a bit of code in .emacs Graham Smith
  2007-12-14  1:27 ` William Henney
@ 2007-12-14  2:08 ` Chris Leyon
  2007-12-14  9:00   ` Graham Smith
  1 sibling, 1 reply; 5+ messages in thread
From: Chris Leyon @ 2007-12-14  2:08 UTC (permalink / raw)
  To: Graham Smith; +Cc: emacs-orgmode

On Dec 13, 2007 2:11 PM, Graham Smith <myotisone@gmail.com> wrote:
> I have been trying to rewrite the code to avoid the custom-set-variables in
> .emacs but have finally come unstuck with this bit:
> [...]
> "Invalid read syntax: Invalid string property list" error when launching
> Emacs and narrowed it down to this bit of code. Can anyone point out where
> this is wrong. The rest of it loads OK, its just this bit which is failing.

The #(...) is attempting to set a text property on the string
"DELEGATED".  Apparently nil is not valid in this location.  See
section 2.3.8.4 in the Elisp info document.  Since nil probably means
no property, you can just eliminate the #() syntax.

Also, your parentheses don't match up; you need extra closing parens
after some entries to make a well-formed list.  You probably want to
end up with something like this (not tested but at least it evaluates
without error):

(setq org-agenda-custom-commands
      '(("d" todo ("DELEGATED"))
        ("c" todo ("DONE|DEFERRED|CANCELLED"))
        ("w" todo ("WAITING"))
        ("W" agenda "" ((org-agenda-ndays 21)))
        ("A" agenda "" ((org-agenda-skip-function
                         (lambda nil
                           (org-agenda-skip-entry-if (quote notregexp)
"\\=.*\\[#A\\]")))
                        (org-agenda-ndays 1)
                        (org-agenda-overriding-header "Today's
Priority #A tasks: ")))
        ("u" alltodo "" ((org-agenda-skip-function
                          (lambda nil
                            (org-agenda-skip-entry-if (quote
scheduled) (quote deadline)
                                                      (quote regexp)
"<[^>\n]+>")))
                         (org-agenda-overriding-header "Unscheduled
TODO entries: ")))))

> Many thanks,
> Graham

Chris

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: help with modifying a bit of code in .emacs
  2007-12-14  1:27 ` William Henney
@ 2007-12-14  8:56   ` Graham Smith
  0 siblings, 0 replies; 5+ messages in thread
From: Graham Smith @ 2007-12-14  8:56 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 2643 bytes --]

William,

Thanks, this has now been fixed, and the code that works is:

(setq org-agenda-custom-commands
      '(
        ("d" todo #("DELEGATED") nil)
        ("c" todo #("DONE|DEFERRED|CANCELLED") nil)
        ("w" todo #("WAITING") nil)
        ("W" agenda "" ((org-agenda-ndays 21)))
        ("A" agenda "" ((org-agenda-skip-function
                           (lambda nil (org-agenda-skip-entry-if (quote
notregexp) "\\=.*\\[#A\\]")))
                        (org-agenda-ndays 1)
                        (org-agenda-overriding-header "Today's Priority #A
tasks: ")))
        ("u" alltodo "" ((org-agenda-skip-function
                          (lambda nil (org-agenda-skip-entry-if (quote
scheduled) (quote deadline)
                                                                (quote
regexp) "<[^>\n]+>")))
                         (org-agenda-overriding-header "Unscheduled TODO
entries: ")))))


I got some help sent directly to me, didn't realise it wasn't on the list
and then go t side tracked into other bits that didn't work.

But the backtrace info is useful to have.

Thanks,

Graham

On 14/12/2007, William Henney <whenney@gmail.com> wrote:
>
> Hi Graham
>
> On Dec 13, 2007 1:11 PM, Graham Smith <myotisone@gmail.com> wrote:
> > I have been using the set up provided by John Wiegley on a Mac and have
> > tried to to use it with Emacs32 wbut with some problems as the
> > custom-set-variables command seemed to badly interact with the Emacs32w
> > custom-set-variables.
> >
>
> I have no specific help to offer, but you should be able to narrow
> down the problem further by turning on debugging of your init file.
> Starting from a unix command line, this would be "emacs --debug-init
> &", but I have no idea whether this would work on windows. If you
> can't work out how to do this on windows, you could use a more
> roundabout method as follows:
>
> 1. temporarily remove/comment the problematic code from your .emacs
> and put it in a separate file, say "bad-code.el"
> 2. restart emacs
> 3. turn on debugging with
>    M-x set-variable RET debug-on-error RET t RET
> 4. evaluate the problematic code by doing
>    M-x load-file RET path/to/bad-code.el RET
>
> In principle, either of these methods should give you a lisp backtrace
> indicating exactly what the offending command is. Even if you don't
> understand the backtrace, it might help someone else to diagnose your
> problem.
>
> Cheers
>
> Will
>
>
> --
>
>   Dr William Henney, Centro de Radioastronomía y Astrofísica,
>   Universidad Nacional Autónoma de México, Campus Morelia
>

[-- Attachment #1.2: Type: text/html, Size: 4491 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: help with modifying a bit of code in .emacs
  2007-12-14  2:08 ` Chris Leyon
@ 2007-12-14  9:00   ` Graham Smith
  0 siblings, 0 replies; 5+ messages in thread
From: Graham Smith @ 2007-12-14  9:00 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 3080 bytes --]

Chris,

Thanks, this looks pretty well what I ended up with after some help off-list
(I've only realised it was off list, and thought I had already replied to
the list.

The code I ended up with is:

(setq org-agenda-custom-commands
      '(
        ("d" todo #("DELEGATED") nil)
        ("c" todo #("DONE|DEFERRED|CANCELLED") nil)
        ("w" todo #("WAITING") nil)
        ("W" agenda "" ((org-agenda-ndays 21)))
        ("A" agenda "" ((org-agenda-skip-function
                           (lambda nil (org-agenda-skip-entry-if (quote
notregexp) "\\=.*\\[#A\\]")))
                        (org-agenda-ndays 1)
                        (org-agenda-overriding-header "Today's Priority #A
tasks: ")))
        ("u" alltodo "" ((org-agenda-skip-function
                          (lambda nil (org-agenda-skip-entry-if (quote
scheduled) (quote deadline)
                                                                (quote
regexp) "<[^>\n]+>")))
                         (org-agenda-overriding-header "Unscheduled TODO
entries: ")))))

Which I think is the same as you suggest. And thanks for the explanations,
these were useful.

Graham



On 14/12/2007, Chris Leyon <cleyon@gmail.com> wrote:
>
> On Dec 13, 2007 2:11 PM, Graham Smith <myotisone@gmail.com> wrote:
> > I have been trying to rewrite the code to avoid the custom-set-variables
> in
> > .emacs but have finally come unstuck with this bit:
> > [...]
> > "Invalid read syntax: Invalid string property list" error when launching
> > Emacs and narrowed it down to this bit of code. Can anyone point out
> where
> > this is wrong. The rest of it loads OK, its just this bit which is
> failing.
>
> The #(...) is attempting to set a text property on the string
> "DELEGATED".  Apparently nil is not valid in this location.  See
> section 2.3.8.4 in the Elisp info document.  Since nil probably means
> no property, you can just eliminate the #() syntax.
>
> Also, your parentheses don't match up; you need extra closing parens
> after some entries to make a well-formed list.  You probably want to
> end up with something like this (not tested but at least it evaluates
> without error):
>
> (setq org-agenda-custom-commands
>       '(("d" todo ("DELEGATED"))
>         ("c" todo ("DONE|DEFERRED|CANCELLED"))
>         ("w" todo ("WAITING"))
>         ("W" agenda "" ((org-agenda-ndays 21)))
>         ("A" agenda "" ((org-agenda-skip-function
>                          (lambda nil
>                            (org-agenda-skip-entry-if (quote notregexp)
> "\\=.*\\[#A\\]")))
>                         (org-agenda-ndays 1)
>                         (org-agenda-overriding-header "Today's
> Priority #A tasks: ")))
>         ("u" alltodo "" ((org-agenda-skip-function
>                           (lambda nil
>                             (org-agenda-skip-entry-if (quote
> scheduled) (quote deadline)
>                                                       (quote regexp)
> "<[^>\n]+>")))
>                          (org-agenda-overriding-header "Unscheduled
> TODO entries: ")))))
>
> > Many thanks,
> > Graham
>
> Chris
>

[-- Attachment #1.2: Type: text/html, Size: 6561 bytes --]

[-- Attachment #2: Type: text/plain, Size: 204 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-12-14  9:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-13 19:11 help with modifying a bit of code in .emacs Graham Smith
2007-12-14  1:27 ` William Henney
2007-12-14  8:56   ` Graham Smith
2007-12-14  2:08 ` Chris Leyon
2007-12-14  9:00   ` Graham Smith

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).