rougier / nano-emacs

GNU Emacs / N Λ N O - Emacs made simple
GNU General Public License v3.0
2.54k stars 195 forks source link

New to emacs can't get nano to install instead of Prelude #116

Closed gregbunch closed 2 years ago

gregbunch commented 2 years ago

I love NANO!

It's so beautiful. Definitely the most elegant UI on a text editor I've seen

I've used Atom (chlorine), vscode (Calva), IntelliJ (cursive)

I can run it from the terminal with gregbunch@Gregs-iMac nano-emacs % emacs -q -l nano.el

But I can't get it to operate from normal launch of emacs.

My main config is bbatsov's prelude.

I've spent hours on this. I've tried with plain vanilla emacs. Tried with Prelude and Centaur. Adding and deleting configurations and init.els. Googling for answers.

I'm new to emacs. Picked it up a few weeks ago when I began learning Clojure.

There's probably an obvious answer. But I haven't figured it out.

Please help.

rougier commented 2 years ago

Did you install the theme via ELPA?

gregbunch commented 2 years ago

Yes, I did.

I call the theme using M-x load-theme. Three themes show up: nano-light or nano-dark or nano. I've clicked on them and get various responses. With nano-light I can't read the text. With nano-dark I can read the text but it doesn't look like it changed the font or any of the styles

Screen Shot 2022-02-21 at 6 08 30 AM Screen Shot 2022-02-21 at 6 07 28 AM
gregbunch commented 2 years ago

Here's my current .emacs.d/init.el file

;;; init.el --- Prelude's configuration entry point. ;; ;; Copyright (c) 2011-2021 Bozhidar Batsov ;; ;; Author: Bozhidar Batsov bozhidar@batsov.com ;; URL: https://github.com/bbatsov/prelude ;; Version: 1.1.0 ;; Keywords: convenience

;; This file is not part of GNU Emacs.

;;; Commentary:

;; This file simply sets up the default load path and requires ;; the various modules defined within Emacs Prelude.

;;; License:

;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License ;; as published by the Free Software Foundation; either version 3 ;; of the License, or (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ;; Boston, MA 02110-1301, USA.

;;; Code:

;; Added by Package.el. This must come before configurations of ;; installed packages. Don't delete this line. If you don't want it, ;; just comment it out by adding a semicolon to the start of the line. ;; You may delete these explanatory comments.

;; (package-initialize)

(defvar prelude-user (getenv (if (equal system-type 'windows-nt) "USERNAME" "USER")))

(message "[Prelude] Prelude is powering up... Be patient, Master %s!" prelude-user)

(when (version< emacs-version "25.1") (error "[Prelude] Prelude requires GNU Emacs 25.1 or newer, but you're running %s" emacs-version))

;; Always load newest byte code (setq load-prefer-newer t)

;; Define Prelude's directory structure (defvar prelude-dir (file-name-directory load-file-name) "The root dir of the Emacs Prelude distribution.") (defvar prelude-core-dir (expand-file-name "core" prelude-dir) "The home of Prelude's core functionality.") (defvar prelude-modules-dir (expand-file-name "modules" prelude-dir) "This directory houses all of the built-in Prelude modules.") (defvar prelude-personal-dir (expand-file-name "personal" prelude-dir) "This directory is for your personal configuration.

Users of Emacs Prelude are encouraged to keep their personal configuration changes in this directory. All Emacs Lisp files there are loaded automatically by Prelude.") (defvar prelude-personal-preload-dir (expand-file-name "preload" prelude-personal-dir) "This directory is for your personal configuration, that you want loaded before Prelude.") (defvar prelude-vendor-dir (expand-file-name "vendor" prelude-dir) "This directory houses packages that are not yet available in ELPA (or MELPA).") (defvar prelude-savefile-dir (expand-file-name "savefile" user-emacs-directory) "This folder stores all the automatically generated save/history-files.") (defvar prelude-modules-file (expand-file-name "prelude-modules.el" prelude-personal-dir) "This file contains a list of modules that will be loaded by Prelude.")

(unless (file-exists-p prelude-savefile-dir) (make-directory prelude-savefile-dir))

(defun prelude-add-subfolders-to-load-path (parent-dir) "Add all level PARENT-DIR subdirs to the `load-path'." (dolist (f (directory-files parent-dir)) (let ((name (expand-file-name f parent-dir))) (when (and (file-directory-p name) (not (string-prefix-p "." f))) (add-to-list 'load-path name) (prelude-add-subfolders-to-load-path name)))))

;; add Prelude's directories to Emacs's `load-path' (add-to-list 'load-path prelude-core-dir) (add-to-list 'load-path prelude-modules-dir) (add-to-list 'load-path prelude-vendor-dir) (prelude-add-subfolders-to-load-path prelude-vendor-dir)

;; reduce the frequency of garbage collection by making it happen on ;; each 50MB of allocated data (the default is on every 0.76MB) (setq gc-cons-threshold 50000000)

;; warn when opening files bigger than 100MB (setq large-file-warning-threshold 100000000)

;; preload the personal settings from `prelude-personal-preload-dir' (when (file-exists-p prelude-personal-preload-dir) (message "[Prelude] Loading personal configuration files in %s..." prelude-personal-preload-dir) (mapc 'load (directory-files prelude-personal-preload-dir 't "^[^#.].*el$")))

(message "[Prelude] Loading Prelude's core modules...")

;; load the core stuff (require 'prelude-packages) (require 'prelude-custom) ;; Needs to be loaded before core, editor and ui (require 'prelude-ui) (require 'prelude-core) (require 'prelude-mode) (require 'prelude-editor) (require 'prelude-global-keybindings)

;; macOS specific settings (when (eq system-type 'darwin) (require 'prelude-macos))

;; Linux specific settings (when (eq system-type 'gnu/linux) (require 'prelude-linux))

;; WSL specific setting (when (and (eq system-type 'gnu/linux) (getenv "WSLENV")) (require 'prelude-wsl))

;; Windows specific settings (when (eq system-type 'windows-nt) (require 'prelude-windows))

(message "[Prelude] Loading Prelude's additional modules...")

;; the modules (if (file-exists-p prelude-modules-file) (load prelude-modules-file) (message "[Prelude] Missing personal modules file %s" prelude-modules-file) (message "[Prelude] Falling back to the bundled example file sample/prelude-modules.el") (message "[Prelude] You should copy this file to your personal configuration folder and tweak it to your liking") (load (expand-file-name "sample/prelude-modules.el" user-emacs-directory)))

;; config changes made through the customize UI will be stored here (setq custom-file (expand-file-name "custom.el" prelude-personal-dir))

;; load the personal settings (this includes `custom-file') (when (file-exists-p prelude-personal-dir) (message "[Prelude] Loading personal configuration files in %s..." prelude-personal-dir) (mapc 'load (delete prelude-modules-file (directory-files prelude-personal-dir 't "^[^#.].*\.el$"))))

(message "[Prelude] Prelude is ready to do thy bidding, Master %s!" prelude-user)

;; Patch security vulnerability in Emacs versions older than 25.3 (when (version< emacs-version "25.3") (with-eval-after-load "enriched" (defun enriched-decode-display-prop (start end &optional param) (list start end))))

(prelude-eval-after-init ;; greet the use with some useful tip (run-at-time 5 nil 'prelude-tip-of-the-day))

;;; init.el ends here

gregbunch commented 2 years ago

Note. in Prelude's original init ;; (package-initialize) is commented out. I've tried removing the ;; and got an error code the next time I launched emacs. And, it didn't seem to have any effect on loading NANO

I am able to run NANO if I launch it through the browser from dir nano-emacs emacs -q -l nano.el

It's lovely!

Thanks again

Screen Shot 2022-02-21 at 6 22 42 AM
rougier commented 2 years ago

Great! I think nano theme might not be compatible with prelude and this might be the reason.

gregbunch commented 2 years ago

So, should I start over with plain vanilla emacs? I continue to use your editor. But each time I restart, I have to reset everything. Thanks

rougier commented 2 years ago

Sorry for delay. But yes, best is to start from a vanilla emacs and add things step by step. It'll be also useful fir debug.

gregbunch commented 2 years ago

I reset to plain vanilla. Installed straight.el. Still not getting nano to load when I launch emacs. Below is the current .emacs.d/init.el file


(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 5))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

(straight-use-package
 '(nano-emacs :type git :host github :repo "rougier/nano-emacs"))
(require 'nano-layout)
(straight-use-package 'nano-theme)
(straight-use-package 'nano-agenda)
(straight-use-package 'nano-modeline)
rougier commented 2 years ago

Can you first test nano-theme only ?

gregbunch commented 2 years ago

Finally got it to work. It's beautiful!

gregbunch commented 1 year ago

Is there any possibility you could do this live with me on zoom. I can't tell you how many hours I've spent on this. Yesterday, alone, I spent 3- 4 hours without success. I'm not normally this stupid...

I'm available right now and for most of the rest of the day. 

On March 29, 2022, GitHub @.***> wrote:

Can you first test nano-theme only ?

— Reply to this email directly, view it on GitHub https://github.com/rougier/nano-emacs/issues/116#issuecomment- 1081957950, or unsubscribe https://github.com/notifications/unsubscribe- auth/APTKIMIHHULCZB5E2X3RC63VCMJBNANCNFSM5O4MAO7A. You are receiving this because you authored the thread.Message ID: @.***>

rougier commented 1 year ago

Hi Greg,

Best is to contact via email such that you can describe your problem more precisely and we can try to debug live yes.