Loading ...
Sorry, an error occurred while loading the content.

1399RE: [jasspa] mark, point, and active regions

Expand Messages
  • Schofield, Bryan (GE Trans)
    May 26, 2005
    • 0 Attachment
      I wrote the following macros that address the problem and satisfy me, I brought it up because I consider it bad behavior and to highlight a difference with Emacs.





      0 define-macro abort-if-region-not-active
      0 show-region
      !if ¬ &equ 0x05 &band $result 0x05
      ml-write "[Region is not active]"
      !abort
      !endif
      !emacro

      define-macro kill-region-safe
      abort-if-region-not-active
      !if @?
      @# kill-region
      !else
      kill-region
      !endif
      !emacro

      define-macro forward-delete-char-and-region
      !force -1 kill-region-safe
      !if @?
      @# forward-delete-char
      !else
      forward-delete-char
      !endif
      !emacro

      define-macro backward-delete-char-and-region
      !force -1 kill-region-safe
      !if @?
      @# backward-delete-char
      !else
      backward-delete-char
      !endif
      !emacro

      > -----Original Message-----
      > From: jasspa@yahoogroups.com
      > [mailto:jasspa@yahoogroups.com]On Behalf Of
      > Thomas Hundt
      > Sent: Thursday, May 26, 2005 11:44 AM
      > To: jasspa@yahoogroups.com
      > Subject: Re: [jasspa] mark, point, and active regions
      >
      >
      > Could you write a macro "my-abort-command" that first unsets
      > the mark,
      > then executes abort-command, and bind that to ^G?
      >
      > -Th
      >
      >
      >
      > > C-space (set the mark)
      > > move cursor (region highlighted between mark and point)
      > > C-g (abort, region highlight removed, mark inactive)
      >
      > > At this point any region-based function, like, kill-region,
      > > comment-region, etc., do not work.
      >
      >
      > ______________________________________________________________
      > ____________
      >
      > This is an unmoderated list. JASSPA is not responsible for
      > the content of
      > any material posted to this list.
      >
      > To unsubscribe, send a mail message to
      >
      > mailto:jasspa-unsubscribe@yahoogroups.com
      >
      > or visit http://groups.yahoo.com/group/jasspa and
      > modify your account settings manually.
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
      >
    • Show all 10 messages in this topic