!ZmUSesoOjmVsKbzFbp:nixos.org

Nix Emacs

747 Members
All things Nix/Emacs! https://github.com/nix-community/emacs-overlay | For Doom Emacs: https://matrix.to/#/#doom-emacs:nixos.org169 Servers

Load older messages


SenderMessageTime
9 Oct 2024
@yisraeldov:matrix.orgyisraeldov
In reply to @john:friendsgiv.ing

I use two methods which can be selected for each host with an option:

1. On my main laptop where I may make more frequent edits to my emacs config I let doom/emacs handle its own dependencies. I roughly follow the config from the doom developer.
2. On other systems where I'm not regularly changing my config I use doom-nix-unstraightened, which essentially handles as much as possible through nix. This pulls my doom config from github, so a commit+push+nix update is then needed for any change to take effect. OTOH I can run my emacs config on a new system in a fully automated way and updates to my system also update doom and emacs packages. I've also had one emacs package want to create files in its install location at runtime which fails when that's the nix store (which is annoying).

In hlissner's dot files where does he install doom and where is the doom config ?
14:24:16
@john:friendsgiv.ingjohn
In reply to @yisraeldov:matrix.org
In hlissner's dot files where does he install doom and where is the doom config ?
Ah, it looks like he removed the activation script. This commit still has it. TBH this isn't so different from just putting the dotfiles in place by hand. It doesn't run doom init/sync etc.
21:25:33
@lunik1:lunik.onelunik1as much as in principle I don't like the idea, I find it much easier to manage doom outside of nix22:18:07
@lunik1:lunik.onelunik1 @yisraeldov doom also has a discourse, though it's a little quiet 22:19:10
10 Oct 2024
@cf11:0x2c.orgchaoflow lunik1: yes, likewise. It is very little practical gain for a lot of trouble. There is the occasional need to run pdf-tools-install in emacs which I can live with. 04:20:47
@enkaiyuegure:matrix.orgEnkaiyuegure joined the room.13:26:29
11 Oct 2024
@daniel573:matrix.orgDaniel Kahlenberg

I'm starting to use emacs for writing english language texts and want to complete words from a dictionary. Pretty new in the game I only heard emacs packages cape in combo with corfu got what so I figured the examples on their githubs to make a config.
Problem with that is I only get completions suggested by a mode called dabbrev but not by cape-dict from the dict I configured to be:

cape-dict-file is a variable defined in ‘cape.el’.

Its value is
"/nix/store/dc8agg8yqs9hjaj6amvcr48vzwsbw6wr-scowl-2020.12.07/share/dict/words.txt"
Original value was
"/usr/share/dict/words"

Path to dictionary word list file.
This variable can also be a list of paths or
a function returning a single or more paths.

  You can customize this variable.

[back]

Has someone got this working ?

07:50:56
@cf11:0x2c.orgchaoflow Daniel Kahlenberg: Did you see the cape-dabbrev mention in https://github.com/minad/corfu 08:49:51
@daniel573:matrix.orgDaniel Kahlenberg
In reply to @cf11:0x2c.org
Daniel Kahlenberg: Did you see the cape-dabbrev mention in https://github.com/minad/corfu

this is my config so far, but cape-dabbrev works just it doesn't complete based on candidates from the words.txt file:

;; /nix/store/m2rhlf0jya68rb3cynf86pfpgnfiv5vp-default.el
;; /nix/store/dc8agg8yqs9hjaj6amvcr48vzwsbw6wr-scowl-2020.12.07/share/dict/words.txt
;; /nix/store/4hhp7wwhsn0vwrn0wfy59dgghb2mw1c8-hunspell-dict-de-de-j3e-20161207/share/hunspell/de_DE.aff
;; my legacy stolen configs https://github.com/573/nix-config-1/commit/b534362097b3ca0d4011561b1085de40df0a7292#diff-9038ab981032e7f24c7ee557adf7d2ea5fbb6702153e6242d80dc61b3e256051
(message "https://www.gnu.org/software/emacs/manual/html_node/efaq/Learning-how-to-do-something.html")
(message "configuration is %S" "templated from home/misc/emacs.el: /nix/store/m2rhlf0jya68rb3cynf86pfpgnfiv5vp-default.el see C-x b *Messages* for the real path of emacs.el")

;; A simple way to manage personal keybindings.
;; needed by use-package
;; M-x describe-personal-keybindings
 (use-package bind-key
   :demand t)

;; stolen from here:
;; https://github.com/minad/corfu?tab=readme-ov-file#configuration (example configuration)
(use-package corfu
  ;; Optional customizations
  ;; :custom
  ;; (corfu-cycle t)                ;; Enable cycling for `corfu-next/previous'
   (corfu-auto t)                 ;; Enable auto completion
  ;; (corfu-separator ?\s)          ;; Orderless field separator
  ;; (corfu-quit-at-boundary nil)   ;; Never quit at completion boundary
  ;; (corfu-quit-no-match nil)      ;; Never quit, even if there is no match
  ;; (corfu-preview-current nil)    ;; Disable current candidate preview
  ;; (corfu-preselect 'prompt)      ;; Preselect the prompt
  ;; (corfu-on-exact-match nil)     ;; Configure handling of exact matches
  ;; (corfu-scroll-margin 5)        ;; Use scroll margin

  ;; Enable Corfu only for certain modes. See also `global-corfu-modes'.
  ;; :hook ((prog-mode . corfu-mode)
  ;;        (shell-mode . corfu-mode)
  ;;        (eshell-mode . corfu-mode))

  ;; Recommended: Enable Corfu globally.  This is recommended since Dabbrev can
  ;; be used globally (M-/).  See also the customization variable
  ;; `global-corfu-modes' to exclude certain modes.
  :init
  (global-corfu-mode))

;; A few more useful configurations...
(use-package emacs
  :custom
  ;; TAB cycle if there are only few candidates
  ;; (completion-cycle-threshold 3)

  ;; Enable indentation+completion using the TAB key.
  ;; `completion-at-point' is often bound to M-TAB.
  (tab-always-indent 'complete)

  ;; Emacs 30 and newer: Disable Ispell completion function. As an alternative,
  ;; try `cape-dict'.
  ;; (text-mode-ispell-word-completion nil)

  ;; Hide commands in M-x which do not apply to the current mode.  Corfu
  ;; commands are hidden, since they are not used via M-x. This setting is
  ;; useful beyond Corfu.
  (read-extended-command-predicate #'command-completion-default-include-p))

;; Use Dabbrev with Corfu!
;;(use-package dabbrev
  ;; Swap M-/ and C-M-/
;;  :bind (("M-/" . dabbrev-completion)
;;         ("C-M-/" . dabbrev-expand))
;;  :config
  ;;(add-to-list 'dabbrev-ignored-buffer-regexps "\\` ")
  ;; Since 29.1, use `dabbrev-ignored-buffer-regexps' on older.
;;  (add-to-list 'dabbrev-ignored-buffer-modes 'doc-view-mode)
;;  (add-to-list 'dabbrev-ignored-buffer-modes 'pdf-view-mode)
;;  (add-to-list 'dabbrev-ignored-buffer-modes 'tags-table-mode))

;; stolen from here:
;; https://github.com/minad/cape?tab=readme-ov-file#configuration
;; Enable Corfu completion UI
;; See the Corfu README for more configuration tips.
;; Add extensions
(use-package cape
  ;; Bind prefix keymap providing all Cape commands under a mnemonic key.
  ;; Press C-c p ? to for help.
  :bind ("C-c p" . cape-prefix-map) ;; Alternative keys: M-p, M-+, ...
  ;; Alternatively bind Cape commands individually.
  ;; :bind (("C-c p d" . cape-dabbrev)
  ;;        ("C-c p h" . cape-history)
  ;;        ("C-c p f" . cape-file)
  ;;        ...)
  :init
  ;; Add to the global default value of `completion-at-point-functions' which is
  ;; used by `completion-at-point'.  The order of the functions matters, the
  ;; first function returning a result wins.  Note that the list of buffer-local
  ;; completion functions takes precedence over the global list.
  (add-hook 'completion-at-point-functions #'cape-dabbrev)
  (add-hook 'completion-at-point-functions #'cape-file)
  (add-hook 'completion-at-point-functions #'cape-elisp-block)
  (add-hook 'completion-at-point-functions #'cape-dict)
  ;; ...
  :config
  (setq cape-dict-file "/nix/store/dc8agg8yqs9hjaj6amvcr48vzwsbw6wr-scowl-2020.12.07/share/dict/words.txt")
  ;; https://github.com/minad/cape?tab=readme-ov-file#super-capf---merging-multiple-capfs
;; Merge the dabbrev, dict and keyword capfs, display candidates together.
;;(setq-local completion-at-point-functions
;;            (list (cape-capf-super #'cape-dabbrev #'cape-dict #'cape-keyword)))

;; Alternative: Define named Capf instead of using the anonymous Capf directly
(defun cape-dabbrev-dict-keyword ()
  (cape-wrap-super #'cape-dabbrev #'cape-dict #'cape-keyword))
(setq-local completion-at-point-functions (list #'cape-dabbrev-dict-keyword)))


;;M-? triggers correction for the misspelled word before point.
;;C-u M-? triggers correction for the entire buffer.
;;C-u C-u M-? forces correction of the word at point, even if it is not misspelled.
(use-package jinx
  :bind (("M-?" . jinx-correct)
	 ("M-C-k" . jinx-languages))
  :init
  (add-hook 'emacs-startup-hook #'global-jinx-mode))

;; TODO https://github.com/jiahaoli95/el-fly-indent-mode.el


;; stolen here: https://blog.binchen.org/posts/autocomplete-with-a-dictionary-with-hippie-expand.html
;; Technical details
;;
;;    based on ac-ispell
;;    lazy load of ispell-mode to speed Emacs startup
;;    add a fallback dictionary "english-words.txt" so autocompletion never fails
;;    `ispell-lookup-words` or `lookup-words` simply does grep thing, so english-words.txt is just a plain text file.
;;(global-set-key (kbd "M-/") 'hippie-expand)

;; The actual expansion function
(defun try-expand-by-dict (old)
  ;; old is true if we have already attempted an expansion
  (unless (bound-and-true-p ispell-minor-mode)
    (ispell-minor-mode 1))

  ;; /nix/store/dc8agg8yqs9hjaj6amvcr48vzwsbw6wr-scowl-2020.12.07/share/dict/words.txt is the fallback dicitonary
  (if (not ispell-alternate-dictionary)
      (setq ispell-alternate-dictionary (file-truename "/nix/store/dc8agg8yqs9hjaj6amvcr48vzwsbw6wr-scowl-2020.12.07/share/dict/words.txt")))
  (let ((lookup-func (if (fboundp 'ispell-lookup-words)
                       'ispell-lookup-words
                       'lookup-words)))
    (unless old
      (he-init-string (he-lisp-symbol-beg) (point))
      (if (not (he-string-member he-search-string he-tried-table))
        (setq he-tried-table (cons he-search-string he-tried-table)))
      (setq he-expand-list
            (and (not (equal he-search-string ""))
                 (funcall lookup-func (concat (buffer-substring-no-properties (he-lisp-symbol-beg) (point)) "*")))))
    (if (null he-expand-list)
      (if old (he-reset-string))
      (he-substitute-string (car he-expand-list))
      (setq he-expand-list (cdr he-expand-list))
      t)
    ))

;;(setq hippie-expand-try-functions-list
;;      '(;; try-expand-dabbrev
;;        ;; try-expand-dabbrev-all-buffers
;;        try-expand-by-dict))
08:52:58
@cf11:0x2c.orgchaoflowMy bad, I think it's cape-dict you want and I see you're doing something with that - Note: I don't have that working, yet.09:14:10
@cf11:0x2c.orgchaoflowAre you rolling your own config? Which version of emacs are you using?09:14:26
@cf11:0x2c.orgchaoflowAre you starting to use emacs or are you already familiar with emacs but are starting to use it for english texts?09:15:42
@daniel573:matrix.orgDaniel Kahlenberg
In reply to @cf11:0x2c.org
Are you starting to use emacs or are you already familiar with emacs but are starting to use it for english texts?
Both and I'm rolling my own config using nix (emacs v29.4) you can see a WIP at https://github.com/573/nix-config-1/commit/ac842b8b24dbca952ed2f8fc3a5ba25ae6bdd61b
09:23:10
@cf11:0x2c.orgchaoflowBold move :)09:24:41
@cf11:0x2c.orgchaoflowYou might want to take a look at one of the starter kits https://www.emacswiki.org/emacs/StarterKits -- doomemacs e.g. can also be use as a config framework only, taking it only as inspiration.09:26:14
12 Oct 2024
@steeringwheelrules:tchncs.desteeringwheelrules joined the room.17:30:48
13 Oct 2024
@rs2323:matrix.org@rs2323:matrix.org joined the room.14:16:58
14 Oct 2024
@rs2323:matrix.org@rs2323:matrix.org left the room.16:19:24
@frankc0904:matrix.org@frankc0904:matrix.org joined the room.18:55:30
@frankc0904:matrix.org@frankc0904:matrix.org left the room.19:00:05
17 Oct 2024
@bendlas:matrix.orgbendlas changed their profile picture.17:38:46
18 Oct 2024
@ihar.hrachyshka:matrix.orgIhar Hrachyshka joined the room.21:23:18
20 Oct 2024
@intergalactic-turtle-fucker:arcticfoxes.net@intergalactic-turtle-fucker:arcticfoxes.net joined the room.12:55:44
@intergalactic-turtle-fucker:arcticfoxes.net@intergalactic-turtle-fucker:arcticfoxes.net left the room.12:58:45
@rrix:aelf.landrrix

https://github.com/search?q=repo%3Amelpa%2Fmelpa%20%3Arename&type=code there is a new feature in MELPA recipes that are breaking bbdb melpaBuild builds

22:00:45
@rrix:aelf.landrrix

in 24.05 but not unstable …

22:03:23
@rrix:aelf.landrrix

because the fix wasn't backported

22:05:34
@rrix:aelf.landrrix

:))

22:05:38
@rrix:aelf.landrrix

ok

22:05:43
21 Oct 2024
@artur:glasgow.social(artur 'manuel) changed their display name from (lambda (f l) (format nil "~a ~a")) "Artur" "Manuel" to (artur 'manuel).20:04:55

There are no newer messages yet.


Back to Room ListRoom Version: 6