Re: [O] org-kill-line

2013-04-27 Thread Jisang Yoo
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 :-).



[O] org-kill-line

2013-04-26 Thread Dov Grobgeld
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


Re: [O] org-kill-line sometimes crashes emacs

2011-04-06 Thread Thomas Jack
On Tue, Apr 5, 2011 at 8:20 PM, Nick Dokos nicholas.do...@hp.com wrote:
 Yes, I can. What version of emacs are you using?

 Mine is: GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version
 2.22.0) of 2011-03-16. I'll update

Thanks! Glad it's not just me.

I'm all the way back on GNU Emacs 23.1.1 (x86_64-pc-linux-gnu, GTK+
Version 2.22.0) of 2010-11-26 on crested, modified by Debian.

I still can't figure out the exact conditions under which it happens,
but so far I've only seen the crash when the link I'm killing is to
the target headline. That could just be a red herring...



Re: [O] org-kill-line sometimes crashes emacs

2011-04-06 Thread Nick Dokos
Thomas Jack thomasj...@gmail.com wrote:

 On Tue, Apr 5, 2011 at 8:20 PM, Nick Dokos nicholas.do...@hp.com wrote:
  Yes, I can. What version of emacs are you using?
 
  Mine is: GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version
  2.22.0) of 2011-03-16. I'll update
 
 Thanks! Glad it's not just me.

Not me: I'd be gladder if it was just you ;-)

 
 I'm all the way back on GNU Emacs 23.1.1 (x86_64-pc-linux-gnu, GTK+
 Version 2.22.0) of 2010-11-26 on crested, modified by Debian.
 

That's worse than I thought: I was hoping that it was some recent change
that might have affected only 24.0.50 and I was further hoping that it
might have been fixed by now. I'll still update one of these days and try
it again, but the hope has dimmed considerably...

 I still can't figure out the exact conditions under which it happens,
 but so far I've only seen the crash when the link I'm killing is to
 the target headline. That could just be a red herring...
 

Whatever the color of the herring, emacs should *not* crash noway, nohow :-) 

Nick



[O] org-kill-line sometimes crashes emacs

2011-04-05 Thread Thomas Jack
Steps to reproduce:

Include an entry like this in your org-capture-templates:
(t Todo entry (file+headline ~/org/gtd.org Tasks)
 * TODO %?\n  %i\n  %a)

Now, delete everything in ~/org/gtd.org except for a lone Tasks headline.

Put point on the next line, and start a capture with the template
above. Move point down to the beginning of the line with the Tasks
link, and C-k (org-kill-line).

For me, emacs crashes with Fatal error (6)Aborted. If I first modify
the link and undo the changes, there is no crash.

Can anyone else reproduce?



Re: [O] org-kill-line sometimes crashes emacs

2011-04-05 Thread Nick Dokos
Thomas Jack thomasj...@gmail.com wrote:

 Steps to reproduce:
 
 Include an entry like this in your org-capture-templates:
 (t Todo entry (file+headline ~/org/gtd.org Tasks)
  * TODO %?\n  %i\n  %a)
 
 Now, delete everything in ~/org/gtd.org except for a lone Tasks headline.
 
 Put point on the next line, and start a capture with the template
 above. Move point down to the beginning of the line with the Tasks
 link, and C-k (org-kill-line).
 
 For me, emacs crashes with Fatal error (6)Aborted. If I first modify
 the link and undo the changes, there is no crash.
 
 Can anyone else reproduce?
 

Yes, I can. What version of emacs are you using?

Mine is: GNU Emacs 24.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version
2.22.0) of 2011-03-16. I'll update 

I tried running emacs under gdb, but I cannot reproduce it in that
situation. Nasty.

Nick

PS. I tried it with the following minimal.emacs by invoking emacs like
this:

   emacs -Q -l ~/minimal.emacs

--8---cut here---start-8---
;;; constant part
(add-to-list 'load-path (expand-file-name ~/src/emacs/org/org-mode/lisp))
(add-to-list 'auto-mode-alist '(\\.\\(org\\|org_archive\\|txt\\)$ . org-mode))
(require 'org-install)
(global-set-key \C-cl 'org-store-link)
(global-set-key \C-ca 'org-agenda)

(setq org-capture-templates
'( (T Todo entry (file+headline ~/org/gtd.org Tasks) * TODO %?\n  %i\n 
 %a)))
--8---cut here---end---8---