home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / gnu / emacs / help / 4729 < prev    next >
Encoding:
Text File  |  1992-11-08  |  1.9 KB  |  74 lines

  1. Newsgroups: gnu.emacs.help
  2. Path: sparky!uunet!stanford.edu!agate!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!uniol!Peter.Bruells
  3. From: Peter.Bruells@arbi.informatik.uni-oldenburg.de (Peter Bruells)
  4. Subject: How to properly "lookup-key" ? 
  5. Organization: University of Oldenburg, Germany
  6. Date: Sun, 8 Nov 1992 17:34:55 GMT
  7. Message-ID: <1992Nov8.173455.25287@arbi.Informatik.Uni-Oldenburg.DE>
  8. Sender: news@arbi.Informatik.Uni-Oldenburg.DE
  9. Lines: 63
  10.  
  11.  
  12. Hello...
  13.  
  14.  
  15. I have the following problem:
  16.  
  17. I defined the following two functions and bound them to ' and , to
  18. allow easier input of german quotes while in TeX-mode, while I
  19. disabled " as a special command..
  20.  
  21. (Had to, since " is a meta-char when using german.sty)
  22.  
  23.  
  24. Typing ,, produces "` and typing '' produces "', typing a printable
  25. char after a , or ' inserts the , or ' and the char.
  26.  
  27. BUT: Typing CTRL<char> inserts ^char, as if I had quoted the character.
  28.  
  29. I understand WHY this happens, but have no idea how to get rid of it. 
  30.  
  31. With (lookup-key .. .. ) I can check wether a given key ius bound to a
  32. command, self-insert-command or not bound at all, but I have NO idea
  33. how to use it.
  34.  
  35. command-execute ? execute-command ? I'm totally lost... 
  36.  
  37. Can anybode help ? 
  38.  
  39. Thanks in advance... 
  40.  
  41. (defun glatex-close ()
  42.   ""
  43.   (interactive)
  44.   (insert "'")
  45.   (setq x (read-char))
  46.   (if (eq x 39)
  47.       (progn
  48.     (delete-backward-char 1)
  49.     (insert "\"'"))
  50.     (insert x)))
  51.  
  52.  
  53. (defun glatex-open ()
  54.   ""
  55.   (interactive)
  56.   (insert ",")
  57.   (setq x (read-char))
  58.   (if (eq x 44)
  59.       (progn
  60.     (delete-backward-char 1)
  61.     (insert "\"`"))
  62.     (insert x)))
  63.  
  64.  
  65.  
  66.  
  67. (setq TeX-mode-hook
  68.     '(lambda ()
  69.        (define-key TeX-mode-map "\""    '(lambda () (interactive) (TeX-insert-quote "1")))
  70.        (define-key TeX-mode-map "\C-c>" '(lambda () (interactive) (insert "\"`")))
  71.        (define-key TeX-mode-map "\C-c<" '(lambda () (interactive) (insert "\"'")))
  72.        (define-key TeX-mode-map ","     'glatex-open)
  73.        (define-key TeX-mode-map "'"     'glatex-close)))
  74.