unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#46355: 27.1; custom.el `widget-apply: Symbol’s function definition is void: nil'
@ 2021-02-06 22:46 zdm
  2021-02-07 12:03 ` Mauro Aranda
       [not found] ` <874kinpl07.fsf@cock.li>
  0 siblings, 2 replies; 3+ messages in thread
From: zdm @ 2021-02-06 22:46 UTC (permalink / raw)
  To: 46355

On Emacs 27.1 using the ‘Apply and Save’ button in a ‘M-x customize-face’ (or ‘M-x
customize-apropos-faces’) buffer with more than one face to customize causes an error
complaining of:

| widget-apply: Symbol’s function definition is void: nil

Due to the nature of it being related to custom.el, I cannot use ‘emacs -Q’ in order to
provide you with a clean Emacs state to start from for reproducing/testing (even with
trying to set ‘custom-file’), but I did ask in #emacs for people on the same version if
they were able to reproduce it with the following steps and several confirmed they could:

Step 1:
| M-x customize-apropos-faces RET vc RET
Step 2:
| Press the ‘Apply and Save’ button and ‘yes’ to the dialog box

The error will occur in the echo area. Note that this happens via ‘customize-face’ as
well, but there has to be more than one face in the customize buffer. Example, in ERC
there are some areas in a buffer you can place your mark/cursor, hit ‘customize-face’ and
be presented with two or more faces if detected when prompted for a face name. If you
simply hit RET, the listed faces will be in the customize buffer. Pressing ‘Apply and
Save’ there causes the same error. It matters not what packages the faces are coming
from, so ‘vc’ is just for testing, rather this is something wrong with custom.el I
believe.

Below is information gathered from ‘M-x report-emacs-bug’ immediately following the steps
above.

----------------------------------------

In GNU Emacs 27.1 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.22, cairo version 1.16.0)
 of 2020-08-20 built on buildhw-x86-03.iad2.fedoraproject.org
Windowing system distributor 'Fedora Project', version 11.0.12010000
System Description: Fedora 33 (Workstation Edition)

Recent messages:
Loading /home/zdm/.emacs.d/others-utils/emacsredux.el (source)...done
Loading /home/zdm/.emacs.d/others-utils/fuco1.el (source)...done
Starting new Ispell process /usr/bin/hunspell with default dictionary...done
For information about GNU Emacs and the GNU system, type C-h C-a.
Creating customization items...
Creating customization items ...done
Creating customization setup...done
Save all settings in this buffer? y
Saving file /home/zdm/.emacs.d/auto-package-configuration/custom.el...
Wrote /home/zdm/.emacs.d/auto-package-configuration/custom.el
widget-apply: Symbol’s function definition is void: nil
Configured using:
 'configure --build=x86_64-redhat-linux-gnu
 --host=x86_64-redhat-linux-gnu --program-prefix=
 --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr
 --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
 --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64
 --libexecdir=/usr/libexec --localstatedir=/var
 --sharedstatedir=/var/lib --mandir=/usr/share/man
 --infodir=/usr/share/info --with-dbus --with-gif --with-jpeg --with-png
 --with-rsvg --with-tiff --with-xft --with-xpm --with-x-toolkit=gtk3
 --with-gpm=no --with-xwidgets --with-modules --with-harfbuzz
 --with-cairo --with-json build_alias=x86_64-redhat-linux-gnu
 host_alias=x86_64-redhat-linux-gnu CC=gcc 'CFLAGS=-DMAIL_USE_LOCKF -O2
 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches
 -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
 -Wp,-D_GLIBCXX_ASSERTIONS
 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong
 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
 -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
 LDFLAGS=-Wl,-z,relro
 PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GSETTINGS GLIB NOTIFY
INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF
ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS
LIBSYSTEMD JSON PDUMPER GMP

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Custom

Minor modes in effect:
  electric-pair-mode: t
  ivy-mode: t
  doom-modeline-mode: t
  minibuffer-depth-indicate-mode: t
  delete-selection-mode: t
  show-paren-mode: t
  shell-dirtrack-mode: t
  winner-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/zdm/.emacs.d/elpa/lispy-20210121.926/elpa hides /home/zdm/.emacs.d/elpa/ivy-20210202.1423/elpa

Features:
(shadow sort form-feed mail-extr emacsbug message rmc puny rfc822 mml
mml-sec epa epg epg-config gnus-util rmail rmail-loaddefs
text-property-search time-date mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils pp vc-git diff-mode vc-bzr
vc-src vc-sccs vc-svn vc-cvs vc-rcs vc vc-dispatcher apropos cus-edit
cus-start cus-load wid-edit counsel xdg compile lispy hydra lv pcase
swiper lispy-inline noutline outline etags fileloop generator xref
project edebug backtrace help-fns radix-tree lispy-tags mode-local
find-func elec-pair aggressive-indent flyspell ispell emacs-upload
inf-elixir ivy-avy ivy ivy-faces ivy-overlay colir doom-modeline
doom-modeline-segments doom-modeline-env doom-modeline-core shrink-path
f s all-the-icons all-the-icons-faces data-material data-weathericons
data-octicons data-fileicons data-faicons data-alltheicons dash
link-hint rx ffap goto-addr thingatpt url-util avy derived advice dired+
image-dired image-mode exif format-spec image-file dired-x dired-aux
dired dired-loaddefs color-theme-sanityinc-tomorrow color doom-themes
doom-themes-base mb-depth delsel paren shell pcomplete comint ansi-color
winner ring edmacro kmacro keychain-environment exec-path-from-shell
no-littering cl-extra help-mode use-package use-package-ensure
use-package-delight use-package-diminish use-package-bind-key bind-key
easy-mmode use-package-core finder-inf erlang-start slime-autoloads info
package easymenu browse-url url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map
url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
timer select scroll-bar mouse jit-lock font-lock syntax facemenu
font-core term/tty-colors frame minibuffer cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads dbusbind
inotify dynamic-setting system-font-setting font-render-setting
xwidget-internal cairo move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 385010 15030)
 (symbols 48 27826 2)
 (strings 32 118735 4924)
 (string-bytes 1 3219780)
 (vectors 16 35891)
 (vector-slots 8 524012 15802)
 (floats 8 807 394)
 (intervals 56 518 86)
 (buffers 1000 13))





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#46355: 27.1; custom.el `widget-apply: Symbol’s function definition is void: nil'
  2021-02-06 22:46 bug#46355: 27.1; custom.el `widget-apply: Symbol’s function definition is void: nil' zdm
@ 2021-02-07 12:03 ` Mauro Aranda
       [not found] ` <874kinpl07.fsf@cock.li>
  1 sibling, 0 replies; 3+ messages in thread
From: Mauro Aranda @ 2021-02-07 12:03 UTC (permalink / raw)
  To: zdm; +Cc: 46355

zdm <zdm@cock.li> writes:

> On Emacs 27.1 using the ‘Apply and Save’ button in a ‘M-x
> customize-face’ (or ‘M-x
> customize-apropos-faces’) buffer with more than one face to customize
> causes an error
> complaining of:
>
> | widget-apply: Symbol’s function definition is void: nil
>
> Step 1:
> | M-x customize-apropos-faces RET vc RET
> Step 2:
> | Press the ‘Apply and Save’ button and ‘yes’ to the dialog box
>
> The error will occur in the echo area.

Thanks for the bug report.  This sounds like Bug#40853.  I can reproduce
this in Emacs 27.1, but not in the development branch, which has this
fix:

commit 5c39f6f1165a33f5714eedd3a413f786dffbb5a2
Author: Mauro Aranda <maurooaranda@gmail.com>
Date:   Fri Aug 14 16:40:40 2020 +0200

    Make sure we only act on edited widgets in Custom-save
    
    * lisp/cus-edit.el (Custom-save): Only act on edited widgets in the
    buffer.  If we attempt to redraw all widgets, we confuse
    custom-variable-modified-p, or we end up drawing State buttons for
    all options, including the hidden ones (bug#42801).

Would it be possible to you to build Emacs from the master branch and
try to see if you can reproduce it?

Alternatively, maybe you can try to redefine Custom-save as below in a
session, and see if the bug is still reproducible.  You should evaluate
the following after Step 1, and before Step 2.

(defun Custom-save (&rest _ignore)
  "Set all edited settings, then save all settings that have been set.
If a setting was edited and set before, this saves it.  If a
setting was merely edited before, this sets it then saves it."
  (interactive)
  (let (edited-widgets)
    (when (custom-command-apply
	   (lambda (child)
	     (when (memq (widget-get child :custom-state)
		         '(modified set changed rogue))
               (push child edited-widgets)
	       (widget-apply child :custom-mark-to-save)))
	   "Save all settings in this buffer? " t)
      ;; Save changes to buffer.
      (custom-save-all)
      ;; Redraw and recalculate the state when necessary.
      (dolist (widget edited-widgets)
        (widget-apply widget :custom-state-set-and-redraw)))))

That is how the function looks after the fix for Bug#40853 and
Bug#42801.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#46355: 27.1; custom.el `widget-apply: Symbol’s function definition is void: nil'
       [not found] ` <874kinpl07.fsf@cock.li>
@ 2021-02-08  9:51   ` Mauro Aranda
  0 siblings, 0 replies; 3+ messages in thread
From: Mauro Aranda @ 2021-02-08  9:51 UTC (permalink / raw)
  To: zdm; +Cc: 46355

unarchive 42801
forcemerge 42801 46355
quit


(Please keep the bug address in CCs, so that the mail reaches the bug tracker)

zdm <zdm@cock.li> writes:

> I'm able to confirm that both building from master branch (Emacs 28.0.50) or redefining
> ‘Custom-save’ fixes the issue, thank you so much and apologies for the redundant bug
> report.

Thanks for confirming, and no need to apologize at all.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-08  9:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-06 22:46 bug#46355: 27.1; custom.el `widget-apply: Symbol’s function definition is void: nil' zdm
2021-02-07 12:03 ` Mauro Aranda
     [not found] ` <874kinpl07.fsf@cock.li>
2021-02-08  9:51   ` Mauro Aranda

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).