🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.emacs
Article #3635

Re: demacs and execution problems

#3635
From: Meinhard E. Mayer (Hardy)
Date: Wed, 13 Jan 1993 04:49
98 lines
4617 bytes
In article <738@mem.lax.pe-nelson.com> milt@lax.pe-nelson.com (Milt Ratcliff) writes:


   2. In DOS when I run demacs, I have NO delete key.  Neither the backspace
   nor the delete key works.  How do I get the backspace key to delete 
   characters?

Try loading bobcat.el (which interchanges backspace and delete) or 
swap-bsdel.el (the former comes with demacs, the latter follows):
;Article 1126 of gnu.emacs:
;Path: ark1!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!rpi!netserv2!deven
;From deven@rpi.edu (Deven T. Corzine)
;Newsgroups: gnu.emacs
;Subject: Re: how to use emacs with 'backspace' as 'delete'
;Message-ID: <DEVEN.90Feb9200209@netserv2.rpi.edu>
;Date: 10 Feb 90 01:01:42 GMT
;References: <7813@chaph.usc.edu> <1990Feb3.183918.17186@eagle.lerc.nasa.gov>
;Organization: Rensselaer Polytechnic Institute, Troy, NY
;Lines: 69
;In-Reply-To: mikef@sarah.lerc.nasa.gov's message of 3 Feb 90 18:39:18 GMT
;
;
;On 3 Feb 90 18:39:18 GMT, mikef@sarah.lerc.nasa.gov (Mike J. Fuller) said:
;
;mikef> I'm posting this because I have seen more than a few requests
;mikef> for this recently.  Just put this in your .emacs file:
;
;mikef> (progn
;mikef>   (setq keyboard-translate-table (make-string 128 0))
;mikef>   (let ((i 0))
;mikef>     (while (< i 128)
;mikef>       (aset keyboard-translate-table i i)
;mikef>       (setq i (1+ i)))))
;mikef> (aset keyboard-translate-table ?\^? ?\^h)
;mikef> (aset keyboard-translate-table ?\^h ?\^?)
;
;This seems to be the solution everyone has posted.  I wrote a somewhat
;more extensive function, which is intended to work even if
;keyboard-translate-table already exists, and it swaps the real
;bindings of backspace and delete, not hardcoding the real values.
;Also, the function can be called interactively to swap the keys at any
;time, and can be called noninteractively, forcing swapped or unswapped.
;(When forcing one or the other mapping, it does use hardcoded bs or
;del chars instead of what's in their positions in the current
;keyboard-translate-table.
;
;Here is the function:

(defun swap-bs-del (&optional arg)
  "Accepts single optional argument.  If no argument, or nil, swaps values
for backspace and delete keys in keybpoard-translate-table, initializing
table if necessary.  If arg is t or an integer greater than 0, forces a
mapping of bs->del and del->bs.  Any other argument forces untranslated
mapping of bs->bs and del->del."
  (interactive)
  ;; initialize keyboard-translate-table
  (if (not keyboard-translate-table)
      (setq keyboard-translate-table ""))
  (let ((char (length keyboard-translate-table)))
    (while (< char 128)
      (setq keyboard-translate-table
            (concat keyboard-translate-table (char-to-string char))
            char (1+ char))))
  ;; check arg
  (if (not arg)
      ;; no arg or nil, swap backspace and delete
      (let ((bs (aref keyboard-translate-table 8))
            (del (aref keyboard-translate-table 127)))
        (aset keyboard-translate-table 8 del)
        (aset keyboard-translate-table 127 bs))
    ;; argument given
    (if (or (eq arg t)
            (and (integerp arg)
                 (> arg 0)))
        ;; t or integer greater than zero, force bs->del, del->bs
        (progn
          (aset keyboard-translate-table 127 8)
          (aset keyboard-translate-table 8 127))
      ;; other argument, force untranslated bs->bs, del->del
      (aset keyboard-translate-table 8 8)
      (aset keyboard-translate-table 127 127))))

;Enjoy!
;
;Deven
;-- 
;Deven T. Corzine        Internet:  deven@rpi.edu, shadow@pawl.rpi.edu
;Snail:  2151 12th St. Apt. 4, Troy, NY 12180   Phone:  (518) 274-0327
;Bitnet:  deven@rpitsmts, userfxb6@rpitsmts     UUCP:  uunet!rpi!deven
;Simple things should be simple and complex things should be possible.


--
Hardy 
-----
Meinhard E. Mayer,  Department of Physics, UC Irvine 
e-mail: hardy@golem.ps.uci.edu (preferred) or MMAYER@UCI.BITNET
!!!! NO NEXTMAIL TO THESE ADDRESSES, PLEASE !!!!!
Technical Details
Message-ID: <HARDY.93Jan12204918@golem.ps.uci.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!howland.reston.ans.net!usc!news.service.uci.edu!hardy
References: <738@mem.lax.pe-nelson.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!howland.reston.ans.net!usc!news.service.uci.edu!hardy
From: hardy@golem.ps.uci.edu (Meinhard E. Mayer (Hardy))
Subject: Re: demacs and execution problems
Nntp-Posting-Host: golem.ps.uci.edu
Message-ID: <HARDY.93Jan12204918@golem.ps.uci.edu>
In-reply-to: milt@lax.pe-nelson.com's message of 11 Jan 93 22:20:22 GMT
Newsgroups: comp.emacs
Organization: Department of Physics, UC Irvine, CA 92717-4575, USA
Lines: 98
References: <738@mem.lax.pe-nelson.com>
Date: 13 Jan 93 04:49:22 GMT