unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Corwin Brust <corwin@bru.st>, Eli Zaretskii <eliz@gnu.org>
Cc: "H. Dieter Wilhelm" <dieter@duenenhof-wilhelm.de>,
	Emacs developers <emacs-devel@gnu.org>,
	Andrea Corallo <akrl@sdf.org>
Subject: RE: [External] : emacs-28 windows binaries available from alpha
Date: Sun, 6 Feb 2022 06:57:57 +0000	[thread overview]
Message-ID: <SJ0PR10MB54886233EF2EDA040ADC80DFF32B9@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <CAJf-WoSpJd5QTdwHOUPmourn02JQZq7EgEGrqXgkaWFhk+3nmg@mail.gmail.com>

> Drew,
> Please LMK if you spot issues with my reproducer and (if you get a
> chance to try) whether you get any different result or if this seems
> to solve the issue.
> 
> Reproducer:
> 
> 0. create a folder called c:\emacs
> 1. download the EL file as linked in Drew's original message to this
> thread to c:\emacs
> 2. download the ELC file attached to that same message to c:\emacs
> 3. unpack emacs-28.0.91.zip into c:\emacs
> 4. double click runemacs.exe
> 5. In scratch, paste in the following sniped and press C-x C-e
> 
>   (let ((load-path (append (list "c:/emacs") load-path)))
>     (require 'strings))

That recipe looks OK to me.

I downloaded this and extracted it:

> [1] Windows binaries Eli's patch, as above:
> https://urldefense.com/v3/__https://git.sr.ht/*mplscorwin/emacs-
> w64/tree/master/item/patched__;fg!!ACWV5N9M2RV99hQ!a802jebRYbd4QTOUJJfQ-
> q7jI0M0gWvrS7qh9s2wEA471JpWCb6Wv84N-Cy_H9W0$

I then used that with my usual init file (which loads
that Emacs 20 ELC file etc.).

I got past the problem of loading library strings.el,
so that problem seems to have been fixed.  Thx.
___

That got me a bit further along in loading my init file,
but I ran into another problem.  Most likely unrelated to
the first problem, and maybe not related to a problematic
Emacs binary or to native compilation.  A guess is that
it's a bug with `define-derived-mode'.  I mention it FYI.

This is the top of the backtrace stack.  An error is
raised when it tries to load library bookmark+.elc.

Debugger entered--Lisp error: (void-variable mode)
  (derived-mode-abbrev-table-name mode)
  (define-abbrev-table (derived-mode-abbrev-table-name mode) nil)
  (progn (define-abbrev-table (derived-mode-abbrev-table-name mode) nil) (make-abbrev-table))
  (defvar bookmark-show-annotation-mode-abbrev-table (progn (define-abbrev-table (derived-mode-abbrev-table-name mode) nil) (make-abbrev-table)) "Abbrev table for bookmark-show-annotation-mode.")
  eval((defvar bookmark-show-annotation-mode-abbrev-table (progn (define-abbrev-table (derived-mode-abbrev-table-name mode) nil) (make-abbrev-table)) "Abbrev table for bookmark-show-annotation-mode."))
  derived-mode-init-mode-variables(bookmark-show-annotation-mode)
  byte-code("\301\302\303\304\305\10\306BBB\307BBB!\210\310\311!\210\312\311\313\305#\207" [bmkp-annotation-modes-inherit-from eval progn (when (keymapp bookmark-edit-annotation-mode-map) (set-keymap-parent bookmark-edit-annotation-mode-map nil)) define-derived-mode bookmark-edit-annotation-mode ("Edit Bookmark Annotation" "Mode for editing the annotation of a bookmark.\nWhe...") ((define-key bookmark-edit-annotation-mode-map "\30\21" 'bmkp-show-this-annotation-read-only) (define-key bookmark-edit-annotation-mode-map "\3\203" 'bookmark-send-edited-annotation)) derived-mode-init-mode-variables bookmark-show-annotation-mode put derived-mode-parent] 7)
  require(bookmark+-1)
  byte-code("\300\301\302\303#\210\300\304!\210\300\305!\210\300\306!\210\307\310!\207" [require bookmark+-lit nil t bookmark+-bmu bookmark+-1 bookmark+-key provide bookmark+] 4)
  require(bookmark+ nil t)
...

But starting from runemacs -Q, and just requiring
library bookmark+ loads it with no problem (just
warnings).  There are a lot of other libraries
that get loaded before bookmark+ when I use my
init file, and the bookmark+ code that gets eval'd
when it's loaded is different, depending on which
of those other libraries might have been loaded,
so I'd need to track down what the problem is.

An a priori guess is that the void-variable error
for variable `mode' comes from a change to lexical
binding in some vanilla library (?).  But I don't
see the error when I load bookmark+ from emacs -Q.

This is the code it seems to be complaining about:

(define-derived-mode bookmark-show-annotation-mode
                     bookmark-edit-annotation-mode
    "Show Bookmark Annotation"
  "Mode for displaying the annotation of a bookmark.

\\{bookmark-show-annotation-mode-map}"
  (setq buffer-read-only  t)
  (define-key bookmark-show-annotation-mode-map
              "\C-x\C-q" 'bmkp-edit-this-annotation))

And that immediately follows this:

;; REPLACES ORIGINAL in `bookmark.el'.
;;
;; 1. Derive from value of option
;;    `bmkp-annotation-modes-inherit-from'.
;; 2. First, remove parent map from
;;    `bookmark-edit-annotation-mode-map', so it is derived anew.
;; 3. Corrected typo in doc string: *send-EDITED-*.
;; 4. Need to use `eval', to pick up option value and reset parent keymap.
;; 5. Bind `C-x C-q' to `bmkp-show-this-annotation-read-only'.
;;
;;;###autoload (autoload 'bookmark-edit-annotation-mode "bookmark+")
(eval
 `(progn
   ;; Get rid of default parent, so
   ;; `bmkp-annotation-modes-inherit-from' is used for the map.
   (when (keymapp bookmark-edit-annotation-mode-map)
     (set-keymap-parent bookmark-edit-annotation-mode-map nil))
   (define-derived-mode bookmark-edit-annotation-mode
                        ,bmkp-annotation-modes-inherit-from
       "Edit Bookmark Annotation"
     "Mode for editing the annotation of a bookmark.
When you have finished composing, use `C-c C-M-c'.

\\{bookmark-edit-annotation-mode-map}")
    (define-key bookmark-edit-annotation-mode-map
                "\C-x\C-q"    'bmkp-show-this-annotation-read-only)
    ;; Define this key because Org mode co-opts `C-c C-c' as a prefix key.
    (define-key bookmark-edit-annotation-mode-map
                "\C-c\C-\M-c" 'bookmark-send-edited-annotation)))

Maybe this will ring a bell for someone reading this.
I doubt I'll get far digging into this, without
wasting a lot of time.  I don't think that
`derived-mode-init-mode-variables' is used anywhere
besides ldefs-boot.el and loaddefs.el (that's the
case in Emacs 26.3, at least).  Why its formal
parameter `mode' apparently isn't getting bound to
the value passed, `bookmark-show-annotation-mode',
I don't know.

I got scared for a moment, as I tried to delete
that ELC file to then try again with my init file.
I couldn't delete or rename it.  Same thing with
the other ELC files that had so far been loaded.

Other ELC files, that would normally get loaded
by my init file but which hadn't yet been tried
to load, I could delete or rename.  I couldn't
figure it out at first, but trying to use Windows
Explorer, instead of Dired, to rename bookmark+-1.elc,
I got a message saying

 File in Use:

 The action can't be completed because the file
 is open in GNU Emacs: The extensible self-documenting
 text editor.

(Emacs was only able to tell me that the rename
or deletion failed.)

After closing all the Emacs 28 session I was
able to rename the file.

I then tried again to run Emacs with my init
file, this time with no ELC for bookmark+-1.el.

I got past that `derived-mode-abbrev-table-name'
problem for bookmark+-1.el, but I ran into the
same problem for another library (synonyms.el),
and its ELC is also from Emacs 20.7.

Debugger entered--Lisp error: (void-variable mode)
  (derived-mode-abbrev-table-name mode)
  (define-abbrev-table (derived-mode-abbrev-table-name mode) nil)
  (progn (define-abbrev-table (derived-mode-abbrev-table-name mode) nil) (make-abbrev-table))
  (defvar synonyms-mode-abbrev-table (progn (define-abbrev-table (derived-mode-abbrev-table-name mode) nil) (make-abbrev-table)) "Abbrev table for synonyms-mode.")
  eval((defvar synonyms-mode-abbrev-table (progn (define-abbrev-table (derived-mode-abbrev-table-name mode) nil) (make-abbrev-table)) "Abbrev table for synonyms-mode."))
  derived-mode-init-mode-variables(synonyms-mode)
  byte-code("\300\301!\210\302\301\303\304#\207" [derived-mode-init-mode-variables synonyms-mode put derived-mode-parent text-mode] 4)
  require(synonyms nil t)
  byte-code("\10\303V\203\13\0\304\305\306\217\210\10\303V\203\27\0\307\310\304\311#\210\307\312\304\311#\210\10\303V\2032\0\307\313\304\311#\210\314\315!\2032\0\315 \210..." [emacs-major-version window-system system-type 21 nil (byte-code "\300\301\302\303#\207" [require crosshairs nil t] 4) ((error)) require hl-spotlight t pp-c-l pretty-lambdada fboundp pretty-lambda-for-modes echo-bell da-setup local-lpr local-ps-print printing font-lock-menus featurep 24 font-menus facemenu+ font-lock+ display-graphic-p zoom-frm eval-after-load "info" (if (> emacs-major-version 22) (require 'info+ nil t) (require 'info+20 nil t)) fuzzy-match swiss-move setup-keys replace+ apropos-fn+var lacarte synonyms 20 tool-bar+ "icomplete" (require 'icomplete+ nil t) "diff" (require 'diff+ nil t) diff-mode- diff-mode (require 'diff+20 nil t) ediff+ find-dired+ dired+ windows-nt ...] 5)
  require(start)

And if I just do `M-x load-library synonyms.elc'
then I get the error message in the echo area:

 Symbol's value as variable is void: mode

This is the use of `define-derived-mode' in
synonyms.el (I've elided the doc-string text):

(define-derived-mode synonyms-mode text-mode "Synonyms"
  "..."
  (modify-syntax-entry ?- "w" synonyms-mode-syntax-table)
  (modify-syntax-entry ?1 "w" synonyms-mode-syntax-table)
  (modify-syntax-entry ?2 "w" synonyms-mode-syntax-table)
  (modify-syntax-entry ?3 "w" synonyms-mode-syntax-table)
  (modify-syntax-entry ?9 "w" synonyms-mode-syntax-table)
  (modify-syntax-entry ?0 "w" synonyms-mode-syntax-table)
  (modify-syntax-entry ?$ "w" synonyms-mode-syntax-table)
  (buffer-disable-undo)
  (setq fill-column  synonyms-fill-column)
  (set (make-local-variable 'transient-mark-mode) t))

I don't feel like digging deeper into this.
Hopefully someone knowledgeable can figure out
what the problem is from my description here.

___

I'll just mention that this is the first time I've
not been able to just immediately use a Windows
binary for Emacs.  Never had an error raised before
when just loading my init file.  And that's still
the case, for all releases starting with Emacs 20.

  reply	other threads:[~2022-02-06  6:57 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-04 18:54 emacs-28 windows binaries available from alpha Corwin Brust
2022-02-04 22:08 ` [External] : " Drew Adams
2022-02-04 22:12   ` Drew Adams
2022-02-04 23:10     ` Corwin Brust
2022-02-05  1:28       ` Drew Adams
2022-02-05  4:35         ` Corwin Brust
2022-02-05  7:43           ` Eli Zaretskii
2022-02-05  8:48             ` Corwin Brust
2022-02-05  9:15               ` Eli Zaretskii
2022-02-05 18:16           ` Drew Adams
2022-02-05  7:25     ` Eli Zaretskii
2022-02-05  9:22       ` H. Dieter Wilhelm
2022-02-05  9:40         ` Eli Zaretskii
2022-02-05 16:49           ` H. Dieter Wilhelm
2022-02-05 17:54             ` Eli Zaretskii
2022-02-05 19:25               ` H. Dieter Wilhelm
2022-02-05 19:47                 ` Eli Zaretskii
2022-02-05 21:11                   ` H. Dieter Wilhelm
2022-02-05 22:56                     ` Corwin Brust
2022-02-06  0:10                       ` Drew Adams
2022-02-06  8:22                         ` Eli Zaretskii
2022-02-06  8:51                           ` Drew Adams
2022-02-06  9:25                             ` Eli Zaretskii
2022-02-06 17:08                               ` Drew Adams
2022-02-06 17:33                                 ` Eli Zaretskii
2022-02-06  8:18                       ` Eli Zaretskii
2022-02-05 10:10       ` Eli Zaretskii
2022-02-06  3:11         ` Corwin Brust
2022-02-06  6:57           ` Drew Adams [this message]
2022-02-06  9:11             ` Eli Zaretskii
2022-02-06 17:07               ` Drew Adams
2022-02-09 19:08         ` Eli Zaretskii
2022-02-09 21:03           ` Andrea Corallo
2022-02-10  5:52             ` Eli Zaretskii
2022-02-10  8:56               ` Andrea Corallo
2022-02-10 12:13                 ` Eli Zaretskii
2022-02-10 13:36                   ` Andrea Corallo
2022-02-10 17:15                     ` Eli Zaretskii
2022-02-10 18:34                       ` Andrea Corallo
2022-02-11  8:29                         ` Eli Zaretskii
2022-02-11  9:16                           ` Andrea Corallo
2022-02-11  9:21                             ` Andrea Corallo
2022-02-11 11:31                               ` Eli Zaretskii
2022-02-11 14:16                                 ` Andrea Corallo
2022-02-11 14:33                                   ` Eli Zaretskii
2022-02-11 14:38                                     ` Andrea Corallo
2022-02-11 11:30                             ` Eli Zaretskii
2022-02-11 14:18                               ` Andrea Corallo
2022-02-11 14:35                                 ` Eli Zaretskii
2022-02-11 14:44                                   ` Andrea Corallo
2022-02-11 15:16                                     ` Eli Zaretskii
2022-02-14 10:25                                       ` Andrea Corallo
2022-02-10 22:50                     ` Corwin Brust
2022-02-06  0:33     ` Corwin Brust

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SJ0PR10MB54886233EF2EDA040ADC80DFF32B9@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=akrl@sdf.org \
    --cc=corwin@bru.st \
    --cc=dieter@duenenhof-wilhelm.de \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).