emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [External] : emacs-28 windows binaries available from alpha


From: Drew Adams
Subject: RE: [External] : emacs-28 windows binaries available from alpha
Date: Sun, 6 Feb 2022 06:57:57 +0000

> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]