emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-kill-line
@ 2013-04-26  7:39 Dov Grobgeld
  2013-04-28  2:56 ` org-kill-line Jisang Yoo
  0 siblings, 1 reply; 2+ messages in thread
From: Dov Grobgeld @ 2013-04-26  7:39 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 420 bytes --]

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 :-).

Regards,
Dov

[-- Attachment #2: Type: text/html, Size: 705 bytes --]

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

* Re: org-kill-line
  2013-04-26  7:39 org-kill-line Dov Grobgeld
@ 2013-04-28  2:56 ` Jisang Yoo
  0 siblings, 0 replies; 2+ messages in thread
From: Jisang Yoo @ 2013-04-28  2:56 UTC (permalink / raw)
  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 :-).

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

end of thread, other threads:[~2013-04-28  2:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-26  7:39 org-kill-line Dov Grobgeld
2013-04-28  2:56 ` org-kill-line Jisang Yoo

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).