mirror of
				https://github.com/larstvei/dot-emacs.git
				synced 2025-11-04 09:20:11 +00:00 
			
		
		
		
	use-package macOS stuff
That was the last of the packages!
This commit is contained in:
		
							parent
							
								
									a3a859cba1
								
							
						
					
					
						commit
						0441d32ae8
					
				
							
								
								
									
										73
									
								
								init.org
									
									
									
									
									
								
							
							
						
						
									
										73
									
								
								init.org
									
									
									
									
									
								
							@ -200,49 +200,64 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  #+end_src
 | 
					  #+end_src
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  The configuration assumes that the packages listed below are installed. To
 | 
					* Mac OS X
 | 
				
			||||||
  ensure we install missing packages if they are missing.
 | 
					
 | 
				
			||||||
 | 
					  I run this configuration mostly on macOS, so we need a couple of settings to
 | 
				
			||||||
 | 
					  make things work smoothly. I use the =Command=-key as the =Meta=-key, Freeing
 | 
				
			||||||
 | 
					  up the =Option=-key, which I need for typing Norwegian characters on a US
 | 
				
			||||||
 | 
					  keyboard. In addition, it is more comfortable.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  I try to minimize the use of frames. The native compilation gives a lot of
 | 
				
			||||||
 | 
					  warnings, but they seem safe to ignore.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  #+begin_src emacs-lisp
 | 
					  #+begin_src emacs-lisp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  (let* ((package--builtins nil)
 | 
					 | 
				
			||||||
         (packages
 | 
					 | 
				
			||||||
          '()))
 | 
					 | 
				
			||||||
  (when (memq window-system '(mac ns))
 | 
					  (when (memq window-system '(mac ns))
 | 
				
			||||||
      (push 'exec-path-from-shell packages)
 | 
					    (setq mac-option-modifier nil
 | 
				
			||||||
      (push 'reveal-in-osx-finder packages))
 | 
					          mac-command-modifier 'meta
 | 
				
			||||||
    (let ((packages (seq-remove 'package-installed-p packages)))
 | 
					          ns-pop-up-frames nil
 | 
				
			||||||
      (when packages
 | 
					          native-comp-async-report-warnings-errors nil))
 | 
				
			||||||
        ;; Install uninstalled packages
 | 
					 | 
				
			||||||
        (package-refresh-contents)
 | 
					 | 
				
			||||||
        (mapc 'package-install packages))))
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  #+end_src
 | 
					  #+end_src
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* Mac OS X
 | 
					  The package [[https://github.com/purcell/exec-path-from-shell][exec-path-from-shell]] synchronizes environment variables from the
 | 
				
			||||||
 | 
					  shell to Emacs. This makes it a lot easier to deal with external programs on
 | 
				
			||||||
  I run this configuration mostly on Mac OS X, so we need a couple of settings
 | 
					  macOS.
 | 
				
			||||||
  to make things work smoothly. In the package section =exec-path-from-shell=
 | 
					 | 
				
			||||||
  is included (only if you're running OS X), this is to include
 | 
					 | 
				
			||||||
  environment-variables from the shell. It makes using Emacs along with
 | 
					 | 
				
			||||||
  external processes a lot simpler. I also prefer using the =Command=-key as
 | 
					 | 
				
			||||||
  the =Meta=-key.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
  #+begin_src emacs-lisp
 | 
					  #+begin_src emacs-lisp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  (when (memq window-system '(mac ns))
 | 
					  (use-package exec-path-from-shell
 | 
				
			||||||
    (setq ns-pop-up-frames nil
 | 
					    :if (memq window-system '(mac ns))
 | 
				
			||||||
          mac-option-modifier nil
 | 
					    :config
 | 
				
			||||||
          mac-command-modifier 'meta
 | 
					    (exec-path-from-shell-initialize))
 | 
				
			||||||
          native-comp-async-report-warnings-errors nil)
 | 
					
 | 
				
			||||||
    (exec-path-from-shell-initialize)
 | 
					  #+end_src
 | 
				
			||||||
    (when (fboundp 'mac-auto-operator-composition-mode)
 | 
					
 | 
				
			||||||
      (mac-auto-operator-composition-mode 1))
 | 
					  I had some problems with Dired, and this seems to have solved it. I /think/
 | 
				
			||||||
    (require 'ls-lisp)
 | 
					  the solutions was from [[https://stackoverflow.com/questions/4076360/error-in-dired-sorting-on-os-x][here]], and my problems were related, but not the same.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  #+begin_src emacs-lisp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  (use-package ls-lisp
 | 
				
			||||||
 | 
					    :ensure nil
 | 
				
			||||||
 | 
					    :if (memq window-system '(mac ns))
 | 
				
			||||||
 | 
					    :config
 | 
				
			||||||
    (setq ls-lisp-use-insert-directory-program nil))
 | 
					    (setq ls-lisp-use-insert-directory-program nil))
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  #+end_src
 | 
					  #+end_src
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  It is useful to be able to occasionally open the file associated with a
 | 
				
			||||||
 | 
					  buffer in macOS Finder.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  #+begin_src emacs-lisp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  (use-package reveal-in-osx-finder
 | 
				
			||||||
 | 
					    :if (memq window-system '(mac ns)))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  #+end_src
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  #+RESULTS:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* Sane defaults
 | 
					* Sane defaults
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  These are what /I/ consider to be saner defaults.
 | 
					  These are what /I/ consider to be saner defaults.
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user