emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] question about org-region-active-p


From: Carsten Dominik
Subject: Re: [Orgmode] question about org-region-active-p
Date: Tue, 16 Dec 2008 08:53:58 +0100

Hi Robert,

Samuel has it right, let me add this:

In Emacs, you do never remove the mark from the buffer, it is always there, wherever you or some command last left it. The only way to tell if the user intends to apply a command to a region is therefore the state of a flag that says if the mark is "active". Setting the mark activates the mark, most commands besides cursor motion and search deactivate it.
The state flag does only exist if transient-mark-mode is active.

- Carsten

On Dec 16, 2008, at 2:51 AM, Robert Goldman wrote:

The definition of org-region-active-p in my copy of org-mode is as follows:


(defun org-region-active-p ()
 "Is `transient-mark-mode' on and the region active?
Works on both Emacs and XEmacs."
 (if org-ignore-region
     nil
   (if (featurep 'xemacs)
        (and zmacs-regions (region-active-p))
     (if (fboundp 'use-region-p)
          (use-region-p)
        (and transient-mark-mode mark-active)))))

What seems odd to me is that this command will only work on an emacs 22 (like my Aquamacs) if transient-mark-mode is enabled. Is that correct,
and is that what's desired?

[I found this because I tried to publish a subtree of an org file, and I
found that org-region-active-p was NIL even after C-c @
(outline-mark-subtree).]

This may be an oddity of aquamacs -- it seems to prefer cua-mode and
turn off transient-mark-mode by default.  I confess to not really
understanding that decision or its implications.

thanks,
r


_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-orgmode





reply via email to

[Prev in Thread] Current Thread [Next in Thread]