<commit_before>;;; core-os.el

(defconst IS-MAC   (eq system-type 'darwin))
(defconst IS-LINUX (eq system-type 'gnu/linux))

 ;; clipboard
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)
      ;; Use a shared clipboard
      select-enable-clipboard t
      select-enable-primary t)


(cond (IS-MAC
       (setq mac-command-modifier 'meta
             mac-option-modifier  'alt
             ;; sane trackpad/mouse scroll settings
             mac-redisplay-dont-reset-vscroll t
             mac-mouse-wheel-smooth-scroll nil
             mouse-wheel-scroll-amount '(5 ((shift) . 2))  ; one line at a time
             mouse-wheel-progressive-speed nil             ; don't accelerate scrolling
             ;; Curse Lion and its sudden but inevitable fullscreen mode!
             ;; NOTE Meaningless to railwaycat's emacs-mac build
             ns-use-native-fullscreen nil
             ;; Don't open files from the workspace in a new frame
             ns-pop-up-frames nil)

       (cond ((display-graphic-p)
              ;; `exec-path-from-shell' is slow, so bring out the cache
              (setq exec-path
                    (or (persistent-soft-fetch 'exec-path "emacs")
                        (and (require 'exec-path-from-shell nil t)
                             (progn (exec-path-from-shell-initialize)
                                    (persistent-soft-store 'exec-path exec-path "emacs")))
                        exec-path)))
             (t
              (when (require 'osx-clipboard nil t)
                (osx-clipboard-mode +1))))

       (after! evil
         ;; On OSX, stop copying each visual state move to the clipboard:
         ;; https://bitbucket.org/lyro/evil/issue/336/osx-visual-state-copies-the-region-on
         ;; Most of this code grokked from:
         ;; http://stackoverflow.com/questions/15873346/elisp-rename-macro
         (when (or (featurep 'mac) (featurep 'ns))
           (advice-add 'evil-visual-update-x-selection :override 'ignore))))

      (IS-LINUX
       ;; nothing yet
       ))

(provide 'core-os)
;;; core-os.el ends here
<commit_msg>core-os: add doc comment to exec-path-from-shell<commit_after>;;; core-os.el

(defconst IS-MAC   (eq system-type 'darwin))
(defconst IS-LINUX (eq system-type 'gnu/linux))

 ;; clipboard
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING)
      ;; Use a shared clipboard
      select-enable-clipboard t
      select-enable-primary t)


(cond (IS-MAC
       (setq mac-command-modifier 'meta
             mac-option-modifier  'alt
             ;; sane trackpad/mouse scroll settings
             mac-redisplay-dont-reset-vscroll t
             mac-mouse-wheel-smooth-scroll nil
             mouse-wheel-scroll-amount '(5 ((shift) . 2))  ; one line at a time
             mouse-wheel-progressive-speed nil             ; don't accelerate scrolling
             ;; Curse Lion and its sudden but inevitable fullscreen mode!
             ;; NOTE Meaningless to railwaycat's emacs-mac build
             ns-use-native-fullscreen nil
             ;; Don't open files from the workspace in a new frame
             ns-pop-up-frames nil)

       ;; A known problem with GUI Emacs on MacOS: it runs in an isolated
       ;; environment, so envvars will be wrong. That includes the PATH Emacs
       ;; picks up. `exec-path-from-shell' fixes this, and its result is cached.
       ;; Run `doom/clear-cache' to regenerate exec-path if PATH changes.
       (cond ((display-graphic-p)
              ;; `exec-path-from-shell' is slow, so bring out the cache
              (setq exec-path
                    (or (persistent-soft-fetch 'exec-path "emacs")
                        (and (require 'exec-path-from-shell nil t)
                             (progn (exec-path-from-shell-initialize)
                                    (persistent-soft-store 'exec-path exec-path "emacs")))
                        exec-path)))
             (t
              (when (require 'osx-clipboard nil t)
                (osx-clipboard-mode +1))))

       (after! evil
         ;; On OSX, stop copying each visual state move to the clipboard:
         ;; https://bitbucket.org/lyro/evil/issue/336/osx-visual-state-copies-the-region-on
         ;; Most of this code grokked from:
         ;; http://stackoverflow.com/questions/15873346/elisp-rename-macro
         (when (or (featurep 'mac) (featurep 'ns))
           (advice-add 'evil-visual-update-x-selection :override 'ignore))))

      (IS-LINUX
       ;; nothing yet
       ))

(provide 'core-os)
;;; core-os.el ends here

{'fraction_non_alphanumeric': 0.10979877515310586, 'fraction_numerical': 0.006561679790026247, 'mean_word_length': 1.8298267326732673, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7610195', 'n_tokens_mistral': 1406, 'n_tokens_neox': 1309, 'n_words': 367}