Stream

Join this community to post or comment
 
Hey guys,

Is there is a way i can restrict emacs from creating backup files only when i want it for certain files ? Either using M-x or through a command line argument when opening a file using 'emacs -nw' ?

I know you can disable backup file creation or set another directory for backup files through .emacs config file. I do not want to disable it completely but would like to avoid it for certain files/sessions.

1
Arshad Mohammed's profile photoLuis Miguel Castañeda Navas's profile photo
3 comments
 
true (setq make-backups-files nil) in your mode hook should work.
Add a comment...
 
Good day all:

I've been attempting to learn org-mode 8 using both the Org mode 8 Reference manual by Carsten Dominik, as well
as David O'Tooles tutoral.

In David's tutoral, he said to make a new TODO list via: M-shift-RET

However that doesn't work; when I do that, it instead puts the cursor on the next line, and indents.

So I try: alt-x; org-insert-todo-heading, and it says to use: c-c-x shift M, which works correctly.

I'm finding numerous times where there is minor inconsistencies with keys. But the alt-x helps. I'm making
keyboard notes as I go along.

So let me ask; is there something wrong with my Emacs/Org? Synaptic says I have the following:

emacs24-nox v24.5.1
howm v1.4.3-1
org-mode 8.3.3-2
org-mode doc 8.3.3-1

Is there something I can do do? or is it that these tutorials are just a bit out of date?
1
Yuri Khan's profile photoKantuck Nadie Nata-Akon's profile photo
4 comments
 
+Yuri Khan sighs There is always something that has to go wrong. I much prefer the terminal myself due to the speed but I guess I can get use to the GUI version. At least it allows me the use of Org. Thanks for your help. Adding the GUI version to all my servers.
Add a comment...

Gabriel Pozo

Questions  - 
 
What is the best setting to work with ReactJS?

*Edited*
I finally ended up using this:
http://cha1tanya.com/2015/06/20/configuring-web-mode-with-jsx.html
1
Add a comment...

Chang Liao

Questions  - 
 
So most of the time I use Emacs on a Linux and ssh client from Windows. Then recently I planed to pick up Mac, a lot of the keyboard shortcuts are different. Can anyone recommend some keyboard mapping between these OS?
1
Michael Lockhart's profile photoKantuck Nadie Nata-Akon's profile photo
7 comments
 
To be honest (and apologies for the lateness, I just joined.) I've had to set up my own quick keyboard command reference guide though a simple spreadsheet. The key commands can be slightly different even between GNU Emacs terminal (type emacs -nw) and the GUI GNU emacs. So your not alone.

In my guide I write down the exact key commands to avoid confusion. So for saving for example, I wrote in 'c-x s' and for example to spell check a word 'a-s-4' (alt-shift-4, for the $ mark). I wish honestly they'd teach it that way, not the archaic 'meta' which doesn't exist anymore, and be sure to add the 'shift' key as well.
Add a comment...

John Peck

Questions  - 
 
I"m using Emacs 25.1.50.2, and my paragraph filling behavior is strange. I used to get nice filled paragraphs with no indentation in message mode, but now I always get a tab on the second line. Has anyone else seen this?
1
E. Choroba's profile photo
 
Seems like someone called set-justification-center.
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...
 
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...
 
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...
 
Hi there! I use next setup in my .Xresources to use Super and Hyper keys in my Emacs on terminal:

! Key translations: Super & Hyper in Emacs
! Make Super, Hyper and Print - Super key, Fn - Hyper, AltGr - Meta
URxvt*keysym.Super_L: \030@s
URxvt*keysym.Super_R: \030@s
URxvt*keysym.Hyper_L: \030@s
URxvt*keysym.Hyper_R: \030@s
URxvt*keysym.Print: \030@s
URxvt*keysym.XF86WakeUp: \030@h
URxvt*keysym.ISO_Level13_Shift: \033

And it work like a charm besides I should type them as prefixes.
BUT, I know, most modern terminals use Alt to send Esc (\033). So is there any way to configure urxvt to prevent autorepeating of such additional modifier keys, and act on hold with other keys?

E.g.: not H f, but H-f.
3
Yuriy Pitometsu's profile photo
5 comments
Add a comment...
 
I use next code to make emacs more friendly with tmux:


;; tmux integration

(defadvice terminal-init-screen
;; The advice is named `tmux', and is run before `terminal-init-screen' runs.
(before tmux activate)
;; Docstring. This describes the advice and is made available inside emacs;
;; for example when doing C-h f terminal-init-screen RET
"Apply xterm keymap, allowing use of keys passed through tmux.
Use xterm default colors in tmux."
;; This is the elisp code that is run before `terminal-init-screen'.
(if (getenv "TMUX")
(progn
;; Use the xterm color initialization code
(xterm-register-default-colors)
(tty-set-up-initial-frame-faces)
;; use xterm keymap for ctrl + shift
(let ((map (copy-keymap xterm-function-map)))
(set-keymap-parent map (keymap-parent input-decode-map))
(set-keymap-parent input-decode-map map)))))

But I still have next problem: when I run emacs GUI, and then attach to emacs from terminal client, that code nod called. How can I add it for this case also?
3
Yuri Khan's profile photoYuriy Pitometsu's profile photo
4 comments
 
+Yuri Khan now it worked, thanks. But not protected for old terminals...
Add a comment...
 
New to emacs and org mode... trying to stay orrganized in life with absolutly no programming expierience. Should i continue to dive into org mode or should i learn more of the core emacs itself? Where do i go to learn more of emacs Core and how do i connect in irc from within emacs and how can i recieve my email in emacs assumin i know nothing of programming.
1
Cass Petrus's profile photoClinton “Methinx” Lee's profile photo
12 comments
 
+Cass Petrus Everything helps me at this point I'm just trying to absorb and do what examples I can and practice practice practice.!
Add a comment...

Bin Felix Liu

Questions  - 
 

Plink comint mode in emacs: Text read only etc.
emacs putty plink
i want to use a new comint mode for plink(putty), i put the code in init.el.

But if M-x run-plink, i got "Text is read-only " and "comint-send-input: Current buffer has no process". There is no prompt Symbol and i can't input. I just want to have a new comint mode for plink(putty).

I'm new with emacs. Can somebody please see that?


1
Add a comment...

Steve Dowe

Questions  - 
 
Can anyone suggest a mixed major mode that does indenting properly for PHP/HTML files?  Thanks.
1
Steve Dowe's profile photoDarryl Hebbes's profile photo
2 comments
 
Check out this snippet for setting up other PHP mode like behaviour

https://github.com/ejmr/DotEmacs/blob/master/init.el#L52-L70
Add a comment...

Marcelo Muñoz

Questions  - 
 
Is there any way to deal with blocks like this?

" SELECT * FROM table "
" WHERE "
" CONDITION-1 AND "
" CONDITION-1 "

The idea is to keep aligned quotes and also insert new lines in quotes.

Thankss!!

2
George Jones's profile photoMarcelo Muñoz's profile photo
5 comments
 
+Ben Samuel​​​ yes, it is very close!,  great idea from magnars
Add a comment...
 
Anyone know of some good resources for learning emacs lisp and developing a new major mode? Trying to create one that would allow for Salesforce development on emacs, but so far I'm finding little in terms of resources. 
2
Philip Yassin's profile photobin chen's profile photo
5 comments
 
there is already apex mode. I guess you are interested in how to sync the code to cloud. See http://blog.binchen.org/posts/emacs-vs-sublime-text-on-salesforce-development.html 
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...

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...

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...
 
Is there any way to use ESC <right> as a different from M-<right> key in Emacs on terminal?
It's only this one little issue with terminal emacs left to switch.
1
Yuriy Pitometsu's profile photo
9 comments
 
...and iTerm2 for OS X.
Add a comment...

Qin Ba

Questions  - 
 
I am new to python mode of emacs. I have this pain when executing python codes.

In the Inferior Python buffer, I could get the correct outcome without any bugs but these messages showed op every time.

1. When using "elpy-shell-send-region-or-buffer":
__pyfile = open('''source_file_name''');
exec(compile(__pyfile.read(), '''source_file_name''', 'exec'));
__pyfile.close()

2. When using "python-shell-send-file":
__pyfile = open('''temp_file_name''');
exec(compile(__pyfile.read(), '''source_file_name''', 'exec'));
__pyfile.close();
import os;
os.remove('''temp_file_name''')

How can I remove these message? Hope someone can help me. Thank you. 
2
Add a comment...