unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Please help me debug my Emacs instillation
@ 2024-02-29  2:43 Davin Pearson
  2024-03-01 18:48 ` tpeplt
  0 siblings, 1 reply; 3+ messages in thread
From: Davin Pearson @ 2024-02-29  2:43 UTC (permalink / raw)
  To: gnu.emacs.help

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

Here is the file runmacs.bat that I use for loading emacs

date
cd LOCATION
./src/emacs -q --load ~/dmp-emacs--yes-init-file.el  --eval "(setq
debug-on-error t)" --debug-init &

where LOCATION is the location of your emacs executable file.  On my
computer it is: ~/Downloads/emacs-29.1/

Please copy the attached files dmp-emacs--yes-file.el and includer.el
to your HOME folder.

The following commands all give an error message like this:

byte-code: Recursive ‘require’ for feature ‘semantic’

Here is a list of the commands that generate the above-mentioned error:

M-%
M-/
M-.
C-h a
C-s
C-r
M-C-s
M-C-r

Why doesn't it show a backtrace since I have --debug-init on the command
line?

NOTE: I have removed the following sentence from my Website
http://davin.50webs.com: "In addition to this, I believe that I am New
Zealand's foremost exponent of Stallman's GNU Emacs text editor." in
the hope that it will attract more people in the newsgroup
gnu.emacs.help to reply to this message.
--
Sincerely and kindest regards,
*Davin Pearson* http://davin.50webs.com

[-- Attachment #2: dmp-emacs--yes-init-file.el --]
[-- Type: text/x-emacs-lisp, Size: 12147 bytes --]


(message "&tip-top:998:")

(message "&tip-top:999:")

(progn
  ;;(add-hook 'after-init-hook 'after-init-hook--dmp-set-face-font 70)
  (defun dmp-set-face-font ()
    (set-face-font 'default "Monospace Serif 20")
    )
  (dmp-set-face-font)
  )

(message "&tip-top:1000:")

(if (not (fboundp 'string=))
    (defun string= (str0 str1)
      (dmp-assert (stringp str0))
      (dmp-assert (stringp str1))
      (equal str0 str1)))

(message "&tip-top:1001")

(progn      
  (message "&tip-top:1002:")
  (defalias 'ANDY 'identity)
  (defalias 'dtp 'describe-text-properties)
  (defalias 'rtf 'rich-text-format)
  (defalias 'tde 'toggle-read-only)
  (setq transient-mark-mode nil)
  (setq kill-whole-line t)
  (progn
    (global-set-key "\C-x\C-s" 'save-some-buffers)
    (global-set-key "\C-xs"    'save-some-buffers))
  (progn
    (defun dmp-find-file (file)
      (interactive "Fdmp-find-file> ")
      ;; Code omitted for brevity
      (find-file file))
    (progn
      (global-set-key "\C-x\C-d" 'dmp-find-file)
      (global-set-key "\C-x\C-f" 'dmp-find-file)
      (global-set-key "\C-xd"    'dmp-find-file)
      (global-set-key "\C-xf"    'dmp-find-file)
      (global-set-key "\C-f"     'dmp-find-file)
      (global-set-key "\C-d"     'dmp-find-file)
      (global-set-key "\C-b"     'bury-buffer)
      )
    (progn
      (global-set-key "\C-b"     'bury-buffer)
      (global-set-key [f12]      'eval-last-sexp)
      (global-set-key "\C-e"     'call-last-kbd-macro)
      (global-set-key "\C-x\C-e" 'eval-last-sexp)
      )

    (progn
      (global-set-key [(control left)] 'backward-sexp)
      (global-set-key [(shift   left)] 'backward-sexp)
      (global-set-key [(meta    left)] 'backward-sexp)
      (global-set-key [(control right)] 'forward-sexp)
      (global-set-key [(shift   right)] 'forward-sexp)
      (global-set-key [(meta    right)] 'forward-sexp)
      )
    (message "&tip-top:1003:")
    )
  (progn
    (global-set-key [f7]       'read-only-mode)
    (global-set-key [f8]       'undo)
    (global-set-key [(f12)]    'eval-last-sexp)
    (message "&tip-top:1004:")
    )
  (progn
    (global-set-key "\C-x\C-g" 'goto-line)
    (global-set-key "\C-xg"    'goto-line)
    (global-set-key "\C-o"     'split-line)
    (global-set-key "\M-/"     'dabbrev-expand)
    (global-set-key [(control tab)] 'other-window)
    (message "hello dmp-emacs--yes-init-file.el!")
    )
  )

(message "&tip-top:1005:")

(progn
  (setq *dmp-prefs--davins-keybindings-online-p* t)
  (setq *dmp-emacs-dialect--gnu-emacs-p* t)
  )

(defmacro dmp-quote (&rest ignored)
  t)

(message "&tip-top:1006:")

(condition-case err
    (progn
      (progn
        (make-face 'default)
        (make-face-unbold 'default)
        (set-face-background 'default "#f0f0f0"))
      (progn
        (make-face 'font-lock-comment-face)
        (set-face-background 'font-lock-comment-face "#f0f0f0")
        (set-face-foreground 'font-lock-comment-face "#080")
        (make-face-italic    'font-lock-comment-face)
        )
      (progn
        (make-face 'font-lock-function-name-face)
        (set-face-background 'font-lock-function-name-face "#ffff00")
        (set-face-foreground 'font-lock-function-name-face "#000")
        (make-face-bold 'font-lock-function-name-face))
      (progn
        (make-face 'font-lock-string-face)
        (set-face-background 'font-lock-string-face "#ddddff")
        (set-face-foreground 'font-lock-string-face "#000")
        )
      (progn
        (make-face 'font-lock-keyword-face)
        (set-face-background 'font-lock-keyword-face "#f0f0f0")
        (set-face-foreground 'font-lock-keyword-face "#000")
        (make-face-bold 'font-lock-keyword-face)
        )
      (progn
        (make-face 'dired-directory)
        (set-face-background 'dired-directory "#f0f0f0")
        (set-face-foreground 'dired-directory "#0000ff")
        )
      )
  (error
   (message "dmp-error:font-is-missing err=%s" (prin1-to-string err))
   ))

(message "&tip-top:1007:")

(progn
  (setq *dmp-root-user-p* (if (string-match "root" (getenv "HOME")) t))
  ;;(setq *dmp-os-type--mswindows-p* (if (memq 'mswindows os-type)
  (defvar bg-colour-lighter "#ffffff")
  (defvar auto-save-timeout 5)
  (defvar backup-inhibited t)
  (defvar undo-limit (* 1000 1000))
  (setq-default tab-width 8)
  (setq delete-old-versions t)
  (setq-default cursor-type 'box)
  (setq yes-or-no-p-history '("yes" "no"))
  (defvar ***dmp-sound-on-p*** t)
  (setq ***dmp-quit-quick*** nil)
  (setq auto-save-default  *dmp-emacs-dialect--gnu-emacs-p*)
  (setq load-prefer-newer  t) ;; prefer newer of *.elc *.el
  ;;(setq ls-lisp-dirs-first t) ;; NOTE: like MS Windows Explorer
  (setq dired-use-ls-dired t)
  (setq kill-whole-line    t)
  (setq case-fold-search   t)
  (setq save-abbrevs       'silently) ;; supressing annoying messages
  (setq track-eol t)
  (setq-default kill-whole-line t)
  (setq-default file-name-history (cons "~/" file-name-history))
  ;;(setq eol-mnemonic-unix "(unix)")
  (setq eol-mnemonic-dos "(dos)")
  (setq compile-command "make ")
  (setq message-log-max 10000)
  (setq delete-by-moving-to-trash t)
  (setq enable-local-eval t)
  (setq-default c-basic-offset 3)
  (setq-default
   visible-bell                     nil
   save-abbrevs                     'silently
   message-log-max                   (* 10 1000)
   transient-mark-mode               nil
   indent-tabs-mode                  nil ;; never put tabs in dmp- code
   parse-sexp-ignore-comments        t
   comment-column                    40
   completion-ignore-case            t ;; good for win95 mode.
   case-fold-search                  nil
   c-basic-offset                    3
   truncate-lines                    nil
   fill-column                       70)
  (setq
   gc-cons-threshold                 2000000
   same-window-buffer-names          nil
   compilation-window-height         15
   line-number-mode                  t
   search-highlight                  t
   compilation-window-height         10
   compilation-ask-about-save        nil
  next-line-add-newlines            nil ;; doesn't add newlines at end
   kill-whole-line                   t   ;; makes c-k more convenient.
   next-screen-context-lines         1   ;; overlap with pgup/pgdn
   compile-command                   "make "
   default-major-mode                'fundamental-mode
   three-step-help                   t
   apropos-do-all                    t ;; more extensive online help
   enable-recursive-minibuffers      nil ;; advanced customisation feature...
   column-number-mode                t
   eval-expression-debug-on-error    nil
   debug-on-error                    nil
   dmp-splash-screen--activated      t
   c2java-version                    "1.21"))

(message "&tip-top:1008:")

(defun dmp-f1 ()
  (interactive)
  (info)
  (delete-other-windows))

(message "&tip-top:1009:")

(when *dmp-prefs--davins-keybindings-online-p*
  (global-set-key [f1] 'dmp-f1)
  )

(message "&tip-top:1010:")

(defun dmp-meta-f1 ()
  (interactive)
  (kill-ring-save (point-min) (point-max))
  (transient-mark-mode 1)
  (dmp-message "copied buffer to clipboard"))

(message "&tip-top:1011:")

(when *dmp-prefs--davins-keybindings-online-p*
  (global-set-key [(meta f1)]    'dmp-meta-f1)
  (global-set-key [(shift f1)]   'dmp-meta-f1)
  (global-set-key [(control f1)] 'dmp-meta-f1)
  )
  
(message "&tip-top:1012:")

(defun e ()
  (interactive)
  (condition-case err
      (progn
	;;(message "Executing M-x e")
	(eval-buffer)
	(emacs-lisp-mode)
	(if (fboundp 'dmp-safe--play-sound--doit)
	    (dmp-safe--play-sound--doit "music-sample--Miles-Davis--Doo-Bop--Mystery.wav")))
    (error
     (if (fboundp 'dmp-safe--play-sound--doit)
	 (dmp-safe--play-sound--doit "emacs-sample--John-Coltrane--Countdown2.wav")))))

(setq *dmp-message-indent* 0)
;;(dmp-message "abc")
;;(dmp-message "begun: foo")

(defvar ***dmp-messages-welcome-goodbye-on-p*** t)

(defvar ***dmp-messages-on-p*** t)

(message "&tip-top:1013:")

(defun dmp-message (format-string &rest args)
  (progn
    (progn
      (if (< *dmp-message-indent* 0)
          (setq *dmp-indent* 0))
      (setq *dmp-message-str* (make-string *dmp-message-indent* ? ))
      (if (or ***dmp-messages-welcome-goodbye-on-p***
              ***dmp-messages-on-p***)
          (setq return-value (apply 'message (concat *dmp-message-str*
                                                     ;;"DEBUG: "
                                                     format-string)
                                    args))
        (setq return-value nil))
      )
    return-value
        )
  ) ;; NOTE: Eval the line above for an immediate effect!

(message "&tip-top:1014:")

(defun dmp-message-purge ()
  (setq *dmp-message-indent* 0)
  (setq *dmp-message-str* ""))

(dmp-message-purge)

(message "&tip-top:1015:")

(defun dmp-message-begun ()
  (progn
    (cl-incf *dmp-message-indent*)
    (setq *dmp-message-str* (make-string *dmp-message-indent* ? )))
  )

(dmp-message "&safe-require:1016:")
;;(dmp-message-ended)

(defun dmp-message-ended ()
  (progn
    (cl-decf *dmp-message-indent*)
    (if (< *dmp-message-indent* 0)
        (setq *dmp-message-indent* 0))
    (setq *dmp-message-str* (make-string *dmp-message-indent* ?\ )))
  )

(message "&tip-top:1017:")

(defmacro dmp-assert (test)
  ;;(dmp-assert nil)
  `(condition-case porkpie
       (progn
	 (cl-assert , test)
	 t)
     (error
      (error "*** Boloney Assertion failed test=%s porkpie=%s" , test porkpie))
     ))

(message "&tip-top:1018:")

(defalias 'assert 'dmp-assert)

(defalias 'nilp 'not)

(message "&tip-top:1019:")

(defun dmp-safe--require (feature-505 &optional ANDY)
  (let ((***dmp-messages-welcome-goodbye-on-p*** nil)
        (***dmp-messages-on-p*** t))
    (dmp-message "&tip-top:1020:")
    (dmp-message-begun)
    ;;(dmp-assert (or (eq t ANDY) (nilp ANDY) (stringp ANDY) (numberp ANDY) (symbolp ANDY)))
    (unwind-protect
        (condition-case err
            (progn
              ;;(dmp-message "&tip-top:14020:")
              (if (not (symbolp feature-505))
                  (dmp-message "dmp-error:symbol-must-eval-to-be-a-symbol feature-505=(%s)" feature-505))
              (if feature-505
                  (require feature-505))
              t)
          (error
           ;;(setq debug-on-error t)
           (dmp-message (concat "*** dmp-error:dmp-safe--require failed "
                                "feature-505=%s err=%s ANDY=%s\n")
                        feature-505
                        err
                        ANDY)
           ;;(debug "Amber Dempsey")
           ))
      (dmp-message (format "dmp-safe--require feature-505=%s ANDY=%s" feature-505 ANDY))
      (dmp-message-ended)
      ))
  )
;; NOTE: Eval the line above for to define a defun dmp-safe--require

(progn
  (setq default-directory "~/")
  (setq debug-on-error t)
  (message "&tip-top:1018:")
  )

(defun dmp-print-head-of-list (list)
  ;;(debug)
  (message "*** First 6 elements-of-list: (%s %s %s %s %s %s)"
	   (nth 0 list)
	   (nth 1 list)
	   (nth 2 list)
	   (nth 3 list)
	   (nth 4 list)
	   (nth 5 list)
           ))

(cl-block nil
  (let ((default-directory "~/"))
    (message "&tip-top:1021:")
    ;;(cl-return)
    (setq load-path nil)
    (setq load-path (directory-files-recursively            "~/Downloads/emacs-29.1/lisp/" "" t))
    (setq load-path (cl-delete-if-not 'file-directory-p     load-path))
    ;;(setq load-path (cons "~/Documents/emacs-29.1/lisp"     load-path))
    ;;(setq load-path (mapcar 'expand-file-name             load-path))
    (setq load-path (mapcar 'directory-file-name            load-path))
    (setq load-path (cl-delete-duplicates load-path :test 'string=))
    (message "&tip-top:1022:")
    )
  )

(message "&tip-top:1023:")

(dmp-quote
 (require 'cl-seq)
 ;;(require 'help-fns)
 ;;(require 'cus-load)
 (require 'faces)
 (require 'window)
 (require 'format)
 (require 'tooltip)
 (require 'mouse)
 (require 'isearch)
 )

(progn
  (setq load-path (cons "~/" load-path))
  (require 'includer))

(message "&tip-top:1024:")
(message "Ambilical-Cord: load-path=%s" load-path)
(message "&tip-top:1025:")




[-- Attachment #3: includer.el --]
[-- Type: text/x-emacs-lisp, Size: 93 bytes --]


(message "begun includer.el")

(provide 'includer)
         
(message "ended includer.el")


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

* Re: Please help me debug my Emacs instillation
  2024-02-29  2:43 Please help me debug my Emacs instillation Davin Pearson
@ 2024-03-01 18:48 ` tpeplt
  2024-03-02  1:53   ` Michael Heerdegen via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 3+ messages in thread
From: tpeplt @ 2024-03-01 18:48 UTC (permalink / raw)
  To: Davin Pearson; +Cc: gnu.emacs.help

Davin Pearson <davin.pearson@gmail.com> writes:

> Here is the file runmacs.bat that I use for loading emacs
>
> date
> cd LOCATION
> ./src/emacs -q --load ~/dmp-emacs--yes-init-file.el  --eval "(setq
> debug-on-error t)" --debug-init &
>
> where LOCATION is the location of your emacs executable file.  On my
> computer it is: ~/Downloads/emacs-29.1/
>
> Please copy the attached files dmp-emacs--yes-file.el and includer.el
> to your HOME folder.
>
> The following commands all give an error message like this:
>
> byte-code: Recursive ‘require’ for feature ‘semantic’
>
> Here is a list of the commands that generate the above-mentioned error:
>
> M-%
> M-/
> M-.
> C-h a
> C-s
> C-r
> M-C-s
> M-C-r
>
> Why doesn't it show a backtrace since I have --debug-init on the command
> line?
>

Having tried those steps, I did not get the resulting error that you are
seeing.  Instead, there was a different error.

I am running Emacs 29.2 on GNU/Linux.  Part of the difference in our
results could be related to a difference is Emacs versions or operating
systems.

Some steps for you to try:

1. Start Emacs with $ emacs -q

2. Read the file ~/dmp-emacs--yes-init-file.el:

   C-x f ~/dmp-emacs--yes-init-file.el RET

3. Note that the major mode for this file Elisp.  There will be an entry
added to the menu bar for ‘Emacs-Lisp’.  Click on that entry and find
the sub-entry ‘Byte-compile This File’.  Click on that entry to
compile your file’s Emacs Lisp code.  This will result in a
*Compile-Log* buffer that contains a series of warning and/or error
messages.  What those messages will be depends on the version of Emacs
you are running.  You should read through that buffer and resolve all
error messages.  You might also want to resolve the warning messages so
that when you compile this file in the future you will not need to scan
through warning messages in order to find compilation errors.  Note that
when you switch your focus to the *Compile-Log* buffer, the menu line
will change from displaying an Emacs-Lisp menu entry to a Compile menu
entry.  You can use this to navigate through the *Compile-Log* message,
but a simple practice is to type ‘n’ (for next message) or ‘p’ (for
previous message).  Unfortunately, these keys are not listed in the
‘Compile’ menu.

4. Once you have resolved the compiler errors, you should consider
running the Emacs linter on the file.  This is also available from the
‘Emacs-Lisp’ menu: Emacs-Lisp -> Linting -> Lint Buffer
This will produce both warning and error messages.  Some of the warning
messages might be safely ignored.

5. After steps 3 and 4, you should be able to "walk through" your file’s
Elisp buffer (C-M-f) and evaluate each one (C-x C-e) and check to see
that the expressions give expected results.  What order you do this in
depends on how you have organized your file.  You should start with the
least dependent expressions and work up to the more dependent
expressions.

6. Add docstrings to your definitions.  This will help you in the future
when you want to look up what a given definition is expected to do, and
if you need to ask for help from others, it will help them to understand
what the definitions are intended for.

7. If you have not read the introduction to Emacs Lisp, it is available
in the ‘Help’ entry of the menu line under ‘More Manuals’ ->
‘Introduction to Emacs Lisp’.

--



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

* Re: Please help me debug my Emacs instillation
  2024-03-01 18:48 ` tpeplt
@ 2024-03-02  1:53   ` Michael Heerdegen via Users list for the GNU Emacs text editor
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Heerdegen via Users list for the GNU Emacs text editor @ 2024-03-02  1:53 UTC (permalink / raw)
  To: help-gnu-emacs

tpeplt <tpeplt@gmail.com> writes:

> Some steps for you to try:
> [...]

I would also have a look, or even start with, the heavy manipulations of
`load-path' in your init file, completely redefining the complete
variable, throwing everything away, even the things that have already
been loaded.

Michael.




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

end of thread, other threads:[~2024-03-02  1:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-29  2:43 Please help me debug my Emacs instillation Davin Pearson
2024-03-01 18:48 ` tpeplt
2024-03-02  1:53   ` Michael Heerdegen via Users list for the GNU Emacs text editor

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