From mboxrd@z Thu Jan 1 00:00:00 1970 From: Noorul Islam Subject: Re: This is probably a misconfiguration rather than a bug, but... Date: Sat, 4 Sep 2010 10:36:20 +0530 Message-ID: References: <87hbi7zo6u.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=44101 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OrkxM-0002MA-04 for emacs-orgmode@gnu.org; Sat, 04 Sep 2010 01:06:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OrkxJ-0006Yu-Vx for emacs-orgmode@gnu.org; Sat, 04 Sep 2010 01:06:23 -0400 Received: from mail-yx0-f169.google.com ([209.85.213.169]:56062) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OrkxJ-0006Yn-RU for emacs-orgmode@gnu.org; Sat, 04 Sep 2010 01:06:21 -0400 Received: by yxk8 with SMTP id 8so1326823yxk.0 for ; Fri, 03 Sep 2010 22:06:21 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Tim O'Callaghan Cc: org-mode On Fri, Sep 3, 2010 at 2:31 PM, Tim O'Callaghan wrote: > I'm tracking the master git repo, the emacs git repo (running emacs > 24.0.50.1) and just updated git from 11e7a57 to ba4bf2c. > > The problem is still there, I've been trying to work out exactly what > the criteria is for this problem, and i'm still not sure, but i can > replicate it without any trouble. > If i try to capture the *scratch* buffer directly after emacs startup, > it shows me the template menu. If i then change the mode of scratch to > emacs-lisp, and try to capture it generates the trace-back, which I've > attached after my org-capture configuration. > > Tim. > > ------------------ config snippet > > (define-key global-map [(meta r)] 'org-capture) > > (defun toc:remap-capture-keys () > =A0 =A0;; default as save to inbox when hit save button > =A0 =A0(define-key > =A0 =A0 =A0org-capture-mode-map [(control x) (control s)] 'ispell-buffer) > =A0 =A0(define-key > =A0 =A0 =A0org-capture-mode-map [(control x) (control w)] '(org-capture-f= inalize 1)) > =A0 =A0(define-key > =A0 =A0 =A0org-capture-mode-map [(meta k)] =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0'org-capture-kill) > =A0 =A0) > (add-hook 'org-capture-mode-hook 'toc:remap-capture-keys 'append) > > > (setq org-capture-templates > =A0 =A0 =A0`( > =A0 =A0 =A0 =A0("0" "0+inbox" entry > =A0 =A0 =A0 =A0 (file+headline (concat toc:ze-org-dir "0+inbox.org") "+IN= BOX") > =A0 =A0 =A0 =A0 "* %? \n\n") > =A0 =A0 =A0 =A0("1" "1+projects" entry > =A0 =A0 =A0 =A0 (file+olp ,(concat toc:ze-org-dir "1+work.org") "+TASKS" = "+PROJECTS") > =A0 =A0 =A0 =A0 "* TODO %?\n") > =A0 =A0 =A0 =A0("2" "2+someDay" entry > =A0 =A0 =A0 =A0 (file+regexp (concat toc:ze-org-dir "2+someday.org") "^\*= + \+") > =A0 =A0 =A0 =A0 "* SMDY %?\n") > =A0 =A0 =A0 =A0("4" "4+calendar" entry > =A0 =A0 =A0 =A0 (file+headline (concat toc:ze-org-dir "1+work.org") "+WOR= KINBOX") > =A0 =A0 =A0 =A0 "* TODO %?\n") > =A0 =A0 =A0 =A0("5" "5+toRead" entry > =A0 =A0 =A0 =A0 (file+headline (concat toc:ze-org-dir "5+toread.org") "") > =A0 =A0 =A0 =A0 "* %? \n %^{Link?}") > =A0 =A0 =A0 =A0("7" "7+toWatch" entry > =A0 =A0 =A0 =A0 (file+headline (concat toc:ze-org-dir "7+towatch.org") ""= ) > =A0 =A0 =A0 =A0 "* %^{Title}\nSOURCE:%c\n =A0%i") > =A0 =A0 =A0 =A0("8" "8+contacts" entry > =A0 =A0 =A0 =A0 (file (concat toc:ze-org-dir "8+contacts.org")) > =A0 =A0 =A0 =A0 "* %^{Title}\nSOURCE:%c\n =A0%i") > =A0 =A0 =A0 =A0("q" "8+quotes" entry > =A0 =A0 =A0 =A0 (file (concat toc:ze-org-dir "8+quotes.org")) > =A0 =A0 =A0 =A0 "* %^{Title}\nSOURCE:%c\n =A0%i") > =A0 =A0 =A0 =A0("s" "8+scrapbook" entry > =A0 =A0 =A0 =A0 (file (concat toc:ze-org-dir "8+scrapbook.org")) > =A0 =A0 =A0 =A0 "* %^{Title}\nSOURCE:%c\n =A0%i") > =A0 =A0 =A0 =A0("9" "9+journal" entry > =A0 =A0 =A0 =A0 (file+datetree (concat toc:ze-org-dir "9+journal.org")) > =A0 =A0 =A0 =A0 "* %T %?\n =A0%i\n =A0%a") > =A0 =A0 =A0 =A0("e" "1+emacsTweaking" entry > =A0 =A0 =A0 =A0 (file+headline (concat toc:ze-org-dir "1+emacsTweaking.or= g") > "+EMACSINBOX") > =A0 =A0 =A0 =A0 "* %? \n %?\n") > =A0 =A0 =A0 =A0("w" "1+work" entry > =A0 =A0 =A0 =A0 (file+headline (concat toc:ze-org-dir "1+work.org") "+WOR= KINBOX") > =A0 =A0 =A0 =A0 "* TODO %?\n") > =A0 =A0 =A0 =A0("W" "9+work-journal" entry > =A0 =A0 =A0 =A0 (file+datetree (concat toc:ze-org-dir "9+work-journal.org= ")) > =A0 =A0 =A0 =A0 "* %^{Title}\n %c\n =A0%i %?") > =A0 =A0 =A0 =A0("!" "into clocked task" entry > =A0 =A0 =A0 =A0 (clock) > =A0 =A0 =A0 =A0 "* %? \n %?\n") > =A0 =A0 =A0 =A0)) > I think above snippet works for me on emacs 24. I tried to re-create with the steps mentioned by you using scratch buffer. GNU Emacs 24.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1) of 2010-08-29 on sajida release_7.01h-228-g782f Org-mode version 7.01trans (release_7.01h.228.g782f) Thanks and Regards Noorul > ------------------ traceback > > Debugger entered--Lisp error: (wrong-type-argument stringp nil) > =A0string-match("^/tmp_mnt/" nil) > =A0abbreviate-file-name(nil) > =A0(concat "file:" (abbreviate-file-name buffer-file-name) "::" def " " n= ame) > =A0(setq link (concat "file:" (abbreviate-file-name buffer-file-name) > "::" def " " name)) > =A0(let* ((end ...) (def ...) (name ...) (sym-name ...) (stype ...) > (args ...) (docstring ...) (doc ...) (fixme ...) (comment ...) keys > keys-desc link description) (if (equal stype "Command") (setq keys ... > keys-desc ...)) (setq link (concat "file:" ... "::" def " " name)) > (setq description (concat stype ": " name)) (org-store-link-props > :type "elisp-symbol" :link link :description description :def def > :name name :stype stype :args args :keys keys-desc :docstring > docstring :doc doc :fixme fixme :comment comment)) > =A0(save-excursion (or (looking-at "^(") (beginning-of-defun)) > (looking-at "^(\\([a-z]+\\) \\([^)\n ]+\\) ?\n?[ > =A0 =A0 =A0 =A0]*\\(?:(\\(.*\\))\\)?") (let* (... ... ... ... ... ... ...= ... ... > ... keys keys-desc link description) (if ... ...) (setq link ...) > (setq description ...) (org-store-link-props :type "elisp-symbol" > :link link :description description :def def :name name :stype stype > :args args :keys keys-desc :docstring docstring :doc doc :fixme fixme > :comment comment))) > =A0(progn (save-excursion (or ... ...) (looking-at "^(\\([a-z]+\\) > \\([^)\n ]+\\) ?\n?[ =A0 =A0]*\\(?:(\\(.*\\))\\)?") (let* ... ... ... ... > ...))) > =A0(if (eq major-mode (quote emacs-lisp-mode)) (progn (save-excursion > ... ... ...))) > =A0(when (eq major-mode (quote emacs-lisp-mode)) (save-excursion (or > ... ...) (looking-at "^(\\([a-z]+\\) \\([^)\n ]+\\) ?\n?[ > =A0 =A0 =A0 =A0]*\\(?:(\\(.*\\))\\)?") (let* ... ... ... ... ...))) > =A0org-elisp-symbol-store-link() > =A0run-hook-with-args-until-success(org-elisp-symbol-store-link) > =A0(cond ((run-hook-with-args-until-success ...) (setq link ... desc > ...)) ((equal ... "*Org Edit Src Example*") (let ... ... ... ... ... > ... ... ...)) ((equal ... ...) (let ... ...)) ((eq major-mode ...) > (let ... ... ...)) ((eq major-mode ...) (setq cpltxt ... link ...) > (org-store-link-props :type "w3" :url ...)) ((eq major-mode ...) (setq > cpltxt ... link ...) (org-store-link-props :type "w3m" :url ...)) > ((setq search ...) (setq link ...) (setq cpltxt ...)) ((eq major-mode > ...) (setq cpltxt ... link ...) (org-store-link-props :type "image" > :file buffer-file-name)) ((eq major-mode ...) (let ... ... ...)) ((and > ... ...) (setq custom-id ...) (cond ... ... ...)) ((buffer-file-name > ...) (setq cpltxt ...) (when ... ... ...) (setq link ...)) > ((interactive-p) (error "Cannot link to a buffer which is not visiting > a file")) (t (setq link nil))) > =A0(let ((outline-regexp ...) link cpltxt desc description search txt > custom-id agenda-link) (cond (... ...) (... ...) (... ...) (... ...) > (... ... ...) (... ... ...) (... ... ...) (... ... ...) (... ...) (... > ... ...) (... ... ... ...) (... ...) (t ...)) (if (consp link) (setq > cpltxt ... link ...)) (setq link (or link cpltxt) desc (or desc > cpltxt)) (if (equal desc "NONE") (setq desc nil)) (if (and ... link) > (progn ... ... ...) (or agenda-link ...))) > =A0org-store-link(nil) > =A0(if (and (boundp ...) org-capture-link-is-already-stored) (plist-get > org-store-link-plist :annotation) (org-store-link nil)) > =A0(let* ((orig-buf ...) (annotation ...) (initial ...) (entry ...)) > (when (stringp initial) (remove-text-properties 0 ... ... initial)) > (when (stringp annotation) (remove-text-properties 0 ... ... > annotation)) (cond (... ...) (... ...) (t ... ... ... ... ... ... > ...))) > =A0(cond ((equal goto ...) (org-capture-goto-target)) ((equal goto ...) > (org-capture-goto-last-stored)) (t (let* ... ... ... ...))) > =A0org-capture(nil) > =A0call-interactively(org-capture nil nil) > > > > > > > > > On 3 September 2010 02:05, Sebastian Rose wrote: >> "Tim O'Callaghan" writes: >>> When i try and use org-capture in a buffer, it fails to display the >>> template menu, and it generates the backtrace below. >>> >>> It works for org files, but not for some other files. >>> >>> Tim. >> >> >> If you pull the current Org version, the template menu should be there. >> Just make sure, your variable `org-protocol-default-template-key' is nil >> (which is the default since a few hours). >> >> We always had the "w" template as the default of that variable for >> historical reasons. =A0I changed that, since this broke lately =A0and I >> wanted to avoid dependencies between the different source files >> (org-capture.el and org-protocol.el in this case). >> >> As an aside, the interactive template selection is now on by default >> (just as long as the above variable is nil). >> >> >> >> =A0Sebastian >> >> >> >>> >>> Debugger entered--Lisp error: (wrong-type-argument stringp nil) >>> =A0 directory-file-name(nil) >>> =A0 (file-name-directory (directory-file-name dirpath)) >>> =A0 (let ((dirname ...) (basename ...)) (list dirname basename)) >>> =A0 org-git-split-dirpath(nil) >>> =A0 (let ((dirlist ...)) (when (string=3D ... "") (throw ... nil)) (set= q >>> dir (first dirlist) relpath (concat ... relpath))) >>> =A0 (while (not (file-exists-p ...)) (let (...) (when ... ...) (setq di= r >>> ... relpath ...))) >>> =A0 (catch (quote toplevel) (while (not ...) (let ... ... ...)) (list >>> (expand-file-name ".git" dir) relpath)) >>> =A0 (let ((dir ...) (relpath ...)) (catch (quote toplevel) (while ... >>> ...) (list ... relpath))) >>> =A0 org-git-gitrepos-p("~/.dotfiles/zemacsen/site-lisp/policy-switch.el= ") >>> =A0 (if (org-git-gitrepos-p file) (progn (org-store-link-props :type >>> "git" :link ...))) >>> =A0 (when (org-git-gitrepos-p file) (org-store-link-props :type "git" >>> :link (org-git-create-git-link file))) >>> =A0 (let ((file ...)) (when (org-git-gitrepos-p file) >>> (org-store-link-props :type "git" :link ...))) >>> =A0 (progn (let (...) (when ... ...))) >>> =A0 (if (buffer-file-name) (progn (let ... ...))) >>> =A0 (when (buffer-file-name) (let (...) (when ... ...))) >>> =A0 org-git-store-link() >>> =A0 run-hook-with-args-until-success(org-git-store-link) >>> =A0 (cond ((run-hook-with-args-until-success ...) (setq link ... desc >>> ...)) ((equal ... "*Org Edit Src Example*") (let ... ... ... ... ... >>> ... ... ...)) ((equal ... ...) (let ... ...)) ((eq major-mode ...) >>> (let ... ... ...)) ((eq major-mode ...) (setq cpltxt ... link ...) >>> (org-store-link-props :type "w3" :url ...)) ((eq major-mode ...) (setq >>> cpltxt ... link ...) (org-store-link-props :type "w3m" :url ...)) >>> ((setq search ...) (setq link ...) (setq cpltxt ...)) ((eq major-mode >>> ...) (setq cpltxt ... link ...) (org-store-link-props :type "image" >>> :file buffer-file-name)) ((eq major-mode ...) (let ... ... ...)) ((and >>> ... ...) (setq custom-id ...) (cond ... ... ...)) ((buffer-file-name >>> ...) (setq cpltxt ...) (when ... ... ...) (setq link ...)) >>> ((interactive-p) (error "Cannot link to a buffer which is not visiting >>> a file")) (t (setq link nil))) >>> =A0 (let ((outline-regexp ...) link cpltxt desc description search txt >>> custom-id agenda-link) (cond (... ...) (... ...) (... ...) (... ...) >>> (... ... ...) (... ... ...) (... ... ...) (... ... ...) (... ...) (... >>> ... ...) (... ... ... ...) (... ...) (t ...)) (if (consp link) (setq >>> cpltxt ... link ...)) (setq link (or link cpltxt) desc (or desc >>> cpltxt)) (if (equal desc "NONE") (setq desc nil)) (if (and ... link) >>> (progn ... ... ...) (or agenda-link ...))) >>> =A0 org-store-link(nil) >>> =A0 (if (and (boundp ...) org-capture-link-is-already-stored) (plist-ge= t >>> org-store-link-plist :annotation) (org-store-link nil)) >>> =A0 (let* ((orig-buf ...) (annotation ...) (initial ...) (entry ...)) >>> (when initial (remove-text-properties 0 ... ... initial)) (when >>> annotation (remove-text-properties 0 ... ... annotation)) (cond (... >>> ...) (... ...) (t ... ... ... ... ... ... ...))) >>> =A0 (cond ((equal goto ...) (org-capture-goto-target)) ((equal goto ...= ) >>> (org-capture-goto-last-stored)) (t (let* ... ... ... ...))) >>> =A0 org-capture(nil) >>> =A0 call-interactively(org-capture nil nil) >>> >> > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode >