I’m on opensuse tumbleweed, and today after updating my packages, I can’t use emacs. Anyone have any ideas how to troubleshoot this?

 emacs -Q
Loading loadup.el (source)...
Dump mode: nil
Using load-path (/usr/share/emacs/29.1/lisp /usr/share/emacs/29.1/lisp/emacs-lisp /usr/share/emacs/29.1/lisp/progmodes /usr/share/emacs/29.1/lisp/language /usr/share/emacs/29.1/lisp/international /usr/share/emacs/29.1/lisp/textmodes /usr/share/emacs/29.1/lisp/vc)
Loading emacs-lisp/debug-early...
Symbol's function definition is void: file-name-sans-extension

  • donio@lemmy.world
    link
    fedilink
    arrow-up
    5
    ·
    edit-2
    1 year ago

    That looks as if you are running a pre-dump Emacs executable.

    One step of the Emacs build process is to load up the elisp files that are required for a basic Emacs session and dump an image with these files pre-loaded. This is speeds up the startup process. The Emacs executable that is used for this pre-loading is normally called temacs. You don’t normally run this executable, it’s only used during the build process. The message you posted looks as if the emacs command is running this temacs executable rather than the normal post-dump one.

    I’d try to make sure that this emacs executable you are running is actually the one from the current Emacs installation and not some old binary (perhaps executed through an alias or symlink?).

    • joby@programming.devOP
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      Thanks, I’ll try and look for that when I get the chance. I got called away from the computer right after making my post

    • joby@programming.devOP
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      I started by checking emacs --version and confirming that it reported 29.1. The file at which emacs (/usr/bin/emacs) is not a symlink, it’s a bash script that was ultimately running emacs-gtk, which is a binary in the same directory.

      If I run emacs-gtk directly, things appear to work, but I get this warning:

      (emacs-gtk:15168): dbind-WARNING **: 11:28:59.261: AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
      

      This appears to be related to screen reader support. My repos do have packages for at-spi, but I don’t reckon that hiding a warning I might see once per reboot is a strong enough reason to install it.

      If I run emacs-x11 directly, things seem to work, though if I turn on menu-bar-mode or check the menu with F10 it looks awful.

      If I set and export EMACS_TOOLKIT to x11 and run the bash script, it seems to take longer to load and spams hundreds of lines in the shell as it announces that it’s loading things. I’m not that bothered by long loading times as I’m seldom restarting, but I don’t know why it’s so spammy when I start it through the script.

      I’d like to better understand what’s going on. For now, I think I have a working setup again if I just skip the script and run emacs-gtk directly, but I’m sure there’s something wrong with my setup, and I hate not knowing things. I’ll include the bash script in a reply to myself here.

      • joby@programming.devOP
        link
        fedilink
        arrow-up
        2
        ·
        1 year ago
        #!/bin/bash
        #
        # Launch a GNU Emacs
        #
        # The environment variable EMACS_TOOLKIT is used to determine
        # the prefered GUI. Possible values/types of EMACS_TOOLKIT are
        #
        #   nox -- for pure console based GNU Emacs 
        #   gtk -- for full GTK2/3  based GNU Emacs
        #   x11 -- for full LUCID   based GNU Emacs (used Xaw3d)
        #
        # Should work but remember history
        #   bnc#345669 -- Emacs doesn't un-maximize in KDE/KWin
        #   bnc#342385 -- Emacs doesn't keep the iconic information in KDE/KWin
        #
        # if test -z "$EMACS_TOOLKIT" ; then
        #     EMACS_TOOLKIT=gtk
        #     KDE_FULL_SESSION=$(xprop -root KDE_FULL_SESSION 2>/dev/null)
        #     case "$KDE_FULL_SESSION" in
        #     *true*) EMACS_TOOLKIT=x11
        #     esac
        # fi
        #
        : ${EMACS_TOOLKIT:=gtk}
        #
        # Enabled again
        #
        if test "$EMACS_TOOLKIT" = gtk; then
            # Currently (2013/05/24) the parser of the GNOME libs
            # are broken that is it is not independent from locale
            LC_NUMERIC=POSIX
            GDK_RGBA=0
            export LC_NUMERIC GDK_RGBA
        fi
        arg0=$0
        argv=("$@")
        if   test -x ${arg0}-${EMACS_TOOLKIT}
        then
            set --   ${arg0}-${EMACS_TOOLKIT}
        elif test -x ${arg0}-x11
        then
            set --   ${arg0}-x11
        elif test -x ${arg0}-nox
        then
            set --   ${arg0}-nox
        else
            echo "no emacs binary found"
            exit 1
        fi
        if [[ "$1" =~ .*-nox ]] ; then
            exec -a $arg0 ${1+"$@"} "${argv[@]}"
        fi
        dbusdaemon=$(type -p dbus-daemon 2>/dev/null)
        #
        # Now check for valid dbus, e.g. after su/sudo/slogin
        #
        if test -n "$dbusdaemon" ; then
            #
            # Workaround for boo#1205109
            #
            if test "$EUID" = 0 -a "$XDG_RUNTIME_DIR" != /run/user/0; then
        	unset XDG_CONFIG_HOME XDG_CACHE_HOME XDG_DESKTOP_DIR XDG_RUNTIME_DIR XDG_DATA_DIRS
        #	unset DBUS_SESSION_BUS_ADDRESS
        	if test ! -d /run/user/0; then 
        	    systemctl start user@0 >/dev/null 2>&1
        	fi
        	if test -S /run/user/0/bus; then
        	    DBUS_SESSION_BUS_ADDRESS=unix:/run/user/0/bus
        	fi
            fi
        
            # Standard on modern systems
            : ${XDG_RUNTIME_DIR:=/run/user/${EUID}}
            export XDG_RUNTIME_DIR
        
            # Oops ... no dbus-daemon then launch a new session
            if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
        	dbuslaunch=$(type -p dbus-launch 2>/dev/null)
        	dbusession=$(type -p dbus-run-session 2>/dev/null)
        	if test -z "$dbusession" -a -n "$dbuslaunch" ; then
        	    set -- $dbuslaunch --sh-syntax --close-stderr --exit-with-session ${1+"$@"}
        	    arg0=$dbuslaunch
        	elif test -n "$dbusession" ; then
        	    set -- $dbusession -- ${1+"$@"}
        	    arg0=$dbusession
        	else
        	    arg0=emacs
        	fi
            elif test -S "${XDG_RUNTIME_DIR}/bus" ; then
        	dbusupdate=$(type -p dbus-update-activation-environment 2>/dev/null)
        	dbusstatus=$(systemctl --user is-active dbus.service 2>/dev/null)
        	if test -n "$dbusupdate" -a "$dbusstatus" != active ; then
        	    export DBUS_SESSION_BUS_ADDRESS="unix:path=${XDG_RUNTIME_DIR}/bus"
        	    $dbusupdate --systemd "DBUS_SESSION_BUS_ADDRESS"
                fi
            fi
            unset dbuslaunch dbusdaemon
        fi
        #
        # Disable AT bridge if not accessible
        #
        if test -z "$NO_AT_BRIDGE" ; then
            gsettings=$(gsettings get org.gnome.desktop.interface toolkit-accessibility 2>/dev/null)
            if test -z "$gsettings" -o "$gsettings" = false ; then
        	NO_AT_BRIDGE=1
        	export NO_AT_BRIDGE
            fi
            unset gsettings
        fi
        #
        # Check input method for working ibus setup
        #
        case "$XMODIFIERS" in
        @im=ibus*)
            _arch=$(getconf LONG_BIT)
            if test "$_arch" != 64
            then
        	unset _arch
            else
        	_arch=-64
            fi
            if type -p gtk-query-immodules-3.0${_arch} &> /dev/null
            then
        	_ibus=$(gtk-query-immodules-3.0${_arch} | grep im-ibus)
            else
        	unset _ibus
            fi
            if test -n "$_ibus"
            then
        	if test -z "$GTK_IM_MODULE" -o "$GTK_IM_MODULE" != ibus
        	then
        	    export GTK_IM_MODULE=ibus
        	fi
            else
        	unset XMODIFIERS
            fi
            unset _ibus _arch
            if ! ibus list-engine &> /dev/null
            then
        	unset GTK_IM_MODULE XMODIFIERS
            fi
            ;;
        *)
        esac
        unset G_MESSAGES_DEBUG G_DEBUG G_MESSAGES_PREFIXED
        exec -a $arg0 ${1+"$@"} "${argv[@]}"
        
        • donio@lemmy.world
          link
          fedilink
          arrow-up
          2
          ·
          1 year ago

          According to the other thread and a Mastodon post the package is broken.
          As a side note for me Emacs is just too important to leave to the distribution, I always build my own.

          • joby@programming.devOP
            link
            fedilink
            arrow-up
            2
            ·
            1 year ago

            Yeah… I may have to do the same. I had plans this weekend that this slowed down. Thanks for your help. I hadn’t seen the other thread or the mastodon post.