Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 677826 - app-editors/emacs-26.1-r3 - emacsclient: bar menu not accessible by mouse
Summary: app-editors/emacs-26.1-r3 - emacsclient: bar menu not accessible by mouse
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: GNU Emacs project
Depends on:
Reported: 2019-02-12 20:04 UTC by CaptainBlood
Modified: 2024-02-21 13:14 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description CaptainBlood 2019-02-12 20:04:07 UTC
eix  emacs -I
[I] app-editors/emacs
     Available versions:  
     (18)   18.59-r12
     (23)   23.4-r18
     (24)   24.5-r5 24.5-r7
     (25)   25.3-r4 25.3-r6
     (26)   26.1-r1 26.1-r3
       {X Xaw3d acl alsa aqua athena cairo dbus dynamic-loading games gconf gfile gif gpm gsettings gtk gtk2 +gtk3 gzip-el imagemagick +inotify jpeg kerberos lcms libxml2 livecd m17n-lib mailutils motif png selinux sound source ssl svg systemd +threads tiff toolkit-scroll-bars wide-int xft +xpm xwidgets zlib ABI_X86="x32"}
     Installed versions:  26.1-r3(26)(20:28:31 12/02/2019)(X gpm gzip-el sound toolkit-scroll-bars xft xpm -Xaw3d -acl -alsa -aqua -athena -cairo -dbus -dynamic-loading -games -gconf -gfile -gif -gsettings -gtk -gtk2 -imagemagick -inotify -jpeg -kerberos -lcms -libxml2 -livecd -m17n-lib -mailutils -motif -png -selinux -source -ssl -svg -systemd -threads -tiff -wide-int -xwidgets -zlib)
     Description:         The extensible, customizable, self-documenting real-time display editor

[I] app-emacs/emacs-common-gentoo
     Available versions:  1.6-r1 {X games}
     Installed versions:  1.6-r1(02:04:23 20/06/2018)(X -games)
     Description:         Common files needed by all GNU Emacs versions

[I] app-emacs/emacs-daemon
     Available versions:  0.22
     Installed versions:  0.22(03:34:33 29/01/2019)
     Description:         Gentoo support for Emacs running as a server in the background

[I] app-eselect/eselect-emacs
     Available versions:  1.18
     Installed versions:  1.18(03:38:32 29/01/2019)
     Description:         Manage multiple Emacs versions on one system

[I] virtual/emacs
     Available versions:  23 24 25 26
     Installed versions:  26(20:28:44 12/02/2019)
     Description:         Virtual for GNU Emacs

cat /home/user/.emacs

;; Added by Package.el.  This must come before configurations of
;; installed packages.  Don't delete this line.  If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.

 (set-background-color "black")
 (set-face-background 'default "black")
 (set-face-background 'region "black")
 (set-face-foreground 'default "white")
 (set-face-foreground 'region "gray60")
 (set-foreground-color "white")
 (set-cursor-color "red")

(setq make-backup-files nil) ; stop creating backup~ files
(setq auto-save-default nil) ; stop creating #autosave# files

 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(gpm-mouse-mode t))

 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.

Manual foreground start in debug mode:

emacs -u user -chdir /home/user --fg-daemon=emacs.user --debug-init
Loading t-mouse...
Loading t-mouse...done
Error setting gpm-mouse-mode: (error Gpm-mouse only works in the GNU/Linux console)
Starting Emacs daemon.
(What I expect from gpm-mouse-mode is to have a clickable bar menu)

Meanwhile lauching a standalone emacs for the same account and ini file
the bar menu is clickable

Sorry for this long post, hoping it doesn't sound too silly.
Comment 1 Ulrich Müller gentoo-dev 2019-02-14 17:54:42 UTC
The error message is output in function gpm-mouse-start in term.c:

DEFUN ("gpm-mouse-start", Fgpm_mouse_start, Sgpm_mouse_start,
       0, 0, 0,
       doc: /* Open a connection to Gpm.
Gpm-mouse can only be activated for one tty at a time.  */)
  struct frame *f = SELECTED_FRAME ();
  struct tty_display_info *tty
    = ((f)->output_method == output_termcap
       ? (f)->terminal->display_info.tty : NULL);
  Gpm_Connect connection;

  if (!tty)
    error ("Gpm-mouse only works in the GNU/Linux console");

Debugging with gdb shows that when connected with emacsclient, (f)->output_method is output_initial, while with a standalone Emacs it is output_termcap.

Not sure if the conditional should be changed (to test for output_termcap or output_initial), or if the value of (f)->output_method is wrong. So it might be best if you report the issue upstream.
Comment 2 CaptainBlood 2019-02-26 00:57:48 UTC
I send a bug upstream, mentionning this bug thread url.
I'm not sure they read it.

Their current proposal is to use:

(add-hook 'after-make-frame-functions

which I did the best I could, but it gave identical result.

In the mean time I wondered one thing as here rc-update resturns:

            emacs.user |      default                           
           emacs.root |      default                           

II can't retrieve where I got this setting from, but could changing default to boot make any difference?
Comment 3 CaptainBlood 2019-02-26 01:20:52 UTC
moreover, emacsclient from a xorg terminal .emacs requires:

;; the two lines seems required from a xterminal.
'(gpm-mouse-mode t)
'(xterm-mouse-mode t))

Please note behavior isn't the same as standalone emacs, as it open a help buffer, but at least mouse intercation is there!
Comment 4 Ulrich Müller gentoo-dev 2024-02-21 13:14:20 UTC
Is this still a problem in Emacs 29.2?