Stream

Join this community to post or comment

Mandar Gokhale

Discussion  - 
 
An Emacs quirk that I saw today – we usually think of C-u as providing a numeric prefix argument for a function, i.e. `C-u 10 M-x this-function`. I didn't know, however, that passing `C-u` without an argument would default to 4.(https://www.gnu.org/software/emacs/manual/html_node/elisp/Prefix-Command-Arguments.html).

I tracked this down to simple.el. "C-u runs the command universal-argument, which is an interactive
compiled Lisp function in `simple.el`." Without the comments, it looks like:

```
(defun universal-argument ()
"Begin a numeric argument for the following command."
(interactive)
(setq prefix-arg (list 4))
(universal-argument--mode))
```

Anyone have further comments / insights about this? I wonder if there is a reason if 4 is the default here, and I don't completely understand how the last snippet above works.
20.12 Prefix Command Arguments. Most Emacs commands can use a prefix argument, a number specified before the command itself. (Don't confuse prefix arguments with prefix keys.) The prefix argument is at all times represented by a value, which may be nil , meaning there is currently no prefix ...
4
Moe Bius's profile photoEric Roode's profile photo
6 comments
 
I use that for comment lines sometimes, to separate sections: C-u C-u C-u =
Add a comment...

Felix Albrecht

Discussion  - 
42
10
Ivan Arabadzhiev's profile photoBen Key's profile photo
4 comments
Ben Key
 
As a matter of fact, Bjarne Stroustrup invented the C++ programming language after I attempted to explain to him the language of the universe. Bjarne Stroustrup got a few details wrong of course. But with C++14, most of the problems have been resolved.


----God

Add a comment...

zhijia yuan

Questions  - 
 
I have Emacs 24.4 running on windows 7, I installed Git windows version, and it is in the exec-path, I can run git status in eshell, but whenever I try to run something like git push to a remote repo (on github), i got error message like this:

'exec' is not recognized as an internal or external command,
operable program or batch file.
ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
however, everything is fine if I run git push in a terminal...

I know I can use magit, but I need a package that calls git push by a shell-command call, so magit is not an option here.

I am pretty sure this is common and duplicatable on any windows system
1
zhijia yuan's profile photobin chen's profile photo
4 comments
Add a comment...
 
Myrth color theme updated to ver. 0.2.0
Eye-candy light clear minimalistic EMACS color theme
5
Add a comment...

Leonardo Bighi

Questions  - 
 
 
Can you guys help me with a very basic problem?

I started using org-mode a couple weeks ago, but I could never make the feature of moving subtrees to work for me. That one that you do M-S-up or M-S-down.

Just to avoid repeating myself, I described my problem here on Reddit with pictures. https://www.reddit.com/r/orgmode/comments/4l0vkl/noob_question_orgmovesubtreeup_is_not_working_as/

It's not a long text. Any help is appreciated.

PS: I tried to diagnose why it's happening. I deleted everything from my init.el, but the problem persists.
1
Folmer Fredslund's profile photoLeonardo Bighi's profile photo
3 comments
 
+Yin Hang You are absolutely correct. I was using the wrong keyboard shortcuts, I don't know why.
Add a comment...

Chris Patti

Articles  - 
Nano How-To explaining how to setup a root file system with only emacs.
13
2
Left Right's profile photoNick Alcock's profile photo
3 comments
 
Those libraries are mostly optional -- Eli would be most unhappy if they were mandatory. :)
Add a comment...
 
What config for web-mode most modern and suitable for now? ac-html/yasnippet/emmet/ac-emmet or something else, what setup do you use for web mode?
#Emacs  #Web #Html
1
Yin Hang (Henry)'s profile photoYuriy Pitometsu's profile photo
2 comments
 
After some research, I got this:

;; init-web-mode.el
(add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.tpl\\(\\.php\\)?\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.jsp\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.mustache\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.djhtml\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.html?\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.xhtml?\\'" . web-mode))

(setq web-mode-ac-sources-alist
'(("css" . (ac-source-css-property))
("html" . (ac-source-words-in-buffer ac-source-abbrev))))

;; init-emmet-mode.el
(add-hook 'sgml-mode-hook 'emmet-mode) ;; Auto-start on any markup modes
(add-hook 'html-mode-hook 'emmet-mode)
(add-hook 'nxml-mode-hook 'emmet-mode)
(add-hook 'css-mode-hook 'emmet-mode) ;; enable Emmet's css abbreviation.
(add-hook 'web-mode-hook 'emmet-mode)

;; see http://web-mode.org/

(defun init-setup-emmet-for-web ()
"Check `emmet-mode' for CSS or HTML language and setup `emmet-mode'."
(let ((web-mode-cur-language
(web-mode-language-at-pos)))
(if (string= web-mode-cur-language "css")
(setq emmet-use-css-transform t)
(setq emmet-use-css-transform nil))))

(eval-after-load 'web-mode
'(add-hook 'web-mode-before-auto-complete-hooks 'init-setup-emmet-for-web))

;; init-ac-emmet.el
(add-hook 'sgml-mode-hook 'ac-emmet-html-setup)
(add-hook 'html-mode-hook 'ac-emmet-html-setup)
(add-hook 'css-mode-hook 'ac-emmet-css-setup)
(eval-after-load 'web-mode
'(progn
(nconc (assoc "html" web-mode-ac-sources-alist) '(ac-source-emmet-html-aliases
ac-source-emmet-html-snippets))
(nconc (assoc "css" web-mode-ac-sources-alist) '(ac-source-css-property
ac-source-emmet-css-snippets))))

;; init-ac-html.el
(defun init-setup-ac-for-html ()
"Enable HTML sources for `auto-complete-mode'."
(require 'ac-html)
(require 'ac-html-default-data-provider)
(ac-html-enable-data-provider 'ac-html-default-data-provider)
(ac-html-setup)
(make-local-variable 'ac-sources)
(setq ac-sources (append '(ac-source-html-tag
ac-source-html-attr
ac-source-html-attrv)
ac-sources)))

(add-hook 'html-mode-hook 'init-setup-ac-for-html)

(defun init-setup-ac-for-haml ()
"Enable HAML sources for `auto-complete-mode'."
(require 'ac-haml)
(require 'ac-html-default-data-provider)
(ac-html-enable-data-provider 'ac-html-default-data-provider)
(ac-haml-setup)
(make-local-variable 'ac-sources)
(setq ac-sources (append '(ac-source-haml-tag
ac-source-haml-attr
ac-source-haml-attrv)
ac-sources)))

(add-hook 'haml-mode-hook 'init-setup-ac-for-haml)

(defun init-setup-ac-for-slim ()
"Enable SLIM sources for `auto-complete-mode'."
(require 'ac-slim)
(require 'ac-html-default-data-provider)
(ac-html-enable-data-provider 'ac-html-default-data-provider)
(ac-slim-setup)
(make-local-variable 'ac-sources)
(setq ac-sources (append '(ac-source-slim-tag
ac-source-slim-attr
ac-source-slim-attrv)
ac-sources)))

(add-hook 'slim-mode-hook 'init-setup-ac-for-slim)

(defun init-setup-ac-for-jade ()
"Enable JADE sources for `auto-complete-mode'."
(require 'ac-jade)
(require 'ac-html-default-data-provider)
(ac-html-enable-data-provider 'ac-html-default-data-provider)
(ac-jade-setup)
(make-local-variable 'ac-sources)
(setq ac-sources (append '(ac-source-jade-tag
ac-source-jade-attr
ac-source-jade-attrv)
ac-sources)))

(add-hook 'jade-mode-hook 'init-setup-ac-for-jade)

;; `web-mode' setup

(defun init-setup-ac-for-web ()
"Prepare `auto-complete-mode' for `web-mode'."
(eval-after-load 'ac-html
'(progn
(require 'ac-html)
(require 'ac-html-default-data-provider)
(ac-html-enable-data-provider 'ac-html-default-data-provider)
(ac-html-setup))))

(add-hook 'web-mode-hook 'init-setup-ac-for-web)

(eval-after-load 'web-mode
'(nconc (assoc "html" web-mode-ac-sources-alist) '(ac-source-html-tag
ac-source-html-attr
ac-source-html-attrv)))
Add a comment...

Jackson David

Questions  - 
 
I use Emacs on Windows 8.1. I just updated to Emacs pretest 25.0.94. The startup message is shown below. Part of my init.el is shown below, too. According to the startup message, there exists a void-function named gensym. I use tabbar-ruler, which relys on powerline.
(setq tabbar-ruler-global-tabbar t)
(setq tabbar-ruler-global-ruler nil)
(setq tabbar-ruler-popup-menu t)
(setq tabbar-ruler-popup-toolbar t)
(setq tabbar-ruler-popup-scrollbar t)
(require 'tabbar-ruler)
(global-set-key (kbd "C-c t") 'tabbar-ruler-move)
I googled the situation and found the following link: https://github.com/milkypostman/powerline/issues/40. However, it didn't help.
1
Add a comment...
 
#Emacs dired-based file browser
ranger.el - Bringing the goodness of ranger to dired!
18
2
Yuriy Pitometsu's profile photo
4 comments
 
Or via el-get:
(:name ranger
:description "Bringing the goodness of ranger to dired!"
:type github
:pkgname "ralesi/ranger.el"
:depends (diminish))
Add a comment...

About this community

A community for Emacs lovers. Now you don't have to restrict those emacs posts because your friends and family have no clue what you are talking about!
 
I simply don't get those who use antidepressant medicine. Just start up Emacs and start playing with Melpa, Orgmode or one of the countless other modes. I find it rewarding and I can produce stuff that makes my work life and hobbies easier.
3
1
Nick Alcock's profile photoEric S. Johansson's profile photo
9 comments
 
+Nick Alcock there is a lot of commonality in oral/aural interfaces. One commonality is the bootstrapping process. The other is the need to bypass the keyboard interface and be able to do very invasive and impolite things to application internals
Add a comment...
 
These tutorials on org mode are quick and very clear. Really nice.
19
4
Jim Franklin's profile photo
 
thx, perfect timing! I'm just giving org mode a go this week.
Add a comment...

John Cook

Discussion  - 
 
How to create ASCII art diagrams in org-mode with ditaa
6
Felix Albrecht's profile photoJim Franklin's profile photo
4 comments
 
thx :thumbsup:
Add a comment...
 
Hey Guys,

I'm a new emacs user, so please don't get hard on me, but I've ran into some trouble. This is of course a basic problem but one I can not get the answer too. How do I exit a document and/or an emacs based game without exiting emacs all together.

Sincerely,
Mikey G
1
Adam Sjøgren's profile photoSibtain Naqvi's profile photo
6 comments
 
Just close the buffer/file = C-x k
Or C-h m = to find the proper key to exit.
Add a comment...

bin chen

Packages  - 
 
find-file-in-project v5.0

https://github.com/technomancy/find-file-in-project

find file or directory in project

change log:

- `M-x ffip-show-diff` show the the diff in "*ffip-diff*" buffere where you can open the file corresponding to the diff hunk. For example, you can M-x ffip-show-diff to view the git commit and related files. If you use Mercurial, M-x 5 ffip-show-diff.
7
Add a comment...
 
Anybody got significant performance reducing in shell programs launched in tmux under ansi-term? I use tmux in this case to get properly displayed escape sequences.
#Emacs   #TMux  #GHCi
1
Rob Shinn's profile photoYuriy Pitometsu's profile photo
5 comments
 
+Rob Shinn just checked multi-term. Work like ansi-term: don't show properly ^B, with tmux fine except performance too. No difference. On the screenshot ghci with plain output, without pretty-printing.
Add a comment...

Zak Elep (zakame)

Announcements  - 
 
Philippine Emacs Users' Group had its first meetup last Wednesday:

https://www.facebook.com/events/729492017153864/?active_tab=posts

It was just a simple get-together of some 6 people, I talked a bit about some ways to set up customizing emacs (from .emacs to .emacs.d/init.el and using stuff like use-package, git submodules, and previewing tarsius_' borg,) while Karlo Licudine talked about his experience of using Emacs (having started just a few months ago, and on Window for Haxe programming to boot!)

We'll definitely have a next meetup this July!
1st ever Emacs meetup! Bring your ~/.emacs.d ! * Topics - The many ways of ~/.emacs.d - Custom show-and-tell - What else you guys bring (and time allowing!) About the Venue. Mozilla Community Space Manila. Community Organization. Mozilla Community Space Manila's photo.
1
Add a comment...

Alex Schroeder

Discussion  - 
 
I always keep going back to Planet Emacsen. So many interesting blog posts. Plus, Emacs News by +Sacha Chua. Also, not too active. Perfect for me. http://planet.emacsen.org
weather from wttr.in (use-package wttrin :ensure t :commands (wttrin) :init (setq wttrin-default-cities '("Cheltenham" "Bristol"))). This sets the list of available cities. You can then use M-x wttrin to see the weather. This will prompt for the city and then show a buffer with the forecast.
15
Add a comment...
 
#ZSH -like auto-completion for file paths in #Helm !
2
Yuriy Pitometsu's profile photo
3 comments
 
UPD: see https://github.com/emacs-helm/helm/issues/1266#issuecomment-222141761 suggestions here for any part of directory name matching.
Add a comment...