unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Calling 'org-babel-mark-block' with 'M-x cmd' and 'M-: (cmd)'
@ 2013-02-15 13:55 Thorsten Jolitz
  2013-02-15 15:21 ` Xue Fuqiao
  0 siblings, 1 reply; 3+ messages in thread
From: Thorsten Jolitz @ 2013-02-15 13:55 UTC (permalink / raw)
  To: emacs-devel


Hi List, 

this was posted and discussed on the Org-mode mailing list, but without
any real conclusion if it is a Bug in Emacs - or something else. So it
was suggested to repost it here. 

Say point is behind the closing parenthesis of the sexp in this Org-mode source
block:

,-------------------------------------
| #+begin_src emacs-lisp
| (+ 3 4)          # point behind sexp
| #+end_src
`-------------------------------------

Now, when I call

,-----------------------------
| M-x org-babel-mark-block RET
`-----------------------------

or

,-------------------------
| M-x org-mark-element RET
`-------------------------

the body of the source block (or the whole source-block) is (visibly)
marked as expected (transient-mark-mode is on), and 'M-w' puts the
active region into the kill-ring. 

But with the point at the same position, doing

,-----------------------------
| M-: (org-babel-mark-block) RET
`-----------------------------

or

,-------------------------
| M-: (org-mark-element) RET
`-------------------------

moves point to the beginning of source-block (body) and returns the
position of point without (visibly) marking the source-block body.
There is no region activated, 'M-w' puts nothing in the kill-ring. 

-- 
cheers,
Thorsten





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

* Re: Calling 'org-babel-mark-block' with 'M-x cmd' and 'M-: (cmd)'
  2013-02-15 13:55 Calling 'org-babel-mark-block' with 'M-x cmd' and 'M-: (cmd)' Thorsten Jolitz
@ 2013-02-15 15:21 ` Xue Fuqiao
  2013-02-15 16:53   ` Thorsten Jolitz
  0 siblings, 1 reply; 3+ messages in thread
From: Xue Fuqiao @ 2013-02-15 15:21 UTC (permalink / raw)
  To: Thorsten Jolitz; +Cc: emacs-devel

On Fri, 15 Feb 2013 14:55:01 +0100
Thorsten Jolitz <tjolitz@gmail.com> wrote:

> this was posted and discussed on the Org-mode mailing list, but without
> any real conclusion if it is a Bug in Emacs - or something else. So it
> was suggested to repost it here. 
> Say point is behind the closing parenthesis of the sexp in this Org-mode source
> block:
> ,-------------------------------------
> | #+begin_src emacs-lisp
> | (+ 3 4)          # point behind sexp
> | #+end_src
> `-------------------------------------
> Now, when I call
> ,-----------------------------
> | M-x org-babel-mark-block RET
> `-----------------------------
> or
> ,-------------------------
> | M-x org-mark-element RET
> `-------------------------
> the body of the source block (or the whole source-block) is (visibly)
> marked as expected (transient-mark-mode is on), and 'M-w' puts the
> active region into the kill-ring. 
> But with the point at the same position, doing
> ,-----------------------------
> | M-: (org-babel-mark-block) RET
> `-----------------------------
> or
> ,-------------------------
> | M-: (org-mark-element) RET
> `-------------------------
> moves point to the beginning of source-block (body) and returns the
> position of point without (visibly) marking the source-block body.
> There is no region activated, 'M-w' puts nothing in the kill-ring. 

You probably should not use this function in Lisp programs;
it is usually a mistake for a Lisp function to use any subroutine
that uses or sets the mark.


> cheers,
> Thorsten

-- 
Best regards, Xue Fuqiao.
http://www.emacswiki.org/emacs/XueFuqiao



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

* Re: Calling 'org-babel-mark-block' with 'M-x cmd' and 'M-: (cmd)'
  2013-02-15 15:21 ` Xue Fuqiao
@ 2013-02-15 16:53   ` Thorsten Jolitz
  0 siblings, 0 replies; 3+ messages in thread
From: Thorsten Jolitz @ 2013-02-15 16:53 UTC (permalink / raw)
  To: emacs-devel

Xue Fuqiao <xfq.free@gmail.com> writes:

>> ,-----------------------------
>> | M-: (org-babel-mark-block) RET
>> `-----------------------------
>> or
>> ,-------------------------
>> | M-: (org-mark-element) RET
>> `-------------------------

> You probably should not use this function in Lisp programs;
> it is usually a mistake for a Lisp function to use any subroutine
> that uses or sets the mark.

OK, I see, thanks. 

-- 
cheers,
Thorsten




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

end of thread, other threads:[~2013-02-15 16:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-15 13:55 Calling 'org-babel-mark-block' with 'M-x cmd' and 'M-: (cmd)' Thorsten Jolitz
2013-02-15 15:21 ` Xue Fuqiao
2013-02-15 16:53   ` Thorsten Jolitz

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).