Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deft-text-mode had uses that deft-extensions doesn't serve... #4

Closed
pobocks opened this issue Jun 19, 2015 · 4 comments
Closed

deft-text-mode had uses that deft-extensions doesn't serve... #4

pobocks opened this issue Jun 19, 2015 · 4 comments

Comments

@pobocks
Copy link

pobocks commented Jun 19, 2015

So, my deft config was as follows: I used deft-file-extension to set the extention to .org, and then used deft-text-mode to trigger a custom minor mode that marked org buffers launched via deft as special.

I used this to do two things: it let me set up a toggle that would kill or bury all deft buffers at once, and second, so that I could inhibit the hook that cleans trailing whitespace.

Without a non-file-extension way to mark deft buffers, I can't think of an easy way to replicate this functionality. Would there be general interest in a PR restoring deft-text-mode for explicit use of attaching a minor mode to deft buffers? Or, alternately, a new variable for same?

@jrblevin
Copy link
Owner

I used to do something similar: My Deft files were all .txt files and so I had deft-text-mode set to markdown-mode. Otherwise, .txt files aren't special and just open in text-mode. With the new deft-extensions approach, I now accomplish this using an auto-mode-alist entry specifically for .txt files in my deft-directory (e.g., ~/deft/):

(add-to-list 'auto-mode-alist '("/deft/.*\\.txt\\'" . markdown-mode))

It seems like you could you do something similar with your special minor mode?

@pobocks
Copy link
Author

pobocks commented Jun 19, 2015

That worked! Don't know why I didn't think of that ;-)

Thanks!

On Thu, Jun 18, 2015 at 11:24 PM, Jason Blevins notifications@github.com
wrote:

I used to do something similar: My Deft files were all .txt files and so I
had deft-text-mode set to markdown-mode. Otherwise, .txt files aren't
special and just open in text-mode. With the new deft-extensions
approach, I now accomplish this using an auto-mode-alist entry
specifically for .txt files in my deft-directory (e.g., ~/deft/):

(add-to-list 'auto-mode-alist '("/deft/.*.txt'" . markdown-mode))

It seems like you could you do something similar with your special minor
mode?


Reply to this email directly or view it on GitHub
#4 (comment).

@jrblevin
Copy link
Owner

Yes, well, I didn't think of it at first either, which is how deft-text-mode came to exist in the first place. I'm happy to retire it now after realizing that it was duplicating functionality. Happy to hear that worked.

@gnowoel
Copy link

gnowoel commented Jan 8, 2016

Brilliant. Adding an auto-mode-alist entry is even better than the original deft-text-mode option, because the major mode for a note would always be consistent, no matter deft-mode is enabled or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants