unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#44583: 25.3; Emacs aborts with fatal error when a keyboard macro (saved in init.el) is set to run automatically at Emacs startup (Windows 10)
@ 2020-11-11 18:21 akshaychavan20031
  2020-11-11 19:27 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: akshaychavan20031 @ 2020-11-11 18:21 UTC (permalink / raw)
  To: 44583






In GNU Emacs 25.3.1 (x86_64-w64-mingw32)
 of 2017-09-17 built on LAPHROAIG
Windowing system distributor 'Microsoft Corp.', version 10.0.17134
Configured using:
 'configure --without-dbus --without-compress-install 'CFLAGS=-O2
 -static -g3''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB
TOOLKIT_SCROLL_BARS

Important settings:
  value of $LANG: ENU
  locale-coding-system: cp1252

Major mode: Lisp Interaction

Minor modes in effect:
  savehist-mode: t
  save-place-mode: t
  tooltip-mode: t
  global-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
  global-visual-line-mode: t
  visual-line-mode: t
  transient-mark-mode: t

Recent messages:
Starting Emacs daemon.
When done with this frame, type C-x 5 0

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message idna dired format-spec rfc822
mml mml-sec password-cache epg gnus-util mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils server
time-date imenu finder-inf edmacro kmacro package epg-config seq
byte-opt gv bytecomp byte-compile cl-extra help-mode easymenu cconv
cl-loaddefs pcase cl-lib savehist saveplace mule-util tooltip eldoc
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32
ls-lisp disp-table w32-win w32-vars term/common-win tool-bar dnd fontset
image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame 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 charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer 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 w32notify w32 multi-tty
make-network-process emacs)

Memory information:
((conses 16 228843 16607)
 (symbols 56 25882 0)
 (miscs 48 52 128)
 (strings 32 63017 18885)
 (string-bytes 1 1525123)
 (vectors 16 19795)
 (vector-slots 8 536167 4328)
 (floats 8 193 3)
 (intervals 56 763 30)
 (buffers 976 20))

Hello,

I encountered a fatal error which caused Emacs to abort at startup
(running as Daemon). The actions which led to this bug are as follows:

1. I recorded a keyboard macro and inserted its elisp code in init.el
with the M-x insert-kbd-macro function.

2. The elisp code for the macro is

;; This macro automatically runs remember-notes on Emacs startup and
;; then runs recover-this-file to recover autosave data of notes and
;; then enters 'yes' to the minibuffer prompt
(fset 'remember-notes-my-macro
   (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ([134217848 114 101 109 101 109 98 101 114 45 110 111 116 101 115 return 134217848 114 101 99 111 118 101 114 45 116 104 105 115 45 102 105 108 101 return 121 101 115 return] 0 "%d")) arg)))
;; Macro ends here

3. I wished for this macro execute automatically when Emacs Daemon is
launched at System startup. So I added the following line to my init.el

(remember-notes-my-macro)

4. When Emacs is started, I get a dialog box with the following text:

QUOTE
A fatal error has occured!
Would you like to attach a debugger?
Select:
YES -- To debug Emacs, or
NO -- to abort Emacs and produce a backtrace
(emacs_backtrace.txt in current directory).
(type 'gdb -p <emacs-PID>' and
'continue' inside GDB before clicking YES.)
UNQUOTE

5. However, this macro RUNS FINE when invoked in a running Emacs
instance by M-x remember-notes-my-macro

6. Please find the emacs_backtrace.txt in the attachment to this email.
<#part type=text filename="c:/Users/USER/Desktop/emacs_backtrace.txt" disposition=inline description=emacs_backtrace.txt>
<#/part>

Warm regards,
Akshay





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

* bug#44583: 25.3; Emacs aborts with fatal error when a keyboard macro (saved in init.el) is set to run automatically at Emacs startup (Windows 10)
  2020-11-11 18:21 bug#44583: 25.3; Emacs aborts with fatal error when a keyboard macro (saved in init.el) is set to run automatically at Emacs startup (Windows 10) akshaychavan20031
@ 2020-11-11 19:27 ` Eli Zaretskii
  2020-11-11 19:36 ` Eli Zaretskii
  2020-11-12 17:56 ` bug#44583: Here is the emacs_backtrace.txt Akshay C
  2 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2020-11-11 19:27 UTC (permalink / raw)
  To: akshaychavan20031; +Cc: 44583

> From: akshaychavan20031@gmail.com
> Date: Wed, 11 Nov 2020 23:51:01 +0530
> 
> 6. Please find the emacs_backtrace.txt in the attachment to this email.
> <#part type=text filename="c:/Users/USER/Desktop/emacs_backtrace.txt" disposition=inline description=emacs_backtrace.txt>
> <#/part>

The attachment didn't make it to the bug tracker.  Can you resend it?





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

* bug#44583: 25.3; Emacs aborts with fatal error when a keyboard macro (saved in init.el) is set to run automatically at Emacs startup (Windows 10)
  2020-11-11 18:21 bug#44583: 25.3; Emacs aborts with fatal error when a keyboard macro (saved in init.el) is set to run automatically at Emacs startup (Windows 10) akshaychavan20031
  2020-11-11 19:27 ` Eli Zaretskii
@ 2020-11-11 19:36 ` Eli Zaretskii
       [not found]   ` <CAP3r2sLbsMqab-Obro7sQ23SOEhD2zaL92Mj9uOe92gGwX+BkA@mail.gmail.com>
  2020-11-12 17:56 ` bug#44583: Here is the emacs_backtrace.txt Akshay C
  2 siblings, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2020-11-11 19:36 UTC (permalink / raw)
  To: akshaychavan20031; +Cc: 44583

> From: akshaychavan20031@gmail.com
> Date: Wed, 11 Nov 2020 23:51:01 +0530
> 
> I encountered a fatal error which caused Emacs to abort at startup
> (running as Daemon). The actions which led to this bug are as follows:
> 
> 1. I recorded a keyboard macro and inserted its elisp code in init.el
> with the M-x insert-kbd-macro function.
> 
> 2. The elisp code for the macro is
> 
> ;; This macro automatically runs remember-notes on Emacs startup and
> ;; then runs recover-this-file to recover autosave data of notes and
> ;; then enters 'yes' to the minibuffer prompt
> (fset 'remember-notes-my-macro
>    (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ([134217848 114 101 109 101 109 98 101 114 45 110 111 116 101 115 return 134217848 114 101 99 111 118 101 114 45 116 104 105 115 45 102 105 108 101 return 121 101 115 return] 0 "%d")) arg)))
> ;; Macro ends here
> 
> 3. I wished for this macro execute automatically when Emacs Daemon is
> launched at System startup. So I added the following line to my init.el
> 
> (remember-notes-my-macro)
> 
> 4. When Emacs is started, I get a dialog box with the following text:

Your macro attempts to prompt the user in the minibuffer, but the
daemon doesn't have a frame to do that.  What was the purpose of
invoking such a macro when you start Emacs as a daemon?





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

* bug#44583: Here is the emacs_backtrace.txt
  2020-11-11 18:21 bug#44583: 25.3; Emacs aborts with fatal error when a keyboard macro (saved in init.el) is set to run automatically at Emacs startup (Windows 10) akshaychavan20031
  2020-11-11 19:27 ` Eli Zaretskii
  2020-11-11 19:36 ` Eli Zaretskii
@ 2020-11-12 17:56 ` Akshay C
  2 siblings, 0 replies; 5+ messages in thread
From: Akshay C @ 2020-11-12 17:56 UTC (permalink / raw)
  To: 44583


[-- Attachment #1.1: Type: text/plain, Size: 99 bytes --]

I could not send the emacs_backtrace.txt file in my bug report. Please find
it in the attachments.

[-- Attachment #1.2: Type: text/html, Size: 124 bytes --]

[-- Attachment #2: emacs_backtrace.txt --]
[-- Type: text/plain, Size: 5675 bytes --]


Backtrace:
0000000400172601
000000040017269e
00000004000085ec
0000000400009ac0
00000004000d18f1
00000004000d1b73
0000000400114ac8
0000000400148288
0000000400116b0f
0000000400114987
00000004000cf291
0000000400114b9f
0000000400148288
0000000400116b0f
0000000400114987
0000000400148288
000000040014b3b6
0000000400116775
00000004001181d4
000000040011252d
0000000400114b3f
0000000400148288
0000000400116b0f
0000000400114987
0000000400114c95
00000004000b5a2c
00000004000b7e75
0000000400114b3f
0000000400148288
0000000400116cc6
0000000400116f2b
00000004001164e2
0000000400116da5
0000000400116f2b
00000004001164e2
00000004001165a6
0000000400137620
00000004001386a3
0000000400114b13
0000000400148288
0000000400116cc6
0000000400114987
000000040011781c
000000040013826e
0000000400114b13
0000000400148288
0000000400116b0f
0000000400114987
0000000400148288
0000000400116b0f
0000000400114987
0000000400148288
0000000400116b0f
0000000400116f2b
00000004001164e2
00000004001181d4
0000000400113fcd
00000004000a7e35
0000000400113f4b
00000004000a700d
00000004000abadc
00000004000abe31
...

Backtrace:
0000000400172601
000000040017269e
00000004000085ec
0000000400009ac0
00000004000d18f1
00000004000d1b73
0000000400114ac8
0000000400148288
0000000400116b0f
0000000400114987
00000004000cf291
0000000400114b9f
0000000400148288
0000000400116b0f
0000000400114987
0000000400148288
000000040014b3b6
0000000400116775
00000004001181d4
000000040011252d
0000000400114b3f
0000000400148288
0000000400116b0f
0000000400114987
0000000400114c95
00000004000b5a2c
00000004000b7e75
0000000400114b3f
0000000400148288
0000000400116cc6
0000000400116f2b
00000004001164e2
0000000400116da5
0000000400116f2b
00000004001164e2
0000000400137620
00000004001386a3
0000000400114b13
0000000400148288
0000000400116cc6
0000000400114987
000000040011781c
000000040013826e
0000000400114b13
0000000400148288
0000000400116b0f
0000000400114987
0000000400148288
0000000400116b0f
0000000400114987
0000000400148288
0000000400116b0f
0000000400116f2b
00000004001164e2
00000004001181d4
0000000400113fcd
00000004000a7e35
0000000400113f4b
00000004000a700d
00000004000abadc
00000004000abe31
00000004001d679d
...

Backtrace:
0000000400172601
000000040017269e
00000004000085ec
0000000400009ac0
00000004000d18f1
00000004000d1b73
0000000400114ac8
0000000400148288
0000000400116b0f
0000000400114987
00000004000cf291
0000000400114b9f
0000000400148288
0000000400116b0f
0000000400114987
0000000400148288
000000040014b3b6
0000000400116775
00000004001181d4
000000040011252d
0000000400114b3f
0000000400148288
0000000400116b0f
0000000400114987
0000000400114c95
00000004000b5a2c
00000004000b7e75
0000000400114b3f
0000000400148288
0000000400116cc6
0000000400116f2b
00000004001164e2
0000000400116da5
0000000400116f2b
00000004001164e2
0000000400137620
00000004001386a3
0000000400114b13
0000000400148288
0000000400116cc6
0000000400114987
000000040011781c
000000040013826e
0000000400114b13
0000000400148288
0000000400116b0f
0000000400114987
0000000400148288
0000000400116b0f
0000000400114987
0000000400148288
0000000400116b0f
0000000400116f2b
00000004001164e2
00000004001181d4
0000000400113fcd
00000004000a7e35
0000000400113f4b
00000004000a700d
00000004000abadc
00000004000abe31
00000004001d679d
...

Backtrace:
0000000400172601
000000040017269e
00000004000085ec
0000000400009ac0
00000004000d18f1
00000004000d1b73
0000000400114ac8
0000000400148288
0000000400116b0f
0000000400114987
00000004000cf291
0000000400114b9f
0000000400148288
0000000400116b0f
0000000400114987
0000000400148288
000000040014b3b6
0000000400116775
00000004001181d4
000000040011252d
0000000400114b3f
0000000400148288
0000000400116b0f
0000000400114987
0000000400114c95
00000004000b5a2c
00000004000b7e75
0000000400114b3f
0000000400148288
0000000400116cc6
0000000400116f2b
00000004001164e2
0000000400116da5
0000000400116f2b
00000004001164e2
0000000400137620
00000004001386a3
0000000400114b13
0000000400148288
0000000400116cc6
0000000400114987
000000040011781c
000000040013826e
0000000400114b13
0000000400148288
0000000400116b0f
0000000400114987
0000000400148288
0000000400116b0f
0000000400114987
0000000400148288
0000000400116b0f
0000000400116f2b
00000004001164e2
00000004001181d4
0000000400113fcd
00000004000a7e35
0000000400113f4b
00000004000a700d
00000004000abadc
00000004000abe31
00000004001d679d
...

Backtrace:
0000000400172601
000000040017269e
00000004000085ec
0000000400009ac0
00000004000d18f1
00000004000d1b73
0000000400114ac8
0000000400148288
0000000400116b0f
0000000400114987
00000004000cf291
0000000400114b9f
0000000400148288
0000000400116b0f
0000000400114987
0000000400148288
000000040014b3b6
0000000400116775
00000004001181d4
000000040011252d
0000000400114b3f
0000000400148288
0000000400116b0f
0000000400114987
0000000400114c95
00000004000b5a2c
00000004000b7e75
0000000400114b3f
0000000400148288
0000000400116cc6
0000000400116f2b
00000004001164e2
0000000400116da5
0000000400116f2b
00000004001164e2
0000000400137620
00000004001386a3
0000000400114b13
0000000400148288
0000000400116cc6
0000000400114987
000000040011781c
000000040013826e
0000000400114b13
0000000400148288
0000000400116b0f
0000000400114987
0000000400148288
0000000400116b0f
0000000400114987
0000000400148288
0000000400116b0f
0000000400116f2b
00000004001164e2
00000004001181d4
0000000400113fcd
00000004000a7e35
0000000400113f4b
00000004000a700d
00000004000abadc
00000004000abe31
00000004001d679d
...

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

* bug#44583: 25.3; Emacs aborts with fatal error when a keyboard macro (saved in init.el) is set to run automatically at Emacs startup (Windows 10)
       [not found]   ` <CAP3r2sLbsMqab-Obro7sQ23SOEhD2zaL92Mj9uOe92gGwX+BkA@mail.gmail.com>
@ 2020-11-12 18:01     ` Eli Zaretskii
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2020-11-12 18:01 UTC (permalink / raw)
  To: Akshay C; +Cc: 44583-done

[Please use Reply All to keep the bug tracker on the CC list.]

> From: Akshay C <akshaychavan20031@gmail.com>
> Date: Thu, 12 Nov 2020 23:24:18 +0530
> 
> Thank you for your response. Some text editors allow users to close the editor without saving the buffer to a
> file. The next time they open the editor, the buffer is still open. I wanted to achieve this in Emacs. So I wanted
> Emacs to automatically open "notes" at startup with the remember-notes function, then run recover-this-file
> function to recover any autosave data that I hadn't saved to disk, then enter "yes" at the minibuffer prompt. I
> am not good at elisp, so I recorded a keyboard macro to do the job.

Yes, but when you start Emacs as a daemon, there's no minibuffer to
prompt in, because there's no frame to display.

> I have attached emacs_backtrace.txt to
> this mail.

Thanks.  I've fixed the crash for the upcoming Emacs 27.2, in a way
that will use the console to display the messages when there's no
frame.

So I'm therefore closing this bug report.





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

end of thread, other threads:[~2020-11-12 18:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-11 18:21 bug#44583: 25.3; Emacs aborts with fatal error when a keyboard macro (saved in init.el) is set to run automatically at Emacs startup (Windows 10) akshaychavan20031
2020-11-11 19:27 ` Eli Zaretskii
2020-11-11 19:36 ` Eli Zaretskii
     [not found]   ` <CAP3r2sLbsMqab-Obro7sQ23SOEhD2zaL92Mj9uOe92gGwX+BkA@mail.gmail.com>
2020-11-12 18:01     ` Eli Zaretskii
2020-11-12 17:56 ` bug#44583: Here is the emacs_backtrace.txt Akshay C

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