Re: [O] Yank normal text as item in list

2014-10-29 Thread Igor Sosa Mayor
Teika Kazura te...@gmx.com writes:

 Hi, Igor. Below is mine. It's rudimentary, but it may help you.

thanks! I will give it a try and I let you know whether it worked for
me!

-- 
:: Igor Sosa Mayor :: joseleopoldo1...@gmail.com ::
:: GnuPG: 0x1C1E2890   :: http://www.gnupg.org/  ::
:: jabberid: rogorido  ::::




Re: [O] Yank normal text as item in list

2014-10-24 Thread Igor Sosa Mayor
Eric Abrahamsen e...@ericabrahamsen.net writes:

 I don't know what situation in particular you've got, but what often
 works for me is going to the line of the yanked text that I want to be
 the first line of a new list item, and using C-c - to explicitly
 convert it to an item. That command includes some indentation heuristics
 that, for me anyway, often creates the result I was looking for.

thanks, but I'm to able to get the behaviour I'd like to have...

-- 
:: Igor Sosa Mayor :: joseleopoldo1...@gmail.com ::
:: GnuPG: 0x1C1E2890   :: http://www.gnupg.org/  ::
:: jabberid: rogorido  ::::




Re: [O] Yank normal text as item in list

2014-10-24 Thread Teika Kazura
Hi, Igor. Below is mine. It's rudimentary, but it may help you.


(defun teika-org-yank (optional arg)
  Wrapper of `org-yank', taking care of indenting.
  (interactive)
  (let (p0 p1)
(when
(and kill-ring
 (bolp)
 (not (equal (substring-no-properties (car kill-ring) 0 1) *))
 (not (equal (buffer-substring-no-properties (point) (1+ (point))) 
* )))
  (setq p0 (point))
  (org-cycle))
(call-interactively 'org-yank)
(when p0
  (indent-region p0 (point))
  (unless (eolp)
(org-cycle)

(define-key org-mode-map \C-y 'teika-org-yank)
;; Obviously `p1' inside of `let' is not used. Sorry for bad lisp. =P

;; By the way, I have this:
(global-set-key [(shift ?\s )] 'just-one-space)
(global-set-key [(meta ?\s )] 'delete-horizontal-space)
;; You can easily press S-space and M-space with thumbs with my hack in Linux:
;; https://forums.gentoo.org/viewtopic-t-865313.html
;; (if you have a Japanese keyboard.)

;; I also bind to a key the following, a code fragment of a bigger function.
(progn
  (exchange-point-and-mark)
  (when (or (eq last-command 'yank)
(eq last-command 'yank-pop))
(just-one-space)
))
;; I.e., right after yanking, it calls `just-one-space'. Adjust to your use.

In fact, it was a surprise for me that none has answered with a nice 
implementation. Indent problem irritated me a lot.

Cheers,
Teika (Teika kazura)



Re: [O] Yank normal text as item in list

2014-10-23 Thread Rasmus
Hi,

Igor Sosa Mayor joseleopoldo1...@gmail.com writes:

 often I have to yank 'normal' text, that means, text which is not
 indented into a item of a list. In other words, maybe, to convert it
[+]
 into a list item.

 I have always the problem that, when the text over one line goes, it
 does not get the correct indentation.

 Is there maybe a magical function to get this?

 Many thanks in advance!

I usually just do M-^, `delete-indentation' and then M-q, but maybe
there's a better way.

-- 
C is for Cookie




Re: [O] Yank normal text as item in list

2014-10-23 Thread Igor Sosa Mayor
Rasmus ras...@gmx.us writes:

 I usually just do M-^, `delete-indentation' and then M-q, but maybe
 there's a better way.

thanks! I will give it a try!

-- 
:: Igor Sosa Mayor :: joseleopoldo1...@gmail.com ::
:: GnuPG: 0x1C1E2890   :: http://www.gnupg.org/  ::
:: jabberid: rogorido  ::::




Re: [O] Yank normal text as item in list

2014-10-23 Thread Alexander Baier
On 2014-10-23 12:02 Igor Sosa Mayor wrote:
 Hi,

 often I have to yank 'normal' text, that means, text which is not
 indented into a item of a list. In other words, maybe, to convert it
 into a list item.

 I have always the problem that, when the text over one line goes, it
 does not get the correct indentation.

 Is there maybe a magical function to get this?

 Many thanks in advance!

What is wrong with fill-paragraph (bound to M-q by default)?

HTH,
-- 
Alexander Baier



Re: [O] Yank normal text as item in list

2014-10-23 Thread Igor Sosa Mayor
Alexander Baier alexander.ba...@mailbox.org writes:

 What is wrong with fill-paragraph (bound to M-q by default)?

nothing, just that it does not do with I want. It works if a yank/paste
something which is pasted as a long line. But if I copy/yank text which
is already wrapped, the list identation is not kept and the item is not
really an item (only maybe the first line).

thanks in any case for your answer!


-- 
:: Igor Sosa Mayor :: joseleopoldo1...@gmail.com ::
:: GnuPG: 0x1C1E2890   :: http://www.gnupg.org/  ::
:: jabberid: rogorido  ::::




Re: [O] Yank normal text as item in list

2014-10-23 Thread Eric Abrahamsen
Igor Sosa Mayor joseleopoldo1...@gmail.com writes:

 Hi,

 often I have to yank 'normal' text, that means, text which is not
 indented into a item of a list. In other words, maybe, to convert it
 into a list item.

 I have always the problem that, when the text over one line goes, it
 does not get the correct indentation.

 Is there maybe a magical function to get this?

 Many thanks in advance!

I don't know what situation in particular you've got, but what often
works for me is going to the line of the yanked text that I want to be
the first line of a new list item, and using C-c - to explicitly
convert it to an item. That command includes some indentation heuristics
that, for me anyway, often creates the result I was looking for.