OS X Yosemite - no styles at emacs welcome screen - macos

I have been installed emacs 25.1 on OS X Yosemite.
brew cask install emacs
Welcome screen looks like:
But must be similar to
So no styles, no pictures.
What am I missing?
UPDATE:
brew install emacs --with-cocoa
Gives the same result.

This behaviour appears to be triggered by the size of the start up screen.
Making the initial start up screen bigger triggers the "fancy splash screen" for me:
emacs -geometry 80x48
Or instead add something to the .emacs file...
;; initial window
(setq initial-frame-alist
'((width . 202) ; character
(height . 60) ; lines
))
;; default/subsequent window
(setq default-frame-alist
'((width . 202) ; character
(height . 60) ; lines
))
(See https://www.emacswiki.org/emacs/FrameSize for more details.)
Alternatively, adjust the function which decides what kind of start up screen to display as described here: https://emacs.stackexchange.com/questions/20976/x11-why-is-the-emacs-logo-image-missing-on-the-welcome-screen

Try brew install emacs --with-cocoa ( brew info emacs for more options ) Or, tap a different formula like emacs-plus that builds Cocoa version by default

Related

How do you set up a pure emacs layered tty stack with 256 colors and mouse support?

I use this layered tty stack to reach emacs on GNU/Linux:
Mac OS X > iTerm2 $ ssh head-node -->
$ screen $ ssh compute-node -->
$ screen $ emacs -nw
Notes:
Mac OS X = Version 10.8.2
iTerm2 = iterm2.com Build 1.0.0.20130319, terminal type = xterm-256color.
screen = GNU Screen, built from git clone git://git.savannah.gnu.org/screen.git with --enable-colors25, run with .screenrc "term xterm-256color"
emacs = Emacs 24.3 built from 24.3 source.
This actually works great, but there are user interface behaviors that I want to modify.
I figure this might be easier if I switch to ...
A pure emacs layered tty stack with 256 colors and mouse support:
Mac OS X > emacs M-x term $ ssh head-node -->
$ [emacs --daemon] emacsclient -nw M-x term $ ssh compute-node -->
$ [emacs --daemon] emacsclient -nw
Which raises these questions ...
What is the best choice for emacs terminal emulation in this situation?
How do I set up TERM and TERMINFO to get 256 colors?
How do I capture/restore window layout in the emacs daemons?
How do I keep track of session context? By this I mean hostname and sub-sessions?
How do I make the mouse work top-to-bottom?
The mouse actually works fine with iTerm2 and this in ~./emacs:
;; Enable iTerm2 mouse support
;; > Preferences > Profiles > Default > Terminal > Enable xterm mouse reporting > check
(unless window-system
(require 'mouse)
(xterm-mouse-mode t)
(global-set-key [mouse-4] '(lambda ()
(interactive)
(scroll-down 1)))
(global-set-key [mouse-5] '(lambda ()
(interactive)
(scroll-up 1)))
(defun track-mouse (e))
(setq mouse-sel-mode t)
)
This leads to a sub-question...
1a. Is there an emacs terminal emulation that produces/forwards xterm mouse events?
Notes:
posed as a group because answers must work together.
tty solutions are required due to bandwidth and personal preference.
emacs tramp is not sufficient, given various other requirements.

Emacs on Mac - how to enter brackets, pipes, #, etc?

I'm quite new to Emacs on my Mac and I have trouble entering signs like: []|{}# etc. Instead the minibuffer shows M-5, M-6 or jumps a word forward (M-l).
I think I got my Emacs here: http://emacsformacosx.com/
and I did install this starter kit: http://kieranhealy.org/emacs-starter-kit.html
(but I hat this problem before)
I know this answer: Unable to type braces and square braces in emacs
but I couldn't get it to work yet.
I use the following -- it will place the Emacs meta key on the Mac CMD key, and free up the ALT key for normal Mac use:
(if (boundp 'ns-command-modifier)
(setq ns-command-modifier 'meta))
(if (boundp 'ns-option-modifier)
(setq ns-option-modifier nil))

For Python code: Does Mac OS X contain an X terminal? (If not, which?)

I can't seem to find an answer on google. Can anyone please check if xterm is installed on Mac OS X by default, or better yet, if the program/link x-terminal-emulator is defined?
The reason I am asking is that I am currently running this python3 code
process = subprocess.Popen ( ['x-terminal-emulator', '-e', 'sh -c "cd"' ] )
(for simplicity, more complicated bash command replaced with cd) and would prefer compatibility with mac. If anyone could also check that this runs gracefully (it should just briefly pop up a new terminal), I'd be obliged.
Otherwise, which terminal should I call for that specific command?
Thanks!
X11 for Mac OS X is installed by default, but it's optional, so you cannot be sure xterm is installed, see http://developer.apple.com/opensource/tools/x11.html
What is always there on a Mac OS X box is the Terminal.app
That works, at least on Lion, if you call 'xterm' specifically (there is no x-terminal-emulator link).

Home / end control characters don't work in emacs under Mac OS X terminal

I'm running emacs from within a terminal window on Mac OS X. From the bash shell at the same terminal, I can use Shift + <Home> and Shift + <end> to go to the beginning and end of the line respectively. When I'm inside emacs, these don't work. I get the error:
M-[ h is undefined
and
M-[ f is undefined
Is this the fault of emacs or the terminal emulator? I can see how to change the control characters that the terminal sends, but as far as I can tell these are the right control characters to send (and it works outside of emacs).
Put these in your .emacs:
(global-set-key (kbd "M-[ h") 'beginning-of-line)
(global-set-key (kbd "M-[ f") 'end-of-line)
I'm pretty sure it's a problem with Terminal.app as I've got some similar problems with it. I don't know how to fix it, but for your particular problem, you can use C-a and C-e to go to the beginning and end of line, respectively.

error in dired sorting on OS X

On OS X 10.5 Emacs 23.2, in dired-mode, if I try to sort by dired-sort-toggle-or-edit with prefix argument --sort=extension or -X, I get:
insert-directory: Listing directory failed but `access-file' worked
and the dired buffer becomes empty. I tried setting
(setq dired-use-ls-dired nil)
but this had no effect. dired-sort-toggle-or-edit and sorting by extension seems to work okay on my Ubuntu box. Anyone have a clue what's going on?
For now, I've also found another solution using ls-lisp
(when (eq system-type 'darwin)
(require 'ls-lisp)
(setq ls-lisp-use-insert-directory-program nil))
The ls that's installed on OS X doesn't support -X or any long arguments like --sort. Setting dired-use-ls-dired won't have any effect; dired will always use ls, but if that variable is non-nil, it will pass --dired to ls.
If you want that type of sorting, you can probably use something like fink to install coreutils, which will provide an ls more like what you're used to in Ubuntu.
Here are the steps for Emacs running on Snow Leopard 10.6.8 using coreutils installed through macports:
NOTE:   My macports installation is different than the generic (/opt/...) -- i.e., I use /macports as the root. Altering the root setup is not required, it is just a personal preference of mine. For vanilla macport installations or alternative setups, adjust the path accordingly.
sudo /macports/bin/port install coreutils
This goes inside the .emacs or init.el:
;; sort directories first
(setq insert-directory-program "/macports/bin/gls")
(setq dired-listing-switches "-aBhl --group-directories-first")
NOTE:   Using a symlink for gls/ls is not recommended because it breaks functionality with macports install and most likely other stuff too.
Alternative installation for users who want more control:
Download: coreutils-8.21.tar.xz from:  http://ftp.gnu.org/gnu/coreutils/
If you do not have a utility to unzip an *.xz file, you can use a utility such as TheUnarchiver3.9.1.
Here is a quick reference to make the coreutils -- I set the installation location to my own personal preference instead of the default:
./configure \
--prefix=/Users/HOME/.0.data/.0.emacs/elpa
make
sudo make install
Insert these into your .emacs or init.el file -- adjust the path accordingly:
;; sort directories first
(setq insert-directory-program "/Users/HOME/.0.data/.0.emacs/elpa/bin/ls")
(setq dired-listing-switches "-aBhl --group-directories-first")
Still happening in 2020! If, like me, you're using brew as your open source package manager, this is the right solution to copy paste in your .emacs file, or wherever you keep your startup customizations:
(when (equal system-type 'darwin)
(setq insert-directory-program "/usr/local/opt/coreutils/libexec/gnubin/ls"))
(I check for the OS because I deploy my Emacs configuration on multiple systems).
Oddly enough, this happened suddenly on a Mojave system on which I routinely use Emacs since forever, and on which I am sure dired was working in the past. I guess that an update broke something that made dired use the correct binary, without having to manually set it.
This is not much different than lawlist's nice answer, but has slightly different information and is tailored to those who use the Nix package manager:
(use-package dired
:custom
;; See http://stackoverflow.com/questions/4115465/emacs-dired-too-much-information
;; NOTE: Just some information worth keeping in mind. More readable dired file
;; size output - consider adding F (make file type obvious), or p (p adds a
;; trailing slash to dirs, but makes moving dirs fail), and G (colorize) too.
(dired-listing-switches "-alh --group-directories-first")
:config
;; [[https://stackoverflow.com/questions/4076360/error-in-dired-sorting-on-os-x][macos - error in dired sorting on OS X - Stack Overflow]]
;; To fix the
;; (error "Listing directory failed but 'access-file' worked")
;; error. Emacs needs to use gnu's ls, which I get through nixpkgs' coreutils.
;; In my config, currently, Emacs is not picking up the path to my nix install
;; ls (todo: fix).
;;
;; Note that, unlike the info at the link provided above,
;; --group-directories-first is not needed to fix this error. I just like to
;; see the directories first in a dired buffer.
(setq insert-directory-program (expand-file-name ".nix-profile/bin/ls"
(getenv "HOME"))))

Resources