all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: org-mode, remember
       [not found] <r4rml7xgk6.ln2@news.c0t0d0s0.de>
@ 2010-09-11 16:52 ` Michael Welle
  2010-09-11 17:35   ` Michael Welle
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Welle @ 2010-09-11 16:52 UTC (permalink / raw)
  To: help-gnu-emacs

Hello Ingrid,

changing the code as follows leads to better results:

(setq org-remember-templates
   (quote (("aaa" 116 "* %u %?" hmw-get-notes-file-name "Notes"))))

(defun hmw-get-notes-file-name ()
(let ((fname (buffer-file-name (current-buffer))))
  (if (eq fname nil)
    "~/work/ORG/nil.org"
    (if (string-match "\\.org$" fname)
      fname
       "~/work/ORG/notes1.org"))))

The remaining problem is that fname is always nil. Why?


Regards
hmw


-- 
biff4emacsen - A biff-like tool for (X)Emacs
http://www.c0t0d0s0.de/biff4emacsen/biff4emacsen.html
Flood - Your friendly network packet generator
http://www.c0t0d0s0.de/flood/flood.html


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

* Re: org-mode, remember
  2010-09-11 16:52 ` org-mode, remember Michael Welle
@ 2010-09-11 17:35   ` Michael Welle
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Welle @ 2010-09-11 17:35 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

and a last one...

The problem is that (buffer-file-name (current-buffer)) is evaluated in
the buffer that asks to choose a template. This buffer has no file
associated, so buffer-file-name is nil. The work around:

(defun hmw-remember ()
  (interactive)
  (setq org-default-notes-file (hmw-get-notes-file-name))
  (remember)
)

I first set the file name while the buffer in which I want the note to
be inserted is current. Then I evaluate (remember), which ask for a
template etc. In the template specification the filename parameter is
set to nil.

Regards
hmw

-- 
biff4emacsen - A biff-like tool for (X)Emacs
http://www.c0t0d0s0.de/biff4emacsen/biff4emacsen.html
Flood - Your friendly network packet generator
http://www.c0t0d0s0.de/flood/flood.html


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

end of thread, other threads:[~2010-09-11 17:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <r4rml7xgk6.ln2@news.c0t0d0s0.de>
2010-09-11 16:52 ` org-mode, remember Michael Welle
2010-09-11 17:35   ` Michael Welle

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.