all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* format-mode-line and mode-line mouse events
@ 2004-12-18  8:20 Nick Roberts
  0 siblings, 0 replies; only message in thread
From: Nick Roberts @ 2004-12-18  8:20 UTC (permalink / raw)



I want to make mouse clicks on the mode-line work properly on a text terminal
(and xterm). Currently you can only drag or delete when you click anywhere on
the mode-line as before Emacs 21. I think all that is needed for the click
event is the the string (with properties) and the column number clicked on:

OBJECT
     This is the object on which the click occurred.  It is either
     `nil' if there is no string property, or it has the form (STRING .
     STRING-POS) when there is a string-type text property at the click
     position.

I think I should be able to get this with:

((format-mode-line) . COL)

but it only works on part of the mode-line.

mode-line-format is pretty complex and I think format-mode-line expands it
incorrectly:

(format-mode-line mode-line-buffer-identification)

correctly gives:

#("*scratch*   " 0 9 (face Buffer-menu-buffer-face help-echo "mouse-1: previous buffer, mouse-3: next buffer" local-map (keymap (header-line keymap ... ... ... ...) (mode-line keymap ... ...))) 9 12 (face Buffer-menu-buffer-face help-echo "mouse-1: previous buffer, mouse-3: next buffer" local-map (keymap (header-line keymap ... ... ... ...) (mode-line keymap ... ...))))

but the part of (format-mode-line) due to mode-line-buffer-identification is:

#("-1:**  *scratch*      All L2      (Lisp Interaction)-----"... 7 16 (face (Buffer-menu-buffer-face mode-line)) ...)

The keymap has been lost and, as far as I know, 
(face (Buffer-menu-buffer-face mode-line)) means nothing.

Is that a bug? If so, can anyone see what is wrong with format-mode-line?

Should

(WINDOW mode-line (X . Y) TIMESTAMP
      ((format-mode-line) . COL) TEXT-POS (COL . ROW)
      IMAGE (DX . DY) (WIDTH . HEIGHT))

work as a click event on the mode-line?


Nick

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-12-18  8:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-18  8:20 format-mode-line and mode-line mouse events Nick Roberts

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.