xwem-devel
[Top] [All Lists]

Still having key binding problems

From: Steve Youngs <steve@xxxxxxxx>
Subject: Still having key binding problems
Date: Mon, 14 Feb 2005 16:48:18 +1000
Organization: The XWEM Project
User-agent: Gnus/5.110003 (No Gnus v0.3) SXEmacs/22.1.2 (Audi, linux)
Consider this code that I have in my xwemrc.el...

;:*=======================
;:* Vertical Bar
;; Sometimes it is good to have a visual indicator that your lines of
;; code are just way too long.
(defvar sy-xwem-vline-win nil)
(define-xwem-command sy-xwem-set-vline (&optional column colour)
  "Setup one-pixel wide vertical line at COLUMN.
    
COLOUR is vline colour default \"red\".
Default COLUMN is value of `fill-column'."
  (xwem-interactive 
   (list (or (and xwem-prefix-arg (prefix-numeric-value xwem-prefix-arg))
             fill-column)))
  (unless colour
    (setq colour "red"))
    
  (let (cxwin)
    (setq cxwin
          (X-Win-find-or-make
           (xwem-dpy)
           (float
            (string-to-int (frame-property (selected-frame) 'window-id)))))
    (when (X-Win-p sy-xwem-vline-win)
      (XDestroyWindow (xwem-dpy) sy-xwem-vline-win)
      (setq sy-xwem-vline-win nil))
    (when (> column 0)
      (setq
       sy-xwem-vline-win
       (XCreateWindow
        (xwem-dpy) cxwin
        (+ (frame-property (selected-frame) 'internal-border-width)
           (* (font-width (face-font 'default)) column))
        0 1
        (* (frame-height (selected-frame))
           (font-height (face-font 'default)))
        0 nil nil nil
        (make-X-Attr :background-pixel
                     (XAllocNamedColor
                      (xwem-dpy) (XDefaultColormap (xwem-dpy)) colour))))
      (XMapWindow (xwem-dpy) sy-xwem-vline-win))))

(define-xwem-command sy-xwem-unset-vline ()
  "*Turn off the vertical line created by `sy-xwem-set-vline'.

This works by side-effect of setting the vertical line to column zero."
  (xwem-interactive)
  (sy-xwem-set-vline 0))
    
(define-key xwem-global-map (xwem-kbd "H-c m V") 'sy-xwem-set-vline)
(define-key xwem-global-map (xwem-kbd "H-c m v") 'sy-xwem-unset-vline)

  M-x sy-xwem-set-vline RET   -- works fine.
  M-x sy-xwem-unset-vline RET -- works fine.
  H-c m V                     -- does nothing.
  H-c m v                     -- works fine.

,----[ H-h k H-c m V ]
| H-c m V runs `sy-xwem-set-vline'
| 
| `sy-xwem-set-vline' is an interactive Lisp function
|   -- loaded from "/home/steve/.xwem/xwemrc.el"
| (sy-xwem-set-vline &optional COLUMN COLOUR)
| 
| Documentation:
| Setup one-pixel wide vertical line at COLUMN.
|     
| COLOUR is vline colour default "red".
| Default COLUMN is value of `fill-column'.
`----

,----[ H-h k H-c m v ]
| H-c m v runs `sy-xwem-unset-vline'
| 
| `sy-xwem-unset-vline' is an interactive Lisp function
|   -- loaded from "/home/steve/.xwem/xwemrc.el"
| (sy-xwem-unset-vline)
| 
| Documentation:
| *Turn off the vertical line created by `sy-xwem-set-vline'.
| 
| This works by side-effect of setting the vertical line to column zero.
`----

This problem isn't new to patch-21.  I'm pretty sure it was introduced
with patch-19.

-- 
|---<Steve Youngs>---------------<GnuPG KeyID: A94B3003>---|
|                        In space,                         |
|             No one can hear you rip a stinky             |
|---------------------------------------<steve@xxxxxxxx>---|

Attachment: pgpz2LCE7ACIU.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>