Bug 75440 - transient-mark-mode harmful in XEmacs
Summary: transient-mark-mode harmful in XEmacs
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: emacs
Version: 8.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jens Petersen
QA Contact: Jay Turner
URL:
Whiteboard:
Depends On:
Blocks: 77696
TreeView+ depends on / blocked
 
Reported: 2002-10-08 16:41 UTC by Ville Skyttä
Modified: 2015-01-08 00:00 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-11-28 08:13:17 UTC


Attachments (Terms of Use)

Description Ville Skyttä 2002-10-08 16:41:34 UTC
/etc/skel/.emacs is used by both GNU Emacs and XEmacs, and it contains:

  (setq-default transient-mark-mode t)

However, transient-mark-mode has no meaning on XEmacs, and several elisp modes
use that to determine their behaviour.  For example, JDE's auto-javadoccing (C-c
C-v j) breaks with .java source files on XEmacs if transient-mark-mode is bound.

Please change that line to be skipped on XEmacs, like:

  (cond ((not running-xemacs)
         (setq-default transient-mark-mode t)
  ))

Thanks.

Comment 1 Jens Petersen 2002-10-27 15:18:00 UTC
Thanks for the report: ok, sounds like a valid point to me.

(Of course determining the flavour of emacs with transient-mark-mode
sounds like a no-no to me, but anyway...)

Comment 2 Ville Skyttä 2002-10-27 15:27:38 UTC
Actually, the (X)Emacs flavour is not detected with transient-mark-mode, but the
behaviour of the mode.  Detecting a flavour would be *bad* indeed.

But for an example, see tempo.el in XEmacs packages [1].  The code there just
seems to do the right thing, but this bug just screws it...

[1]
<http://cvs.xemacs.org/viewcvs.cgi/XEmacs/packages/xemacs-packages/edit-utils/tempo.el?rev=1.2&content-type=text/vnd.viewcvs-markup>

Comment 3 Jens Petersen 2002-10-27 16:58:21 UTC
Hmmm,

	(if (or (and (boundp 'transient-mark-mode) ; For Emacs
		     transient-mark-mode
		     mark-active)
		(and (boundp 'zmacs-regions) ; For XEmacs
		     zmacs-regions (mark)))
	    (setq on-region t))

I guess it would be better if the code additionally tested for Emacs and
XEmacs explicitly.

Comment 4 Ville Skyttä 2002-10-27 17:43:49 UTC
Maybe, until some beautiful day transient-mark-mode and friends exist in XEmacs
and zmacs-regions doesn't (unlikely), and stuff breaks again... :)  Or vice
versa for GNU Emacs.


Comment 5 Jens Petersen 2002-10-30 23:18:43 UTC
Should be fixed in the next package release.  Thanks.

Comment 6 Jens Petersen 2002-11-18 02:34:44 UTC
Forget to say the fix is in emacs-21.2-19 and later.

Comment 7 Ville Skyttä 2002-11-21 19:54:28 UTC
Just checked out emacs-21.2-20 source RPM, and it looks to me that the fix went
in upside down, it should be (notice the *not*):

(if (not running-xemacs)
    (setq-default transient-mark-mode t))


Comment 8 Jens Petersen 2002-11-22 06:26:19 UTC
Argg, thanks for spotting that. Fix should get into 21.2-22 or later.

Comment 9 Jens Petersen 2002-11-28 08:13:03 UTC
Update is in emacs-21.2-23.

Btw I'm thinking to add a ".xemacs/init.el"
skel file to the xemacs package soon.

Comment 10 Ville Skyttä 2002-12-04 18:53:55 UTC
Verified, thanks.  And .xemacs/init.el, perhaps also .xemacs/custom.el (btw, be
sure to put defcustom'able stuff into the latter) sounds like a good idea to me.


Note You need to log in before you can comment on or make changes to this bug.