From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jisang Yoo Subject: Re: org-kill-line Date: Sun, 28 Apr 2013 11:56:43 +0900 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:55820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWHnE-0008Qn-Kk for emacs-orgmode@gnu.org; Sat, 27 Apr 2013 22:56:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UWHnA-0005FZ-Kk for emacs-orgmode@gnu.org; Sat, 27 Apr 2013 22:56:48 -0400 Received: from mail-ob0-x236.google.com ([2607:f8b0:4003:c01::236]:61446) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UWHnA-0005F3-EL for emacs-orgmode@gnu.org; Sat, 27 Apr 2013 22:56:44 -0400 Received: by mail-ob0-f182.google.com with SMTP id dn14so4518901obc.41 for ; Sat, 27 Apr 2013 19:56:43 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Dov Grobgeld Cc: emacs-orgmode If you are referring to org-kill-line, it is indeed odd that C-k in org mode kills screen lines in visual line mode while C-k in text mode always kills logical lines. It seems temporarily turning off visual-line-mode while running the macro involving org-kill-line is a workaround. Or define a version of org-kill-line which only uses kill-line: (defun my-org-kill-logical-line (&optional arg) "Kill line, to tags or end of line." (interactive "P") (cond ((or (not org-special-ctrl-k) (bolp) (not (org-at-heading-p))) (if (and (get-char-property (min (point-max) (point-at-eol)) 'invisible) org-ctrl-k-protect-subtree) (if (or (eq org-ctrl-k-protect-subtree 'error) (not (y-or-n-p "Kill hidden subtree along with headline? "))) (user-error "C-k aborted as it would kill a hidden subtree"))) (call-interactively 'kill-line)) ((looking-at (org-re ".*?\\S-\\([ \t]+\\(:[[:alnum:]_@#%:]+:\\)\\)[ \t]*$")) (kill-region (point) (match-beginning 1)) (org-set-tags nil t)) (t (kill-region (point) (point-at-eol))))) That has just one line of difference from org-kill-line. You can then put (define-key org-mode-map (kbd "C-S-k") 'my-org-kill-logical-line) and use C-S-k in macros. > > I don't like the use of kill-visual-line in org-kill-mode as it creates > non-predictable behavior when recording keyboard macros, as the display > width will influence the result of running the macro. Does anyone have a > suggestion of how to get around this? Right now I redefined kill-visual-line > to kill-line, as I didn't want to touch the org-mode sources, but it seems > to be an overkill (pun intended :-).