unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#40800: 27.0.90; Incorrect external definition for calc-twos-complement-mode
@ 2020-04-23 20:27 Hugh Daschbach
  2020-04-24 10:59 ` Mattias Engdegård
  0 siblings, 1 reply; 4+ messages in thread
From: Hugh Daschbach @ 2020-04-23 20:27 UTC (permalink / raw)
  To: 40800

The sequence:
(require 'calc-bin)
(func-arity #'calc-twos-complement-mode)
produces the error message:
*** Eval error *** Autoloading file 
    /usr/local/share/emacs/27.0.90/lisp/calc/calc-bin.elc failed 
    to define function calc-twos-complement-mode

Reproducible with:
cat >/tmp/calc-issue.el <(require 'calc-bin)
(func-arity #'calc-twos-complement-mode)
EOF
emacs -Q -q -nw -batch -load /tmp/calc-issue.el

It seems that calc-ext.el associates cal-twos-complement-mode to
calc-bin, but the definition lies elsewhere.

In GNU Emacs 27.0.90 (build 1, x86_64-pc-linux-gnu, X toolkit, 
Xaw3d scroll bars)
of 2020-03-01 built on klaatu
Repository revision: b42b894d1def7180ab715615116fe6af65b76bd8
Repository branch: emacs-27
System Description: Artix Linux

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list...

Configured using:
'configure --with-x-toolkit=lucid'

Configured features:
XAW3D XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS GLIB 
NOTIFY
INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF XFT 
ZLIB
TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM MODULES THREADS LIBSYSTEMD 
JSON
PDUMPER LCMS2 GMP

Important settings:
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
eldoc-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired 
dired-loaddefs
format-spec rfc822 mml easymenu mml-sec password-cache epa derived 
epg
epg-config gnus-util rmail rmail-loaddefs text-property-search 
time-date
subr-x seq mm-decode mm-bodies mm-encode mail-parse rfc2231 
mailabbrev
gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils term/tmux term/xterm 
xterm
byte-opt gv bytecomp byte-compile cconv 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 lcms2 dynamic-setting
system-font-setting font-render-setting x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 49658 8413)
(symbols 48 6137 1)
(strings 32 15738 1870)
(string-bytes 1 507249)
(vectors 16 8067)
(vector-slots 8 82942 8066)
(floats 8 23 455)
(intervals 56 192 0)
(buffers 1000 12))





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

* bug#40800: 27.0.90; Incorrect external definition for calc-twos-complement-mode
  2020-04-23 20:27 bug#40800: 27.0.90; Incorrect external definition for calc-twos-complement-mode Hugh Daschbach
@ 2020-04-24 10:59 ` Mattias Engdegård
  2020-04-24 16:48   ` Hugh Daschbach
  0 siblings, 1 reply; 4+ messages in thread
From: Mattias Engdegård @ 2020-04-24 10:59 UTC (permalink / raw)
  To: Hugh Daschbach; +Cc: 40800

[-- Attachment #1: Type: text/plain, Size: 240 bytes --]

Thank you! It seems that calc-twos-complement-mode is a variable, not a function, and there were more autoloads that didn't correspond to actual functions. Would this patch work for you?

(By the way, how come you found this mistake?)


[-- Attachment #2: 0001-Calc-fix-autoload-errors-bug-40800.patch --]
[-- Type: application/octet-stream, Size: 3191 bytes --]

From 28e38319d79f38ac504c8dde49d602db323d9fc7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20Engdeg=C3=A5rd?= <mattiase@acm.org>
Date: Fri, 24 Apr 2020 12:49:42 +0200
Subject: [PATCH] Calc: fix autoload errors (bug#40800)

* lisp/calc/calc-ext.el (calc-init-extensions):
Remove calc-kbd-report key binding and autoload; it was removed in 2005.
calc-keypad-x-{left,right,middle}-click were renamed to
calc-keypad-{left,right,middle}-click in 2001; fix the autoloads.
calc-twos-complement-mode is a variable, not a function; remove the
autoload.
* lisp/calc/calc-prog.el: Remove commented-out calc-kbd-report.
---
 lisp/calc/calc-ext.el  | 9 ++++-----
 lisp/calc/calc-prog.el | 5 -----
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index bc70ec283f..5c11554d5d 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -674,7 +674,6 @@ calc-init-extensions
   (define-key calc-mode-map "Z/" 'calc-kbd-break)
   (define-key calc-mode-map "Z`" 'calc-kbd-push)
   (define-key calc-mode-map "Z'" 'calc-kbd-pop)
-  (define-key calc-mode-map "Z=" 'calc-kbd-report)
   (define-key calc-mode-map "Z#" 'calc-kbd-query)
 
   (calc-init-prefixes)
@@ -845,8 +844,8 @@ calc-init-extensions
  ("calc-incom" calc-digit-dots)
 
  ("calc-keypd" calc-do-keypad
-calc-keypad-x-left-click calc-keypad-x-middle-click
-calc-keypad-x-right-click)
+calc-keypad-left-click calc-keypad-middle-click
+calc-keypad-right-click)
 
  ("calc-lang" calc-set-language
 math-read-big-balance math-read-big-rec)
@@ -1003,7 +1002,7 @@ calc-init-extensions
 calc-floor calc-idiv calc-increment calc-mant-part calc-max calc-min
 calc-round calc-scale-float calc-sign calc-trunc calc-xpon-part)
 
- ("calc-bin" calc-and calc-binary-radix calc-clip calc-twos-complement-mode
+ ("calc-bin" calc-and calc-binary-radix calc-clip
 calc-decimal-radix calc-diff calc-hex-radix calc-leading-zeros
 calc-lshift-arith calc-lshift-binary calc-not calc-octal-radix calc-or calc-radix
 calc-rotate-binary calc-rshift-arith calc-rshift-binary calc-word-size
@@ -1116,7 +1115,7 @@ calc-init-extensions
 calc-in-set calc-kbd-break calc-kbd-else calc-kbd-else-if
 calc-kbd-end-for calc-kbd-end-if calc-kbd-end-loop calc-kbd-end-repeat
 calc-kbd-for calc-kbd-if calc-kbd-loop calc-kbd-pop calc-kbd-push
-calc-kbd-query calc-kbd-repeat calc-kbd-report calc-less-equal
+calc-kbd-query calc-kbd-repeat calc-less-equal
 calc-less-than calc-logical-and calc-logical-if calc-logical-not
 calc-logical-or calc-not-equal-to calc-pass-errors calc-remove-equal
 calc-timing calc-user-define calc-user-define-composition
diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el
index e88aa92364..6db5de4c96 100644
--- a/lisp/calc/calc-prog.el
+++ b/lisp/calc/calc-prog.el
@@ -1452,11 +1452,6 @@ calc-kbd-pop
     (error "%s" "Unbalanced Z' in keyboard macro")))
 
 
-;; (defun calc-kbd-report (msg)
-;;   (interactive "sMessage: ")
-;;   (calc-wrapper
-;;    (math-working msg (calc-top-n 1))))
-
 (defun calc-kbd-query ()
   (interactive)
   (let ((defining-kbd-macro nil)
-- 
2.21.1 (Apple Git-122.3)


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

* bug#40800: 27.0.90; Incorrect external definition for calc-twos-complement-mode
  2020-04-24 10:59 ` Mattias Engdegård
@ 2020-04-24 16:48   ` Hugh Daschbach
  2020-04-24 18:23     ` Mattias Engdegård
  0 siblings, 1 reply; 4+ messages in thread
From: Hugh Daschbach @ 2020-04-24 16:48 UTC (permalink / raw)
  To: Mattias Engdegård; +Cc: Hugh Daschbach, 40800


Mattias Engdegård writes:

> Thank you! It seems that calc-twos-complement-mode is a 
> variable, not a function, and there were more autoloads that 
> didn't correspond to actual functions. Would this patch work for 
> you?
>
> (By the way, how come you found this mistake?)

That does work, thank you.  Moreover, (fboundp 
'calc-twos-complement-mode) now returns nil.

I ran into this trying to generate a list of functions with an 
arity of zero, with:

(completing-read
     "Function: "
     (let (fns)
       (mapatoms
	(lambda (x)
	  (when (and (fboundp x)
                     (= 0 (car (func-arity x))))
	    (push (symbol-name x) fns))))
       fns)
     nil t nil 'local/mapcar-dired-history)

Still need to ignore autoloaded functions, as I don't want 
func-arity to cause the function to be loaded.  But that's where I 
started.

Many thanks.
Hugh





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

* bug#40800: 27.0.90; Incorrect external definition for calc-twos-complement-mode
  2020-04-24 16:48   ` Hugh Daschbach
@ 2020-04-24 18:23     ` Mattias Engdegård
  0 siblings, 0 replies; 4+ messages in thread
From: Mattias Engdegård @ 2020-04-24 18:23 UTC (permalink / raw)
  To: Hugh Daschbach; +Cc: 40800-done

24 apr. 2020 kl. 18.48 skrev Hugh Daschbach <hdasch@fastmail.com>:

> I ran into this trying to generate a list of functions with an arity of zero

Interesting, and best of luck. Patch pushed to emacs-27.






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

end of thread, other threads:[~2020-04-24 18:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-23 20:27 bug#40800: 27.0.90; Incorrect external definition for calc-twos-complement-mode Hugh Daschbach
2020-04-24 10:59 ` Mattias Engdegård
2020-04-24 16:48   ` Hugh Daschbach
2020-04-24 18:23     ` Mattias Engdegård

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).