all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Good Bad <nbko3@yahoo.com>
To: Emacs Org-mode <emacs-orgmode@gnu.org>
Subject: something odd with org-remember-mode and kill-ring-save
Date: Sat, 5 Dec 2009 06:40:46 -0800 (PST)	[thread overview]
Message-ID: <109899.17894.qm@web45104.mail.sp1.yahoo.com> (raw)

I made a wrapped version of org-remember-kill which saves the remember content to the kill ring and then calls the original org-remember-kill.  It works as I expect in most cases but not always.

First, the relevant elisp code is:

(define-key global-map "\C-cr" 'org-remember)
(defun org-remember-kill-my ()
  (interactive)
  (unless org-remember-mode
    (error "This does not seem to be a remember buffer for Org-mode"))
  (let ((beg (point-min)) 
	(case-fold-search t))
    (beginning-of-buffer)
    (search-forward-regexp "^* " nil t)
    (setq beg (or (match-end 0) beg))
    (goto-char (point-max))
    (skip-chars-backward " \n\r\t")
    (copy-region-as-kill beg (point))
    )
  (org-remember-kill))
(eval-after-load "org-remember" 
		 '(define-key org-remember-mode-map (kbd "C-c r") 'org-remember-kill-my))
(eval-after-load "org-remember" 
		 '(define-key org-remember-mode-map (kbd "C-c C-k") 'org-remember-kill-my))


When I bring up remember window and then writes "one two three" (without quotes), and 
kills one word (by pressing <C-backspace>, which calls backward-kill-word) and press 
C-c C-k or C-c r (which calls the wrapper org-remember-kill-my, then the saved content 
is not "one two ", it's "threeone two". 

The odd thing doesn't happen if I call my wrapper function with M-x, or if I move my cursor
after <C-backspace> and before pressing C-c C-k or C-c r.

It's as if the append-next-kill command is being called somewhere. 
How should I fix my wrapper?


      

             reply	other threads:[~2009-12-05 14:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-05 14:40 Good Bad [this message]
2009-12-17  7:42 ` something odd with org-remember-mode and kill-ring-save Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=109899.17894.qm@web45104.mail.sp1.yahoo.com \
    --to=nbko3@yahoo.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.