🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #87697

Re: (mh-comp.el) active marks that are actually nil

#87697
From: Roger Crew
Date: Fri, 02 Sep 1994 02:10
54 lines
2860 bytes
[version 19.25.94 sgi-mips-irix5.2]

I've found what I believe is the problem
and it isn't specific to mh-e:

   (set-mark nil) calls deactivate-mark, however deactivate-mark does
   (setq mark-active nil) ONLY if transient-mark-mode is non-nil.

So if mark-active happens to be t, and transient-mark-mode is nil
and one does (set-mark nil), this gets us into the forbidden state.
The comment that this only makes a difference in transient mark mode
should probably go away.  A suggested patch is below.  

Documentation for mark-marker should warn one to either set
mark-active to nil or call deactivate-mark if one is directly setting
mark-marker to nil.  Fortunately, in the only places other from
simple.el where this is happening outside of set-mark (allout.el and
sendmail.el), people seem to know about this.

If you want to see this manifest itself in mh-e, do, 
(on a fresh emacs -q making sure transient-mark-mode is off)

  M-x mh-rmail           ;
  C-u M-r last:5         ; (if you need to get it to show some headers...)
  .                      ; show a message
  C-x o C-space C-x o    ; go to the show buffer and set a mark
  p                      ; go to another message
  r sender               ; start a draft
  C-c C-y                ; try to yank


*** /usr/local/src/emacs-19/lisp/simple.el	Sun Aug  7 11:04:38 1994
--- -	Fri Aug 26 13:13:00 1994
***************
*** 1306,1315 ****
  (defsubst deactivate-mark ()
    "Deactivate the mark by setting `mark-active' to nil.
! \(That makes a difference only in Transient Mark mode.)
! Also runs the hook `deactivate-mark-hook'."
    (if transient-mark-mode
!       (progn
!         (setq mark-active nil)
!         (run-hooks 'deactivate-mark-hook))))
  
  (defun set-mark (pos)
--- 1306,1313 ----
  (defsubst deactivate-mark ()
    "Deactivate the mark by setting `mark-active' to nil.
! Also run the hook `deactivate-mark-hook' if in Transient Mark mode."
!   (setq mark-active nil)
    (if transient-mark-mode
!       (run-hooks 'deactivate-mark-hook)))
  
  (defun set-mark (pos)
Technical Details
Message-ID: <9408262020.AA08368@golem.research.microsoft.com>
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!uunet!spool.mu.edu!howland.reston.ans.net!math.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!research.microsoft.com!rfc
References: <9408260036.AA12242@alex.x.org>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,5e6a781a41d41e98
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1994-09-02 01:44:48 PST
Path: arc1-ca.pugleaf.net!bga.com!news.sprintlink.net!uunet!spool.mu.edu!howland.reston.ans.net!math.ohio-state.edu!pacific.mps.ohio-state.edu!cis.ohio-state.edu!research.microsoft.com!rfc
From: rfc@research.microsoft.com (Roger Crew)
Newsgroups: gnu.emacs.bug
Subject: Re: (mh-comp.el) active marks that are actually nil
Date: 1 Sep 1994 22:10:23 -0400
Organization: GNUs Not Usenet
Lines: 55
Sender: daemon@cis.ohio-state.edu
Approved: bug-gnu-emacs@prep.ai.mit.edu
Distribution: gnu
Message-ID: <9408262020.AA08368@golem.research.microsoft.com>
References: <9408260036.AA12242@alex.x.org>