Page 15 of 23

Re: Emacs tips and tricks

Posted: Thu Nov 19, 2015 11:00 am
by GekkoP
I'll just drop this here and go hide: https://github.com/iqbalansari/emacs-emojify

Re: Emacs tips and tricks

Posted: Wed Nov 25, 2015 8:10 pm
by GekkoP
Since this has been getting a lot of attention lately, this is what I did:

Code: Select all

sudo apt-get install gnutls-bin ca-certificates

Code: Select all

(require 'package)
(setq package-enable-at-startup nil)
(setq package-archives
      `(("gnu"   . "https://elpa.gnu.org/packages/")
        ("melpa" . "https://melpa.org/packages/")))
(package-initialize)

Code: Select all

;; Verify secure connections
(setq gnutls-verify-error t
      tls-checktrust t)

(unless (gnutls-available-p)
  (run-with-idle-timer
   2 nil
   (lambda ()
     (lwarn 'emacs
            :warning
            "GNUTLS is missing!  Certificate validation _not_ configured"))))

Re: Emacs tips and tricks

Posted: Wed Nov 25, 2015 8:38 pm
by franksinistra
^ I almost forgot to tell anyone this. If anyone (other than me and both rocking pids' awesome kermacs and frequently stealing gekko's tricks now and then.) read this, the above tricks won't work in kermacs... simply because there isn't a gnutls package :) . I haven't tried the usual 'make DESTDIR=/$kermacs' thingie so not sure it'll work.

Re: Emacs tips and tricks

Posted: Wed Nov 25, 2015 9:39 pm
by pidsley
^ dammit. I thought I added gnutls. It appears to be switched on in the buildroot config. Let me check emacs.

(edit) yep -- it's an emacs switch. Try rebuilding emacs. I can't seem to switch it on, but I may be missing some -dev libs or something else random.

Re: Emacs tips and tricks

Posted: Wed Nov 25, 2015 10:19 pm
by franksinistra
^ ahhhh thanks for correcting me, Pids! my bad. Yeah i'll re-investigate it (and probably re-build it) later, will try to get some sleep first. :)

Re: Emacs tips and tricks

Posted: Wed Nov 25, 2015 10:54 pm
by pidsley
^ I could be completely wrong. It looks like libgnutls.so is in kermacs, but that doesn't mean it works. Let me know what you find out.

(this is what happens when I build something I can't test properly)

(edit) I finally got emacs to build --with-gnutls (I was missing some dev libs, as I suspected) and installed on Kermacs. I also had to copy over some libs from a working Debian install. Now that I know what's missing, I might be able to add those libs to buildroot, but I probably won't. You guys should be able to use the make install method.

Re: Emacs tips and tricks

Posted: Thu Nov 26, 2015 9:26 am
by GekkoP
^ I'll try that.
I forgot to mention I did that on my usual Lacipecsenye, sorry.

Re: Emacs tips and tricks

Posted: Tue Dec 01, 2015 3:27 pm
by GekkoP
https://github.com/webframp/sicp-info

The Wizard Book converted to info format, for all your Emacs pleasure. Install it from MELPA, then C-h i and you're set to wonderland.

Image

Re: Emacs tips and tricks

Posted: Tue Dec 01, 2015 11:55 pm
by franksinistra
^ Greatttt!

Now for you Clojurists, recent development of figwheel and CIDER allowed you to run cljs-repl inside Emacs (meaning you don't need to do separate lein figwheel process on the terminal and cider-connect in Emacs)

The code below is the approved way of using it (put it on your .emacs) from https://github.com/bhauman/lein-figwhee ... thin-NRepl :

Code: Select all

(defun cider-figwheel-repl ()
  (interactive)
  (save-some-buffers)
  (with-current-buffer (cider-current-repl-buffer)
    (goto-char (point-max))
    (insert "(require 'figwheel-sidecar.repl-api)
             (figwheel-sidecar.repl-api/start-figwheel!) ; idempotent
             (figwheel-sidecar.repl-api/cljs-repl)")
    (cider-repl-return)))

(global-set-key (kbd "C-c C-f") 'cider-figwheel-repl)
You have to adjust your project.clj file (the figwheel wiki example is somewhat unclear). Here's my example project.clj file:

https://gist.github.com/franksn/7bd25bb7b75018d83f6b

You also need to insert a few lines in your .lein/profiles.clj file (look at the code below), especially if you don't want to force others to use cider. Don't forget to remove the same section in your project.clj file:

Code: Select all

{ :repl {:plugins [[cider/cider-nrepl "0.10.0-SNAPSHOT"]]}
note: You shouldn't put the :repl option inside the :user option (as suggested by cider wiki). It's guaranteed to make your leiningen process slower, as it'll load cider everytime you run any leiningen task.


For a less cluttered (minimal) way of developing things in Clojure, you might be interested in https://github.com/boot-clj/boot

Re: Emacs tips and tricks

Posted: Wed Dec 02, 2015 9:23 am
by GekkoP
^ Thanks frank. I still have to learn how to do things in ClojureScript, but fighweel is truly cool.

Re: Emacs tips and tricks

Posted: Wed Dec 09, 2015 2:28 pm
by GekkoP

Re: Emacs tips and tricks

Posted: Wed Dec 09, 2015 5:06 pm
by machinebacon
^ works perfectly, thank you!

Re: Emacs tips and tricks

Posted: Fri Dec 18, 2015 3:51 pm
by GekkoP

Re: Emacs tips and tricks

Posted: Wed Dec 30, 2015 10:39 am
by GekkoP
I find myself often in need of translations from Italian to English, sometimes viceversa too. I loathe Google Translator, because I prefer a good old dictionary explaining more about the word I am looking for, especially the different use cases.

So I came up with this solution:

Code: Select all

;;;###autoload
(defun custom--wordreference (languages &optional word)
  "Use given LANGUAGES to translate WORD or prompted text with WordReference."
  (browse-url
   (concat
    "http://www.wordreference.com/" languages "/"
    (if (stringp word)
        (downcase word)
      (downcase (read-string "WordReference: "))))))

;;;###autoload
(defun custom--wordreference-at-point (languages)
  "Use `custom--wordreference' with LANGUAGES to translate word at point."
  (custom--wordreference languages
                         (substring-no-properties
                          (thing-at-point 'word))))

(defun custom-wordreference-iten ()
  "Use `custom--wordreference' to translate IT>EN."
  (interactive)
  (custom--wordreference "iten"))

(defun custom-wordreference-enit ()
  "Use `custom--wordreference' to translate EN>IT."
  (interactive)
  (custom--wordreference "enit"))

(defun custom-wordreference-iten-at-point ()
  "Use `custom--wordreference-at-point' to translate IT>EN."
  (interactive)
  (custom--wordreference-at-point "iten"))

(defun custom-wordreference-enit-at-point ()
  "Use `custom--wordreference-at-point' to translate EN>IT."
  (interactive)
  (custom--wordreference-at-point "enit"))
It would be better to parse the search result from WordReference right into an Emacs buffer, but I'm not that good. You can change the languages and use whatever combination WordReference offers.

Re: Emacs tips and tricks

Posted: Thu Dec 31, 2015 4:22 am
by machinebacon
A good idea to use WordReference, is there a reason you don't like to use offline dictionaries, like dictd+dictionary, and then use dictionary.el, as in http://www.emacswiki.org/emacs/DictMode or lookup.el

Probably because you can access more than one dict (direction) using separate functions.

Just asking, because I often use Emacs on my Eeepc without an internet connection alive. I use dictionary and word definition lookup through small wrappers.

Re: Emacs tips and tricks

Posted: Thu Dec 31, 2015 10:23 am
by GekkoP
I use WordNet when I need an offline dictionary, using the great wordnut package:

Code: Select all

(use-package wordnut ; Interface to WordNet
  :ensure t
  :bind (("C-c a L d" . wordnut-search)
         ("C-c a L D" . wordnut-lookup-current-word)))
I have to check if your solution goes well with translations. If so, I'll definitely go with an offline solution.

Re: Emacs tips and tricks

Posted: Thu Dec 31, 2015 2:13 pm
by machinebacon
Let me know how it goes, I have not tried to integrate it as module, but it should work quite easily (IMO). "dict -d <dictionary>" allows for more than one dictionary installed, and it is really, really quick.

Re: Emacs tips and tricks

Posted: Tue Jan 05, 2016 5:09 pm
by GekkoP
https://github.com/lujun9972/el-start-menu

Another step on the path to Emacs OS?

Re: Emacs tips and tricks

Posted: Sat Jan 23, 2016 10:45 am
by GekkoP
Emacs will come with xwidget support, but you can try it right about now: http://emacsninja.com/posts/on-transcen ... rders.html

Re: Emacs tips and tricks

Posted: Wed Jan 27, 2016 5:27 am
by machinebacon
^ looks promising, I really really want to have webkit in Emacs without deepin/lazycat's bloat on top :D