Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!lll-tis!ames!husc6!rutgers!super.upenn.edu!grasp.cis.upenn.edu!shirono From: shirono@grasp.cis.upenn.edu (Roberto Shironoshita) Newsgroups: comp.emacs Subject: Re: GNU Emacs TeX-mode slashes and backslashes Message-ID: <3223@super.upenn.edu> Date: 31 Jan 88 23:47:44 GMT References: <735@entropy.ms.washington.edu> Sender: news@super.upenn.edu Reply-To: shirono@grasp.cis.upenn.edu (Roberto Shironoshita) Distribution: na Organization: University of Pennsylvania Lines: 46 Keywords: TeX-mode In article <735@entropy.ms.washington.edu> lind@entropy.ms.washington.edu (Doug Lind) writes: > To Make Typing Backslashes In Tex-Mode Easier, I Have > Redefined The Slash Key ("/") To Type A Backslash Using The > Following Line In Tex-Mode.El: > > (Define-Key Tex-Mode-Map "/" 'Backslash) > > Where 'Backslash Is Defined By (Fset 'Backslash "\\"). This > Works Fine. But Trying To Define A Key To Insert A Slash > Is A Problem. Doing The Obvious Either Leads To Some Sort > Infinite Regress Error, Or Printing A Backslash, Not A > Slash. Any Gnu Emacs Wizards Out There With The (Un- > Doubtedly Simple) Solution? I like this implementation better (why not, I wrote it myself ;-). (define-key TeX-mode-map "/" 'TeX-insert-backslash) (define-key TeX-mode-map "\\" 'TeX-insert-slash) (defun TeX-insert-backslash () "Insert a \\" (interactive) (insert "\\") ) (defun TeX-insert-slash () "Insert a /" (interactive) (insert "/") ) Roberto Shironoshita ----------------------------------------------------------------------- Disclaimer 1: The opinions expressed here are my own. The University need not share them, or even be aware of them. Disclaimer 2: Like most humans, I'm bound to err at times. I believe what I have said, but agree that I may be wrong. @@@@@@@@@\ Full Name: Roberto Shironoshita @@ @@ Occupation: BSE candidate in Computer Science @@ @@ Organization: University of Pennsylvania @@@@@@@@/ @@ Network Address: @@ PENNnet: shirono@eniac.seas @@@@ Internet: shirono@eniac.seas.upenn.edu