* Cannot use C-c c to capture from within some files
@ 2011-04-19 16:06 Stefan Strohmeier
2011-04-19 16:38 ` Nick Dokos
2011-04-19 17:15 ` Bernt Hansen
0 siblings, 2 replies; 6+ messages in thread
From: Stefan Strohmeier @ 2011-04-19 16:06 UTC (permalink / raw)
To: emacs-orgmode
Dear Org-mode users,
I am a happy user of org-mode. Thanks for this awesome piece of software.
However, I have some problems in running the org-capture command with C-c c in some files. For example, I have a buffer English.org opened and when I try to use C-c c to capture I get the following error message:
--------------------Error--------------------
zerop: Searching for program: No such file or directory, git
--------------------Error--------------------
From within other files such as the org agenda buffer I can use the capture command without any problems. I cannot see why this problem should be related to git. I have a working copy of git installed. I use the global-set-key as explained in the tutorial.
I am using GNU Emacs 23.3.1 (NS apple-appkit) on a Mac OS X 10.6.7 machine.
Can someone please tell me what the problem might be. Any hint is greatly appreciated. Using google I could not find a related post. Please apologize if this question has been asked before.
Thanks for your time.
Stefan
Stefan Strohmeier
Doctoral Student
Bayreuth Center of Ecology and Environmental Research
http://www.bayceer.uni-bayreuth.de/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cannot use C-c c to capture from within some files
2011-04-19 16:06 Cannot use C-c c to capture from within some files Stefan Strohmeier
@ 2011-04-19 16:38 ` Nick Dokos
2011-04-19 17:15 ` Bernt Hansen
1 sibling, 0 replies; 6+ messages in thread
From: Nick Dokos @ 2011-04-19 16:38 UTC (permalink / raw)
To: Stefan Strohmeier; +Cc: nicholas.dokos, emacs-orgmode
Stefan Strohmeier <stefan.strohmeier@gmx.de> wrote:
> Dear Org-mode users,
>
> I am a happy user of org-mode. Thanks for this awesome piece of software.
>
> However, I have some problems in running the org-capture command with C-c c in some files. For example, I have a buffer English.org opened and when I try to use C-c c to capture I get the following error message:
>
> --------------------Error--------------------
> zerop: Searching for program: No such file or directory, git
> --------------------Error--------------------
>
It would help if you turn on debug-on-error to get a backtrace:
Do M-x toggle-debug-on-error and then trigger the error again.
> From within other files such as the org agenda buffer I can use the capture command without any problems. I cannot see why this problem should be related to git. I have a working copy of git installed. I use the global-set-key as explained in the tutorial.
>
> I am using GNU Emacs 23.3.1 (NS apple-appkit) on a Mac OS X 10.6.7 machine.
>
> Can someone please tell me what the problem might be. Any hint is greatly appreciated. Using google I could not find a related post. Please apologize if this question has been asked before.
>
Just guessing: There is probably a minor mode that gets enabled because
this file is under git control. That minor mode probably hijacks the C-c
c key-binding.
Nick
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cannot use C-c c to capture from within some files
2011-04-19 16:06 Cannot use C-c c to capture from within some files Stefan Strohmeier
2011-04-19 16:38 ` Nick Dokos
@ 2011-04-19 17:15 ` Bernt Hansen
2011-04-19 17:55 ` Stefan Strohmeier
1 sibling, 1 reply; 6+ messages in thread
From: Bernt Hansen @ 2011-04-19 17:15 UTC (permalink / raw)
To: Stefan Strohmeier; +Cc: emacs-orgmode
Stefan Strohmeier <stefan.strohmeier@gmx.de> writes:
> Dear Org-mode users,
>
> I am a happy user of org-mode. Thanks for this awesome piece of software.
>
> However, I have some problems in running the org-capture command with
> C-c c in some files. For example, I have a buffer English.org opened
> and when I try to use C-c c to capture I get the following error
> message:
>
> --------------------Error--------------------
> zerop: Searching for program: No such file or directory, git
> --------------------Error--------------------
>
> From within other files such as the org agenda buffer I can use the
> capture command without any problems. I cannot see why this problem
> should be related to git. I have a working copy of git installed. I
> use the global-set-key as explained in the tutorial.
>
> I am using GNU Emacs 23.3.1 (NS apple-appkit) on a Mac OS X 10.6.7 machine.
>
> Can someone please tell me what the problem might be. Any hint is
> greatly appreciated. Using google I could not find a related
> post. Please apologize if this question has been asked before.
Please provide a backtrace
(setq debug-on-error t)
and regenerate the error. Loading org without compiled elisp (C-u M-x
org-reload) will give better backtrace details.
Regards,
Bernt
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cannot use C-c c to capture from within some files
2011-04-19 17:15 ` Bernt Hansen
@ 2011-04-19 17:55 ` Stefan Strohmeier
2011-04-19 18:13 ` Bernt Hansen
0 siblings, 1 reply; 6+ messages in thread
From: Stefan Strohmeier @ 2011-04-19 17:55 UTC (permalink / raw)
To: Bernt Hansen; +Cc: emacs-orgmode
Dear Bernt and everyone else,
> Please provide a backtrace
>
> (setq debug-on-error t)
>
> and regenerate the error. Loading org without compiled elisp (C-u M-x
> org-reload) will give better backtrace details.
This is the backtrace I get when I do a org-reload withtout the compiled elisp:
--------------------Debug On Error Start--------------------
Debugger entered--Lisp error: (file-error "Searching for program" "No such file or directory" "git")
call-process("git" nil t nil "--no-pager" "--git-dir=/Users/ianus/MyElisp/Organisation/.git" "symbolic-ref" "-q" "HEAD")
(zerop (call-process org-git-program nil t nil "--no-pager" (concat "--git-dir=" gitdir) "symbolic-ref" "-q" "HEAD"))
(not (zerop (call-process org-git-program nil t nil "--no-pager" (concat "--git-dir=" gitdir) "symbolic-ref" "-q" "HEAD")))
(if (not (zerop (call-process org-git-program nil t nil "--no-pager" (concat "--git-dir=" gitdir) "symbolic-ref" "-q" "HEAD"))) (error "git error: %s " (buffer-string)) (goto-char (point-min)) (if (looking-at "^refs/heads/") (buffer-substring 12 (1- (point-max)))))
(progn (if (not (zerop (call-process org-git-program nil t nil "--no-pager" (concat "--git-dir=" gitdir) "symbolic-ref" "-q" "HEAD"))) (error "git error: %s " (buffer-string)) (goto-char (point-min)) (if (looking-at "^refs/heads/") (buffer-substring 12 (1- (point-max))))))
(unwind-protect (progn (if (not (zerop (call-process org-git-program nil t nil "--no-pager" (concat "--git-dir=" gitdir) "symbolic-ref" "-q" "HEAD"))) (error "git error: %s " (buffer-string)) (goto-char (point-min)) (if (looking-at "^refs/heads/") (buffer-substring 12 (1- (point-max)))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
(save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (if (not (zerop (call-process org-git-program nil t nil "--no-pager" (concat "--git-dir=" gitdir) "symbolic-ref" "-q" "HEAD"))) (error "git error: %s " (buffer-string)) (goto-char (point-min)) (if (looking-at "^refs/heads/") (buffer-substring 12 (1- (point-max)))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
(with-current-buffer temp-buffer (unwind-protect (progn (if (not (zerop (call-process org-git-program nil t nil "--no-pager" (concat "--git-dir=" gitdir) "symbolic-ref" "-q" "HEAD"))) (error "git error: %s " (buffer-string)) (goto-char (point-min)) (if (looking-at "^refs/heads/") (buffer-substring 12 (1- (point-max)))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
(let ((temp-buffer (generate-new-buffer " *temp*"))) (with-current-buffer temp-buffer (unwind-protect (progn (if (not (zerop (call-process org-git-program nil t nil "--no-pager" ... "symbolic-ref" "-q" "HEAD"))) (error "git error: %s " (buffer-string)) (goto-char (point-min)) (if (looking-at "^refs/heads/") (buffer-substring 12 (1- ...))))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
(with-temp-buffer (if (not (zerop (call-process org-git-program nil t nil "--no-pager" (concat "--git-dir=" gitdir) "symbolic-ref" "-q" "HEAD"))) (error "git error: %s " (buffer-string)) (goto-char (point-min)) (if (looking-at "^refs/heads/") (buffer-substring 12 (1- (point-max))))))
org-git-get-current-branch("/Users/ianus/MyElisp/Organisation/.git")
(let* ((gitdir (first (org-git-find-gitdir (file-truename file)))) (branchname (org-git-get-current-branch gitdir)) (timestring (format-time-string "%Y-%m-%d" (current-time)))) (org-make-link "git:" file "::" (org-git-create-searchstring branchname timestring)))
org-git-create-git-link("~/MyElisp/Organisation/English.org")
(org-store-link-props :type "git" :link (org-git-create-git-link file))
(progn (org-store-link-props :type "git" :link (org-git-create-git-link file)))
(if (org-git-gitrepos-p file) (progn (org-store-link-props :type "git" :link (org-git-create-git-link file))))
(when (org-git-gitrepos-p file) (org-store-link-props :type "git" :link (org-git-create-git-link file)))
(let ((file (abbreviate-file-name (buffer-file-name)))) (when (org-git-gitrepos-p file) (org-store-link-props :type "git" :link (org-git-create-git-link file))))
(progn (let ((file (abbreviate-file-name (buffer-file-name)))) (when (org-git-gitrepos-p file) (org-store-link-props :type "git" :link (org-git-create-git-link file)))))
(if (buffer-file-name) (progn (let ((file (abbreviate-file-name (buffer-file-name)))) (when (org-git-gitrepos-p file) (org-store-link-props :type "git" :link (org-git-create-git-link file))))))
(when (buffer-file-name) (let ((file (abbreviate-file-name (buffer-file-name)))) (when (org-git-gitrepos-p file) (org-store-link-props :type "git" :link (org-git-create-git-link file)))))
org-git-store-link()
run-hook-with-args-until-success(org-git-store-link)
(cond ((run-hook-with-args-until-success (quote org-store-link-functions)) (setq link (plist-get org-store-link-plist :link) desc (or (plist-get org-store-link-plist :description) link))) ((equal (buffer-name) "*Org Edit Src Example*") (let (label gc) (while (or (not label) (save-excursion (save-restriction (widen) (goto-char ...) (re-search-forward ... nil t)))) (when label (message "Label exists already") (sit-for 2)) (setq label (read-string "Code line label: " label))) (end-of-line 1) (setq link (format org-coderef-label-format label)) (setq gc (- 79 (length link))) (if (< (current-column) gc) (org-move-to-column gc t) (insert " ")) (insert link) (setq link (concat "(" label ")") desc nil))) ((equal (org-bound-and-true-p org-agenda-buffer-name) (buffer-name)) (let ((m (or (get-text-property (point) (quote org-hd-marker)) (get-text-property (point) (quote org-marker))))) (when m (org-with-point-at m (setq agenda-link (if (interactive-p) (call-interactively ...) (org-store-link nil))))))) ((eq major-mode (quote calendar-mode)) (let ((cd (calendar-cursor-to-date))) (setq link (format-time-string (car org-time-stamp-formats) (apply (quote encode-time) (list 0 0 0 (nth 1 cd) (nth 0 cd) (nth 2 cd) nil nil nil)))) (org-store-link-props :type "calendar" :date cd))) ((eq major-mode (quote w3-mode)) (setq cpltxt (if (and (buffer-name) (not (string-match "Untitled" (buffer-name)))) (buffer-name) (url-view-url t)) link (org-make-link (url-view-url t))) (org-store-link-props :type "w3" :url (url-view-url t))) ((eq major-mode (quote w3m-mode)) (setq cpltxt (or w3m-current-title w3m-current-url) link (org-make-link w3m-current-url)) (org-store-link-props :type "w3m" :url (url-view-url t))) ((setq search (run-hook-with-args-until-success (quote org-create-file-search-functions))) (setq link (concat "file:" (abbreviate-file-name buffer-file-name) "::" search)) (setq cpltxt (or description link))) ((eq major-mode (quote image-mode)) (setq cpltxt (concat "file:" (abbreviate-file-name buffer-file-name)) link (org-make-link cpltxt)) (org-store-link-props :type "image" :file buffer-file-name)) ((eq major-mode (quote dired-mode)) (let ((file (dired-get-filename nil t))) (setq file (if file (abbreviate-file-name (expand-file-name (dired-get-filename nil t))) default-directory)) (setq cpltxt (concat "file:" file) link (org-make-link cpltxt)))) ((and (buffer-file-name (buffer-base-buffer)) (org-mode-p)) (setq custom-id (org-entry-get nil "CUSTOM_ID")) (cond ((org-in-regexp "<<\\(.*?\\)>>") (setq cpltxt (concat "file:" (abbreviate-file-name (buffer-file-name ...)) "::" (match-string 1)) link (org-make-link cpltxt))) ((and (featurep (quote org-id)) (or (eq org-link-to-org-use-id t) (and (eq org-link-to-org-use-id ...) (interactive-p)) (and (eq org-link-to-org-use-id ...) (interactive-p) (not custom-id)) (and org-link-to-org-use-id (org-entry-get nil "ID")))) (setq link (condition-case nil (prog1 (org-id-store-link) (setq desc ...)) (error (concat "file:" ...))))) (t (setq cpltxt (concat "file:" (abbreviate-file-name (buffer-file-name ...)))) (when (org-xor org-context-in-file-links arg) (setq txt (cond (... nil) (... ...) (t nil))) (when (or (null txt) (string-match "\\S-" txt)) (setq cpltxt (concat cpltxt "::" ...) desc (or ... "NONE")))) (if (string-match "::\\'" cpltxt) (setq cpltxt (substring cpltxt 0 -2))) (setq link (org-make-link cpltxt))))) ((buffer-file-name (buffer-base-buffer)) (setq cpltxt (concat "file:" (abbreviate-file-name (buffer-file-name (buffer-base-buffer))))) (when (org-xor org-context-in-file-links arg) (setq txt (if (org-region-active-p) (buffer-substring (region-beginning) (region-end)) (buffer-substring (point-at-bol) (point-at-eol)))) (when (string-match "\\S-" txt) (setq cpltxt (concat cpltxt "::" (org-make-org-heading-search-string txt)) desc "NONE"))) (setq link (org-make-link cpltxt))) ((interactive-p) (error "Cannot link to a buffer which is not visiting a file")) (t (setq link nil)))
(let (link cpltxt desc description search txt custom-id agenda-link) (cond ((run-hook-with-args-until-success (quote org-store-link-functions)) (setq link (plist-get org-store-link-plist :link) desc (or (plist-get org-store-link-plist :description) link))) ((equal (buffer-name) "*Org Edit Src Example*") (let (label gc) (while (or (not label) (save-excursion (save-restriction ... ... ...))) (when label (message "Label exists already") (sit-for 2)) (setq label (read-string "Code line label: " label))) (end-of-line 1) (setq link (format org-coderef-label-format label)) (setq gc (- 79 (length link))) (if (< (current-column) gc) (org-move-to-column gc t) (insert " ")) (insert link) (setq link (concat "(" label ")") desc nil))) ((equal (org-bound-and-true-p org-agenda-buffer-name) (buffer-name)) (let ((m (or (get-text-property ... ...) (get-text-property ... ...)))) (when m (org-with-point-at m (setq agenda-link (if ... ... ...)))))) ((eq major-mode (quote calendar-mode)) (let ((cd (calendar-cursor-to-date))) (setq link (format-time-string (car org-time-stamp-formats) (apply (quote encode-time) (list 0 0 0 ... ... ... nil nil nil)))) (org-store-link-props :type "calendar" :date cd))) ((eq major-mode (quote w3-mode)) (setq cpltxt (if (and (buffer-name) (not (string-match "Untitled" ...))) (buffer-name) (url-view-url t)) link (org-make-link (url-view-url t))) (org-store-link-props :type "w3" :url (url-view-url t))) ((eq major-mode (quote w3m-mode)) (setq cpltxt (or w3m-current-title w3m-current-url) link (org-make-link w3m-current-url)) (org-store-link-props :type "w3m" :url (url-view-url t))) ((setq search (run-hook-with-args-until-success (quote org-create-file-search-functions))) (setq link (concat "file:" (abbreviate-file-name buffer-file-name) "::" search)) (setq cpltxt (or description link))) ((eq major-mode (quote image-mode)) (setq cpltxt (concat "file:" (abbreviate-file-name buffer-file-name)) link (org-make-link cpltxt)) (org-store-link-props :type "image" :file buffer-file-name)) ((eq major-mode (quote dired-mode)) (let ((file (dired-get-filename nil t))) (setq file (if file (abbreviate-file-name (expand-file-name ...)) default-directory)) (setq cpltxt (concat "file:" file) link (org-make-link cpltxt)))) ((and (buffer-file-name (buffer-base-buffer)) (org-mode-p)) (setq custom-id (org-entry-get nil "CUSTOM_ID")) (cond ((org-in-regexp "<<\\(.*?\\)>>") (setq cpltxt (concat "file:" (abbreviate-file-name ...) "::" (match-string 1)) link (org-make-link cpltxt))) ((and (featurep (quote org-id)) (or (eq org-link-to-org-use-id t) (and ... ...) (and ... ... ...) (and org-link-to-org-use-id ...))) (setq link (condition-case nil (prog1 ... ...) (error ...)))) (t (setq cpltxt (concat "file:" (abbreviate-file-name ...))) (when (org-xor org-context-in-file-links arg) (setq txt (cond ... ... ...)) (when (or ... ...) (setq cpltxt ... desc ...))) (if (string-match "::\\'" cpltxt) (setq cpltxt (substring cpltxt 0 -2))) (setq link (org-make-link cpltxt))))) ((buffer-file-name (buffer-base-buffer)) (setq cpltxt (concat "file:" (abbreviate-file-name (buffer-file-name (buffer-base-buffer))))) (when (org-xor org-context-in-file-links arg) (setq txt (if (org-region-active-p) (buffer-substring (region-beginning) (region-end)) (buffer-substring (point-at-bol) (point-at-eol)))) (when (string-match "\\S-" txt) (setq cpltxt (concat cpltxt "::" (org-make-org-heading-search-string txt)) desc "NONE"))) (setq link (org-make-link cpltxt))) ((interactive-p) (error "Cannot link to a buffer which is not visiting a file")) (t (setq link nil))) (if (consp link) (setq cpltxt (car link) link (cdr link))) (setq link (or link cpltxt) desc (or desc cpltxt)) (if (equal desc "NONE") (setq desc nil)) (if (and (or (interactive-p) executing-kbd-macro) link) (progn (setq org-stored-links (cons (list link desc) org-stored-links)) (message "Stored: %s" (or desc link)) (when custom-id (setq link (concat "file:" (abbreviate-file-name (buffer-file-name)) "::#" custom-id)) (setq org-stored-links (cons (list link desc) org-stored-links)))) (or agenda-link (and link (org-make-link-string link desc)))))
(let* ((outline-regexp (org-get-limited-outline-regexp))) (let (link cpltxt desc description search txt custom-id agenda-link) (cond ((run-hook-with-args-until-success (quote org-store-link-functions)) (setq link (plist-get org-store-link-plist :link) desc (or (plist-get org-store-link-plist :description) link))) ((equal (buffer-name) "*Org Edit Src Example*") (let (label gc) (while (or (not label) (save-excursion ...)) (when label (message "Label exists already") (sit-for 2)) (setq label (read-string "Code line label: " label))) (end-of-line 1) (setq link (format org-coderef-label-format label)) (setq gc (- 79 (length link))) (if (< (current-column) gc) (org-move-to-column gc t) (insert " ")) (insert link) (setq link (concat "(" label ")") desc nil))) ((equal (org-bound-and-true-p org-agenda-buffer-name) (buffer-name)) (let ((m (or ... ...))) (when m (org-with-point-at m (setq agenda-link ...))))) ((eq major-mode (quote calendar-mode)) (let ((cd (calendar-cursor-to-date))) (setq link (format-time-string (car org-time-stamp-formats) (apply ... ...))) (org-store-link-props :type "calendar" :date cd))) ((eq major-mode (quote w3-mode)) (setq cpltxt (if (and (buffer-name) (not ...)) (buffer-name) (url-view-url t)) link (org-make-link (url-view-url t))) (org-store-link-props :type "w3" :url (url-view-url t))) ((eq major-mode (quote w3m-mode)) (setq cpltxt (or w3m-current-title w3m-current-url) link (org-make-link w3m-current-url)) (org-store-link-props :type "w3m" :url (url-view-url t))) ((setq search (run-hook-with-args-until-success (quote org-create-file-search-functions))) (setq link (concat "file:" (abbreviate-file-name buffer-file-name) "::" search)) (setq cpltxt (or description link))) ((eq major-mode (quote image-mode)) (setq cpltxt (concat "file:" (abbreviate-file-name buffer-file-name)) link (org-make-link cpltxt)) (org-store-link-props :type "image" :file buffer-file-name)) ((eq major-mode (quote dired-mode)) (let ((file (dired-get-filename nil t))) (setq file (if file (abbreviate-file-name ...) default-directory)) (setq cpltxt (concat "file:" file) link (org-make-link cpltxt)))) ((and (buffer-file-name (buffer-base-buffer)) (org-mode-p)) (setq custom-id (org-entry-get nil "CUSTOM_ID")) (cond ((org-in-regexp "<<\\(.*?\\)>>") (setq cpltxt (concat "file:" ... "::" ...) link (org-make-link cpltxt))) ((and (featurep ...) (or ... ... ... ...)) (setq link (condition-case nil ... ...))) (t (setq cpltxt (concat "file:" ...)) (when (org-xor org-context-in-file-links arg) (setq txt ...) (when ... ...)) (if (string-match "::\\'" cpltxt) (setq cpltxt ...)) (setq link (org-make-link cpltxt))))) ((buffer-file-name (buffer-base-buffer)) (setq cpltxt (concat "file:" (abbreviate-file-name (buffer-file-name ...)))) (when (org-xor org-context-in-file-links arg) (setq txt (if (org-region-active-p) (buffer-substring ... ...) (buffer-substring ... ...))) (when (string-match "\\S-" txt) (setq cpltxt (concat cpltxt "::" ...) desc "NONE"))) (setq link (org-make-link cpltxt))) ((interactive-p) (error "Cannot link to a buffer which is not visiting a file")) (t (setq link nil))) (if (consp link) (setq cpltxt (car link) link (cdr link))) (setq link (or link cpltxt) desc (or desc cpltxt)) (if (equal desc "NONE") (setq desc nil)) (if (and (or (interactive-p) executing-kbd-macro) link) (progn (setq org-stored-links (cons (list link desc) org-stored-links)) (message "Stored: %s" (or desc link)) (when custom-id (setq link (concat "file:" (abbreviate-file-name ...) "::#" custom-id)) (setq org-stored-links (cons (list link desc) org-stored-links)))) (or agenda-link (and link (org-make-link-string link desc))))))
(org-with-limited-levels (let (link cpltxt desc description search txt custom-id agenda-link) (cond ((run-hook-with-args-until-success (quote org-store-link-functions)) (setq link (plist-get org-store-link-plist :link) desc (or (plist-get org-store-link-plist :description) link))) ((equal (buffer-name) "*Org Edit Src Example*") (let (label gc) (while (or (not label) (save-excursion ...)) (when label (message "Label exists already") (sit-for 2)) (setq label (read-string "Code line label: " label))) (end-of-line 1) (setq link (format org-coderef-label-format label)) (setq gc (- 79 (length link))) (if (< (current-column) gc) (org-move-to-column gc t) (insert " ")) (insert link) (setq link (concat "(" label ")") desc nil))) ((equal (org-bound-and-true-p org-agenda-buffer-name) (buffer-name)) (let ((m (or ... ...))) (when m (org-with-point-at m (setq agenda-link ...))))) ((eq major-mode (quote calendar-mode)) (let ((cd (calendar-cursor-to-date))) (setq link (format-time-string (car org-time-stamp-formats) (apply ... ...))) (org-store-link-props :type "calendar" :date cd))) ((eq major-mode (quote w3-mode)) (setq cpltxt (if (and (buffer-name) (not ...)) (buffer-name) (url-view-url t)) link (org-make-link (url-view-url t))) (org-store-link-props :type "w3" :url (url-view-url t))) ((eq major-mode (quote w3m-mode)) (setq cpltxt (or w3m-current-title w3m-current-url) link (org-make-link w3m-current-url)) (org-store-link-props :type "w3m" :url (url-view-url t))) ((setq search (run-hook-with-args-until-success (quote org-create-file-search-functions))) (setq link (concat "file:" (abbreviate-file-name buffer-file-name) "::" search)) (setq cpltxt (or description link))) ((eq major-mode (quote image-mode)) (setq cpltxt (concat "file:" (abbreviate-file-name buffer-file-name)) link (org-make-link cpltxt)) (org-store-link-props :type "image" :file buffer-file-name)) ((eq major-mode (quote dired-mode)) (let ((file (dired-get-filename nil t))) (setq file (if file (abbreviate-file-name ...) default-directory)) (setq cpltxt (concat "file:" file) link (org-make-link cpltxt)))) ((and (buffer-file-name (buffer-base-buffer)) (org-mode-p)) (setq custom-id (org-entry-get nil "CUSTOM_ID")) (cond ((org-in-regexp "<<\\(.*?\\)>>") (setq cpltxt (concat "file:" ... "::" ...) link (org-make-link cpltxt))) ((and (featurep ...) (or ... ... ... ...)) (setq link (condition-case nil ... ...))) (t (setq cpltxt (concat "file:" ...)) (when (org-xor org-context-in-file-links arg) (setq txt ...) (when ... ...)) (if (string-match "::\\'" cpltxt) (setq cpltxt ...)) (setq link (org-make-link cpltxt))))) ((buffer-file-name (buffer-base-buffer)) (setq cpltxt (concat "file:" (abbreviate-file-name (buffer-file-name ...)))) (when (org-xor org-context-in-file-links arg) (setq txt (if (org-region-active-p) (buffer-substring ... ...) (buffer-substring ... ...))) (when (string-match "\\S-" txt) (setq cpltxt (concat cpltxt "::" ...) desc "NONE"))) (setq link (org-make-link cpltxt))) ((interactive-p) (error "Cannot link to a buffer which is not visiting a file")) (t (setq link nil))) (if (consp link) (setq cpltxt (car link) link (cdr link))) (setq link (or link cpltxt) desc (or desc cpltxt)) (if (equal desc "NONE") (setq desc nil)) (if (and (or (interactive-p) executing-kbd-macro) link) (progn (setq org-stored-links (cons (list link desc) org-stored-links)) (message "Stored: %s" (or desc link)) (when custom-id (setq link (concat "file:" (abbreviate-file-name ...) "::#" custom-id)) (setq org-stored-links (cons (list link desc) org-stored-links)))) (or agenda-link (and link (org-make-link-string link desc))))))
org-store-link(nil)
(if (and (boundp (quote org-capture-link-is-already-stored)) org-capture-link-is-already-stored) (plist-get org-store-link-plist :annotation) (org-store-link nil))
(let* ((orig-buf (current-buffer)) (annotation (if (and (boundp (quote org-capture-link-is-already-stored)) org-capture-link-is-already-stored) (plist-get org-store-link-plist :annotation) (org-store-link nil))) (initial (and (org-region-active-p) (buffer-substring (point) (mark)))) (entry (org-capture-select-template keys))) (when (stringp initial) (remove-text-properties 0 (length initial) (quote (read-only t)) initial)) (when (stringp annotation) (remove-text-properties 0 (length annotation) (quote (read-only t)) annotation)) (cond ((equal entry "C") (customize-variable (quote org-capture-templates))) ((equal entry "q") (error "Abort")) (t (org-capture-set-plist entry) (org-capture-get-template) (org-capture-put :original-buffer orig-buf :original-file (buffer-file-name orig-buf) :original-file-nondirectory (and (buffer-file-name orig-buf) (file-name-nondirectory (buffer-file-name orig-buf))) :annotation annotation :initial initial) (org-capture-put :default-time (or org-overriding-default-time (org-current-time))) (org-capture-set-target-location) (condition-case error (org-capture-put :template (org-capture-fill-template)) ((error quit) (if (get-buffer "*Capture*") (kill-buffer "*Capture*")) (error "Capture abort: %s" error))) (if (equal goto 0) (org-capture-insert-template-here) (condition-case error (org-capture-place-template) ((error quit) (if (and ... ...) (kill-buffer ...)) (set-window-configuration (org-capture-get :return-to-wconf)) (error "Capture template `%s': %s" (org-capture-get :key) (nth 1 error)))) (if (org-capture-get :immediate-finish) (org-capture-finalize nil (not (org-capture-get :clock-keep))) (if (and (org-mode-p) (org-capture-get :clock-in)) (condition-case nil (progn ... ... ...) (error "Could not start the clock in this capture buffer"))))))))
(cond ((equal goto (quote (4))) (org-capture-goto-target)) ((equal goto (quote (16))) (org-capture-goto-last-stored)) (t (let* ((orig-buf (current-buffer)) (annotation (if (and (boundp ...) org-capture-link-is-already-stored) (plist-get org-store-link-plist :annotation) (org-store-link nil))) (initial (and (org-region-active-p) (buffer-substring (point) (mark)))) (entry (org-capture-select-template keys))) (when (stringp initial) (remove-text-properties 0 (length initial) (quote (read-only t)) initial)) (when (stringp annotation) (remove-text-properties 0 (length annotation) (quote (read-only t)) annotation)) (cond ((equal entry "C") (customize-variable (quote org-capture-templates))) ((equal entry "q") (error "Abort")) (t (org-capture-set-plist entry) (org-capture-get-template) (org-capture-put :original-buffer orig-buf :original-file (buffer-file-name orig-buf) :original-file-nondirectory (and (buffer-file-name orig-buf) (file-name-nondirectory ...)) :annotation annotation :initial initial) (org-capture-put :default-time (or org-overriding-default-time (org-current-time))) (org-capture-set-target-location) (condition-case error (org-capture-put :template (org-capture-fill-template)) ((error quit) (if ... ...) (error "Capture abort: %s" error))) (if (equal goto 0) (org-capture-insert-template-here) (condition-case error (org-capture-place-template) (... ... ... ...)) (if (org-capture-get :immediate-finish) (org-capture-finalize nil ...) (if ... ...))))))))
org-capture(nil)
call-interactively(org-capture nil nil)
recursive-edit()
byte-code("\306\x10 @\307=\203!
--------------------Debug On Error End--------------------
Thanks again for your time.
Stefan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cannot use C-c c to capture from within some files
2011-04-19 17:55 ` Stefan Strohmeier
@ 2011-04-19 18:13 ` Bernt Hansen
2011-04-19 19:51 ` Stefan Strohmeier
0 siblings, 1 reply; 6+ messages in thread
From: Bernt Hansen @ 2011-04-19 18:13 UTC (permalink / raw)
To: Stefan Strohmeier; +Cc: emacs-orgmode
Hi Stefan,
It looks like your capture session is trying to create a git link and
can't find the 'git' program. I assume you are using
contrib/org-git-link.el. I personally have no experience with this
package.
Can you provide details of the capture template you are using when you
get this error? Is 'git' in your PATH for emacs (can Emacs find it?)
Does this same template work okay in the agenda?
You may need to customize org-git-program if 'git' isn't available in
your default path for Emacs.
I don't use a Mac so we may need some Mac users to chime in here for
assistance.
Regards,
Bernt
Stefan Strohmeier <stefan.strohmeier@gmx.de> writes:
> Dear Bernt and everyone else,
>
>> Please provide a backtrace
>>
>> (setq debug-on-error t)
>>
>> and regenerate the error. Loading org without compiled elisp (C-u M-x
>> org-reload) will give better backtrace details.
>
> This is the backtrace I get when I do a org-reload withtout the compiled elisp:
>
> --------------------Debug On Error Start--------------------
> Debugger entered--Lisp error: (file-error "Searching for program" "No such file or directory" "git")
> call-process("git" nil t nil "--no-pager" "--git-dir=/Users/ianus/MyElisp/Organisation/.git" "symbolic-ref" "-q" "HEAD")
> (zerop (call-process org-git-program nil t nil "--no-pager" (concat "--git-dir=" gitdir) "symbolic-ref" "-q" "HEAD"))
> (not (zerop (call-process org-git-program nil t nil "--no-pager" (concat "--git-dir=" gitdir) "symbolic-ref" "-q" "HEAD")))
> (if (not (zerop (call-process org-git-program nil t nil "--no-pager"
> (concat "--git-dir=" gitdir) "symbolic-ref" "-q" "HEAD"))) (error "git
> error: %s " (buffer-string)) (goto-char (point-min)) (if (looking-at
> "^refs/heads/") (buffer-substring 12 (1- (point-max)))))
> (progn (if (not (zerop (call-process org-git-program nil t nil
> "--no-pager" (concat "--git-dir=" gitdir) "symbolic-ref" "-q"
> "HEAD"))) (error "git error: %s " (buffer-string)) (goto-char
> (point-min)) (if (looking-at "^refs/heads/") (buffer-substring 12 (1-
> (point-max))))))
> (unwind-protect (progn (if (not (zerop (call-process org-git-program
> nil t nil "--no-pager" (concat "--git-dir=" gitdir) "symbolic-ref"
> "-q" "HEAD"))) (error "git error: %s " (buffer-string)) (goto-char
> (point-min)) (if (looking-at "^refs/heads/") (buffer-substring 12 (1-
> (point-max)))))) (and (buffer-name temp-buffer) (kill-buffer
> temp-buffer)))
> (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn
> (if (not (zerop (call-process org-git-program nil t nil "--no-pager"
> (concat "--git-dir=" gitdir) "symbolic-ref" "-q" "HEAD"))) (error "git
> error: %s " (buffer-string)) (goto-char (point-min)) (if (looking-at
> "^refs/heads/") (buffer-substring 12 (1- (point-max)))))) (and
> (buffer-name temp-buffer) (kill-buffer temp-buffer))))
> (with-current-buffer temp-buffer (unwind-protect (progn (if (not
> (zerop (call-process org-git-program nil t nil "--no-pager" (concat
> "--git-dir=" gitdir) "symbolic-ref" "-q" "HEAD"))) (error "git error:
> %s " (buffer-string)) (goto-char (point-min)) (if (looking-at
> "^refs/heads/") (buffer-substring 12 (1- (point-max)))))) (and
> (buffer-name temp-buffer) (kill-buffer temp-buffer))))
> (let ((temp-buffer (generate-new-buffer " *temp*")))
> (with-current-buffer temp-buffer (unwind-protect (progn (if (not
> (zerop (call-process org-git-program nil t nil "--no-pager"
> ... "symbolic-ref" "-q" "HEAD"))) (error "git error: %s "
> (buffer-string)) (goto-char (point-min)) (if (looking-at
> "^refs/heads/") (buffer-substring 12 (1- ...))))) (and (buffer-name
> temp-buffer) (kill-buffer temp-buffer)))))
> (with-temp-buffer (if (not (zerop (call-process org-git-program nil
> t nil "--no-pager" (concat "--git-dir=" gitdir) "symbolic-ref" "-q"
> "HEAD"))) (error "git error: %s " (buffer-string)) (goto-char
> (point-min)) (if (looking-at "^refs/heads/") (buffer-substring 12 (1-
> (point-max))))))
> org-git-get-current-branch("/Users/ianus/MyElisp/Organisation/.git")
> (let* ((gitdir (first (org-git-find-gitdir (file-truename file))))
> (branchname (org-git-get-current-branch gitdir)) (timestring
> (format-time-string "%Y-%m-%d" (current-time)))) (org-make-link "git:"
> file "::" (org-git-create-searchstring branchname timestring)))
> org-git-create-git-link("~/MyElisp/Organisation/English.org")
> (org-store-link-props :type "git" :link (org-git-create-git-link file))
> (progn (org-store-link-props :type "git" :link (org-git-create-git-link file)))
> (if (org-git-gitrepos-p file) (progn (org-store-link-props :type "git" :link (org-git-create-git-link file))))
> (when (org-git-gitrepos-p file) (org-store-link-props :type "git" :link (org-git-create-git-link file)))
> (let ((file (abbreviate-file-name (buffer-file-name)))) (when (org-git-gitrepos-p file) (org-store-link-props :type "git" :link (org-git-create-git-link file))))
> (progn (let ((file (abbreviate-file-name (buffer-file-name)))) (when (org-git-gitrepos-p file) (org-store-link-props :type "git" :link (org-git-create-git-link file)))))
> (if (buffer-file-name) (progn (let ((file (abbreviate-file-name (buffer-file-name)))) (when (org-git-gitrepos-p file) (org-store-link-props :type "git" :link (org-git-create-git-link file))))))
> (when (buffer-file-name) (let ((file (abbreviate-file-name (buffer-file-name)))) (when (org-git-gitrepos-p file) (org-store-link-props :type "git" :link (org-git-create-git-link file)))))
> org-git-store-link()
> run-hook-with-args-until-success(org-git-store-link)
> (cond ((run-hook-with-args-until-success (quote
> org-store-link-functions)) (setq link (plist-get org-store-link-plist
> :link) desc (or (plist-get org-store-link-plist :description) link)))
> ((equal (buffer-name) "*Org Edit Src Example*") (let (label gc) (while
> (or (not label) (save-excursion (save-restriction (widen) (goto-char
> ...) (re-search-forward ... nil t)))) (when label (message "Label
> exists already") (sit-for 2)) (setq label (read-string "Code line
> label: " label))) (end-of-line 1) (setq link (format
> org-coderef-label-format label)) (setq gc (- 79 (length link))) (if (<
> (current-column) gc) (org-move-to-column gc t) (insert " ")) (insert
> link) (setq link (concat "(" label ")") desc nil))) ((equal
> (org-bound-and-true-p org-agenda-buffer-name) (buffer-name)) (let ((m
> (or (get-text-property (point) (quote org-hd-marker))
> (get-text-property (point) (quote org-marker))))) (when m
> (org-with-point-at m (setq agenda-link (if (interactive-p)
> (call-interactively ...) (org-store-link nil))))))) ((eq major-mode
> (quote calendar-mode)) (let ((cd (calendar-cursor-to-date))) (setq
> link (format-time-string (car org-time-stamp-formats) (apply (quote
> encode-time) (list 0 0 0 (nth 1 cd) (nth 0 cd) (nth 2 cd) nil nil
> nil)))) (org-store-link-props :type "calendar" :date cd))) ((eq
> major-mode (quote w3-mode)) (setq cpltxt (if (and (buffer-name) (not
> (string-match "Untitled" (buffer-name)))) (buffer-name) (url-view-url
> t)) link (org-make-link (url-view-url t))) (org-store-link-props :type
> "w3" :url (url-view-url t))) ((eq major-mode (quote w3m-mode)) (setq
> cpltxt (or w3m-current-title w3m-current-url) link (org-make-link
> w3m-current-url)) (org-store-link-props :type "w3m" :url (url-view-url
> t))) ((setq search (run-hook-with-args-until-success (quote
> org-create-file-search-functions))) (setq link (concat "file:"
> (abbreviate-file-name buffer-file-name) "::" search)) (setq cpltxt (or
> description link))) ((eq major-mode (quote image-mode)) (setq cpltxt
> (concat "file:" (abbreviate-file-name buffer-file-name)) link
> (org-make-link cpltxt)) (org-store-link-props :type "image" :file
> buffer-file-name)) ((eq major-mode (quote dired-mode)) (let ((file
> (dired-get-filename nil t))) (setq file (if file (abbreviate-file-name
> (expand-file-name (dired-get-filename nil t))) default-directory))
> (setq cpltxt (concat "file:" file) link (org-make-link cpltxt))))
> ((and (buffer-file-name (buffer-base-buffer)) (org-mode-p)) (setq
> custom-id (org-entry-get nil "CUSTOM_ID")) (cond ((org-in-regexp
> "<<\\(.*?\\)>>") (setq cpltxt (concat "file:" (abbreviate-file-name
> (buffer-file-name ...)) "::" (match-string 1)) link (org-make-link
> cpltxt))) ((and (featurep (quote org-id)) (or (eq
> org-link-to-org-use-id t) (and (eq org-link-to-org-use-id ...)
> (interactive-p)) (and (eq org-link-to-org-use-id ...) (interactive-p)
> (not custom-id)) (and org-link-to-org-use-id (org-entry-get nil
> "ID")))) (setq link (condition-case nil (prog1 (org-id-store-link)
> (setq desc ...)) (error (concat "file:" ...))))) (t (setq cpltxt
> (concat "file:" (abbreviate-file-name (buffer-file-name ...)))) (when
> (org-xor org-context-in-file-links arg) (setq txt (cond (... nil)
> (... ...) (t nil))) (when (or (null txt) (string-match "\\S-" txt))
> (setq cpltxt (concat cpltxt "::" ...) desc (or ... "NONE")))) (if
> (string-match "::\\'" cpltxt) (setq cpltxt (substring cpltxt 0 -2)))
> (setq link (org-make-link cpltxt))))) ((buffer-file-name
> (buffer-base-buffer)) (setq cpltxt (concat "file:"
> (abbreviate-file-name (buffer-file-name (buffer-base-buffer))))) (when
> (org-xor org-context-in-file-links arg) (setq txt (if
> (org-region-active-p) (buffer-substring (region-beginning)
> (region-end)) (buffer-substring (point-at-bol) (point-at-eol)))) (when
> (string-match "\\S-" txt) (setq cpltxt (concat cpltxt "::"
> (org-make-org-heading-search-string txt)) desc "NONE"))) (setq link
> (org-make-link cpltxt))) ((interactive-p) (error "Cannot link to a
> buffer which is not visiting a file")) (t (setq link nil)))
> (let (link cpltxt desc description search txt custom-id agenda-link)
> (cond ((run-hook-with-args-until-success (quote
> org-store-link-functions)) (setq link (plist-get org-store-link-plist
> :link) desc (or (plist-get org-store-link-plist :description) link)))
> ((equal (buffer-name) "*Org Edit Src Example*") (let (label gc) (while
> (or (not label) (save-excursion (save-restriction ... ... ...))) (when
> label (message "Label exists already") (sit-for 2)) (setq label
> (read-string "Code line label: " label))) (end-of-line 1) (setq link
> (format org-coderef-label-format label)) (setq gc (- 79 (length
> link))) (if (< (current-column) gc) (org-move-to-column gc t) (insert
> " ")) (insert link) (setq link (concat "(" label ")") desc nil)))
> ((equal (org-bound-and-true-p org-agenda-buffer-name) (buffer-name))
> (let ((m (or (get-text-property ... ...) (get-text-property
> ... ...)))) (when m (org-with-point-at m (setq agenda-link (if
> ... ... ...)))))) ((eq major-mode (quote calendar-mode)) (let ((cd
> (calendar-cursor-to-date))) (setq link (format-time-string (car
> org-time-stamp-formats) (apply (quote encode-time) (list 0 0 0
> ... ... ... nil nil nil)))) (org-store-link-props :type "calendar"
> :date cd))) ((eq major-mode (quote w3-mode)) (setq cpltxt (if (and
> (buffer-name) (not (string-match "Untitled" ...))) (buffer-name)
> (url-view-url t)) link (org-make-link (url-view-url t)))
> (org-store-link-props :type "w3" :url (url-view-url t))) ((eq
> major-mode (quote w3m-mode)) (setq cpltxt (or w3m-current-title
> w3m-current-url) link (org-make-link w3m-current-url))
> (org-store-link-props :type "w3m" :url (url-view-url t))) ((setq
> search (run-hook-with-args-until-success (quote
> org-create-file-search-functions))) (setq link (concat "file:"
> (abbreviate-file-name buffer-file-name) "::" search)) (setq cpltxt (or
> description link))) ((eq major-mode (quote image-mode)) (setq cpltxt
> (concat "file:" (abbreviate-file-name buffer-file-name)) link
> (org-make-link cpltxt)) (org-store-link-props :type "image" :file
> buffer-file-name)) ((eq major-mode (quote dired-mode)) (let ((file
> (dired-get-filename nil t))) (setq file (if file (abbreviate-file-name
> (expand-file-name ...)) default-directory)) (setq cpltxt (concat
> "file:" file) link (org-make-link cpltxt)))) ((and (buffer-file-name
> (buffer-base-buffer)) (org-mode-p)) (setq custom-id (org-entry-get nil
> "CUSTOM_ID")) (cond ((org-in-regexp "<<\\(.*?\\)>>") (setq cpltxt
> (concat "file:" (abbreviate-file-name ...) "::" (match-string 1)) link
> (org-make-link cpltxt))) ((and (featurep (quote org-id)) (or (eq
> org-link-to-org-use-id t) (and ... ...) (and ... ... ...) (and
> org-link-to-org-use-id ...))) (setq link (condition-case nil (prog1
> ... ...) (error ...)))) (t (setq cpltxt (concat "file:"
> (abbreviate-file-name ...))) (when (org-xor org-context-in-file-links
> arg) (setq txt (cond ... ... ...)) (when (or ... ...) (setq cpltxt
> ... desc ...))) (if (string-match "::\\'" cpltxt) (setq cpltxt
> (substring cpltxt 0 -2))) (setq link (org-make-link cpltxt)))))
> ((buffer-file-name (buffer-base-buffer)) (setq cpltxt (concat "file:"
> (abbreviate-file-name (buffer-file-name (buffer-base-buffer))))) (when
> (org-xor org-context-in-file-links arg) (setq txt (if
> (org-region-active-p) (buffer-substring (region-beginning)
> (region-end)) (buffer-substring (point-at-bol) (point-at-eol)))) (when
> (string-match "\\S-" txt) (setq cpltxt (concat cpltxt "::"
> (org-make-org-heading-search-string txt)) desc "NONE"))) (setq link
> (org-make-link cpltxt))) ((interactive-p) (error "Cannot link to a
> buffer which is not visiting a file")) (t (setq link nil))) (if (consp
> link) (setq cpltxt (car link) link (cdr link))) (setq link (or link
> cpltxt) desc (or desc cpltxt)) (if (equal desc "NONE") (setq desc
> nil)) (if (and (or (interactive-p) executing-kbd-macro) link) (progn
> (setq org-stored-links (cons (list link desc) org-stored-links))
> (message "Stored: %s" (or desc link)) (when custom-id (setq link
> (concat "file:" (abbreviate-file-name (buffer-file-name)) "::#"
> custom-id)) (setq org-stored-links (cons (list link desc)
> org-stored-links)))) (or agenda-link (and link (org-make-link-string
> link desc)))))
> (let* ((outline-regexp (org-get-limited-outline-regexp))) (let (link
> cpltxt desc description search txt custom-id agenda-link) (cond
> ((run-hook-with-args-until-success (quote org-store-link-functions))
> (setq link (plist-get org-store-link-plist :link) desc (or (plist-get
> org-store-link-plist :description) link))) ((equal (buffer-name) "*Org
> Edit Src Example*") (let (label gc) (while (or (not label)
> (save-excursion ...)) (when label (message "Label exists already")
> (sit-for 2)) (setq label (read-string "Code line label: " label)))
> (end-of-line 1) (setq link (format org-coderef-label-format label))
> (setq gc (- 79 (length link))) (if (< (current-column) gc)
> (org-move-to-column gc t) (insert " ")) (insert link) (setq link
> (concat "(" label ")") desc nil))) ((equal (org-bound-and-true-p
> org-agenda-buffer-name) (buffer-name)) (let ((m (or ... ...))) (when m
> (org-with-point-at m (setq agenda-link ...))))) ((eq major-mode (quote
> calendar-mode)) (let ((cd (calendar-cursor-to-date))) (setq link
> (format-time-string (car org-time-stamp-formats) (apply ... ...)))
> (org-store-link-props :type "calendar" :date cd))) ((eq major-mode
> (quote w3-mode)) (setq cpltxt (if (and (buffer-name) (not ...))
> (buffer-name) (url-view-url t)) link (org-make-link (url-view-url t)))
> (org-store-link-props :type "w3" :url (url-view-url t))) ((eq
> major-mode (quote w3m-mode)) (setq cpltxt (or w3m-current-title
> w3m-current-url) link (org-make-link w3m-current-url))
> (org-store-link-props :type "w3m" :url (url-view-url t))) ((setq
> search (run-hook-with-args-until-success (quote
> org-create-file-search-functions))) (setq link (concat "file:"
> (abbreviate-file-name buffer-file-name) "::" search)) (setq cpltxt (or
> description link))) ((eq major-mode (quote image-mode)) (setq cpltxt
> (concat "file:" (abbreviate-file-name buffer-file-name)) link
> (org-make-link cpltxt)) (org-store-link-props :type "image" :file
> buffer-file-name)) ((eq major-mode (quote dired-mode)) (let ((file
> (dired-get-filename nil t))) (setq file (if file (abbreviate-file-name
> ...) default-directory)) (setq cpltxt (concat "file:" file) link
> (org-make-link cpltxt)))) ((and (buffer-file-name
> (buffer-base-buffer)) (org-mode-p)) (setq custom-id (org-entry-get nil
> "CUSTOM_ID")) (cond ((org-in-regexp "<<\\(.*?\\)>>") (setq cpltxt
> (concat "file:" ... "::" ...) link (org-make-link cpltxt))) ((and
> (featurep ...) (or ... ... ... ...)) (setq link (condition-case nil
> ... ...))) (t (setq cpltxt (concat "file:" ...)) (when (org-xor
> org-context-in-file-links arg) (setq txt ...) (when ... ...)) (if
> (string-match "::\\'" cpltxt) (setq cpltxt ...)) (setq link
> (org-make-link cpltxt))))) ((buffer-file-name (buffer-base-buffer))
> (setq cpltxt (concat "file:" (abbreviate-file-name (buffer-file-name
> ...)))) (when (org-xor org-context-in-file-links arg) (setq txt (if
> (org-region-active-p) (buffer-substring ... ...) (buffer-substring
> ... ...))) (when (string-match "\\S-" txt) (setq cpltxt (concat cpltxt
> "::" ...) desc "NONE"))) (setq link (org-make-link cpltxt)))
> ((interactive-p) (error "Cannot link to a buffer which is not visiting
> a file")) (t (setq link nil))) (if (consp link) (setq cpltxt (car
> link) link (cdr link))) (setq link (or link cpltxt) desc (or desc
> cpltxt)) (if (equal desc "NONE") (setq desc nil)) (if (and (or
> (interactive-p) executing-kbd-macro) link) (progn (setq
> org-stored-links (cons (list link desc) org-stored-links)) (message
> "Stored: %s" (or desc link)) (when custom-id (setq link (concat
> "file:" (abbreviate-file-name ...) "::#" custom-id)) (setq
> org-stored-links (cons (list link desc) org-stored-links)))) (or
> agenda-link (and link (org-make-link-string link desc))))))
> (org-with-limited-levels (let (link cpltxt desc description search
> txt custom-id agenda-link) (cond ((run-hook-with-args-until-success
> (quote org-store-link-functions)) (setq link (plist-get
> org-store-link-plist :link) desc (or (plist-get org-store-link-plist
> :description) link))) ((equal (buffer-name) "*Org Edit Src Example*")
> (let (label gc) (while (or (not label) (save-excursion ...)) (when
> label (message "Label exists already") (sit-for 2)) (setq label
> (read-string "Code line label: " label))) (end-of-line 1) (setq link
> (format org-coderef-label-format label)) (setq gc (- 79 (length
> link))) (if (< (current-column) gc) (org-move-to-column gc t) (insert
> " ")) (insert link) (setq link (concat "(" label ")") desc nil)))
> ((equal (org-bound-and-true-p org-agenda-buffer-name) (buffer-name))
> (let ((m (or ... ...))) (when m (org-with-point-at m (setq agenda-link
> ...))))) ((eq major-mode (quote calendar-mode)) (let ((cd
> (calendar-cursor-to-date))) (setq link (format-time-string (car
> org-time-stamp-formats) (apply ... ...))) (org-store-link-props :type
> "calendar" :date cd))) ((eq major-mode (quote w3-mode)) (setq cpltxt
> (if (and (buffer-name) (not ...)) (buffer-name) (url-view-url t)) link
> (org-make-link (url-view-url t))) (org-store-link-props :type "w3"
> :url (url-view-url t))) ((eq major-mode (quote w3m-mode)) (setq cpltxt
> (or w3m-current-title w3m-current-url) link (org-make-link
> w3m-current-url)) (org-store-link-props :type "w3m" :url (url-view-url
> t))) ((setq search (run-hook-with-args-until-success (quote
> org-create-file-search-functions))) (setq link (concat "file:"
> (abbreviate-file-name buffer-file-name) "::" search)) (setq cpltxt (or
> description link))) ((eq major-mode (quote image-mode)) (setq cpltxt
> (concat "file:" (abbreviate-file-name buffer-file-name)) link
> (org-make-link cpltxt)) (org-store-link-props :type "image" :file
> buffer-file-name)) ((eq major-mode (quote dired-mode)) (let ((file
> (dired-get-filename nil t))) (setq file (if file (abbreviate-file-name
> ...) default-directory)) (setq cpltxt (concat "file:" file) link
> (org-make-link cpltxt)))) ((and (buffer-file-name
> (buffer-base-buffer)) (org-mode-p)) (setq custom-id (org-entry-get nil
> "CUSTOM_ID")) (cond ((org-in-regexp "<<\\(.*?\\)>>") (setq cpltxt
> (concat "file:" ... "::" ...) link (org-make-link cpltxt))) ((and
> (featurep ...) (or ... ... ... ...)) (setq link (condition-case nil
> ... ...))) (t (setq cpltxt (concat "file:" ...)) (when (org-xor
> org-context-in-file-links arg) (setq txt ...) (when ... ...)) (if
> (string-match "::\\'" cpltxt) (setq cpltxt ...)) (setq link
> (org-make-link cpltxt))))) ((buffer-file-name (buffer-base-buffer))
> (setq cpltxt (concat "file:" (abbreviate-file-name (buffer-file-name
> ...)))) (when (org-xor org-context-in-file-links arg) (setq txt (if
> (org-region-active-p) (buffer-substring ... ...) (buffer-substring
> ... ...))) (when (string-match "\\S-" txt) (setq cpltxt (concat cpltxt
> "::" ...) desc "NONE"))) (setq link (org-make-link cpltxt)))
> ((interactive-p) (error "Cannot link to a buffer which is not visiting
> a file")) (t (setq link nil))) (if (consp link) (setq cpltxt (car
> link) link (cdr link))) (setq link (or link cpltxt) desc (or desc
> cpltxt)) (if (equal desc "NONE") (setq desc nil)) (if (and (or
> (interactive-p) executing-kbd-macro) link) (progn (setq
> org-stored-links (cons (list link desc) org-stored-links)) (message
> "Stored: %s" (or desc link)) (when custom-id (setq link (concat
> "file:" (abbreviate-file-name ...) "::#" custom-id)) (setq
> org-stored-links (cons (list link desc) org-stored-links)))) (or
> agenda-link (and link (org-make-link-string link desc))))))
> org-store-link(nil)
> (if (and (boundp (quote org-capture-link-is-already-stored)) org-capture-link-is-already-stored) (plist-get org-store-link-plist :annotation) (org-store-link nil))
> (let* ((orig-buf (current-buffer)) (annotation (if (and (boundp
> (quote org-capture-link-is-already-stored))
> org-capture-link-is-already-stored) (plist-get org-store-link-plist
> :annotation) (org-store-link nil))) (initial (and
> (org-region-active-p) (buffer-substring (point) (mark)))) (entry
> (org-capture-select-template keys))) (when (stringp initial)
> (remove-text-properties 0 (length initial) (quote (read-only t))
> initial)) (when (stringp annotation) (remove-text-properties 0 (length
> annotation) (quote (read-only t)) annotation)) (cond ((equal entry
> "C") (customize-variable (quote org-capture-templates))) ((equal entry
> "q") (error "Abort")) (t (org-capture-set-plist entry)
> (org-capture-get-template) (org-capture-put :original-buffer orig-buf
> :original-file (buffer-file-name orig-buf) :original-file-nondirectory
> (and (buffer-file-name orig-buf) (file-name-nondirectory
> (buffer-file-name orig-buf))) :annotation annotation :initial initial)
> (org-capture-put :default-time (or org-overriding-default-time
> (org-current-time))) (org-capture-set-target-location) (condition-case
> error (org-capture-put :template (org-capture-fill-template)) ((error
> quit) (if (get-buffer "*Capture*") (kill-buffer "*Capture*")) (error
> "Capture abort: %s" error))) (if (equal goto 0)
> (org-capture-insert-template-here) (condition-case error
> (org-capture-place-template) ((error quit) (if (and ... ...)
> (kill-buffer ...)) (set-window-configuration (org-capture-get
> :return-to-wconf)) (error "Capture template `%s': %s" (org-capture-get
> :key) (nth 1 error)))) (if (org-capture-get :immediate-finish)
> (org-capture-finalize nil (not (org-capture-get :clock-keep))) (if
> (and (org-mode-p) (org-capture-get :clock-in)) (condition-case nil
> (progn ... ... ...) (error "Could not start the clock in this capture
> buffer"))))))))
> (cond ((equal goto (quote (4))) (org-capture-goto-target)) ((equal
> goto (quote (16))) (org-capture-goto-last-stored)) (t (let* ((orig-buf
> (current-buffer)) (annotation (if (and (boundp ...)
> org-capture-link-is-already-stored) (plist-get org-store-link-plist
> :annotation) (org-store-link nil))) (initial (and
> (org-region-active-p) (buffer-substring (point) (mark)))) (entry
> (org-capture-select-template keys))) (when (stringp initial)
> (remove-text-properties 0 (length initial) (quote (read-only t))
> initial)) (when (stringp annotation) (remove-text-properties 0 (length
> annotation) (quote (read-only t)) annotation)) (cond ((equal entry
> "C") (customize-variable (quote org-capture-templates))) ((equal entry
> "q") (error "Abort")) (t (org-capture-set-plist entry)
> (org-capture-get-template) (org-capture-put :original-buffer orig-buf
> :original-file (buffer-file-name orig-buf) :original-file-nondirectory
> (and (buffer-file-name orig-buf) (file-name-nondirectory ...))
> :annotation annotation :initial initial) (org-capture-put
> :default-time (or org-overriding-default-time (org-current-time)))
> (org-capture-set-target-location) (condition-case error
> (org-capture-put :template (org-capture-fill-template)) ((error quit)
> (if ... ...) (error "Capture abort: %s" error))) (if (equal goto 0)
> (org-capture-insert-template-here) (condition-case error
> (org-capture-place-template) (... ... ... ...)) (if (org-capture-get
> :immediate-finish) (org-capture-finalize nil ...) (if ... ...))))))))
> org-capture(nil)
> call-interactively(org-capture nil nil)
> recursive-edit()
> byte-code("\306 @\307=\203!
> --------------------Debug On Error End--------------------
>
>
> Thanks again for your time.
> Stefan
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Cannot use C-c c to capture from within some files
2011-04-19 18:13 ` Bernt Hansen
@ 2011-04-19 19:51 ` Stefan Strohmeier
0 siblings, 0 replies; 6+ messages in thread
From: Stefan Strohmeier @ 2011-04-19 19:51 UTC (permalink / raw)
To: Bernt Hansen; +Cc: emacs-orgmode
Hi Bernt,
> It looks like your capture session is trying to create a git link and
> can't find the 'git' program. I assume you are using
> contrib/org-git-link.el. I personally have no experience with this
> package.
>
You are right. For some unknown reason I enabled org-git-link in the org-modules pane. I unchecked it and now it is working fine.
Thanks for your quick help.
Stefan
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-04-19 19:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-19 16:06 Cannot use C-c c to capture from within some files Stefan Strohmeier
2011-04-19 16:38 ` Nick Dokos
2011-04-19 17:15 ` Bernt Hansen
2011-04-19 17:55 ` Stefan Strohmeier
2011-04-19 18:13 ` Bernt Hansen
2011-04-19 19:51 ` Stefan Strohmeier
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).