|
Zombywuf posted:Anyone know how to get the current revision and other version control info from a file to create a org-capture template. The idea is to be able to insert a note about the file I currently have open, so something like this: Hey Zombywuf, org-git-link.el looks like it might do what you need: http://orgmode.org/worg/org-contrib/org-git-link.html (Found a raw copy here: https://github.com/ReimarFinken/org-git-link)
|
# ? Jan 5, 2012 05:20 |
|
|
# ? Apr 26, 2024 04:50 |
|
Awesome, that looks even better than what I was trying to do :-)
|
# ? Jan 6, 2012 03:00 |
|
Does anyone have an opinion on JDEE, Malabar, or a comparison between the two? I feel I may be sucked into Java development soon.
|
# ? Jan 7, 2012 15:34 |
|
I just started using Emacs today, and I'm currently going through the little tutorial. I can't stop. Send help.
|
# ? Jan 8, 2012 15:43 |
|
DrMelon posted:I just started using Emacs today, and I'm currently going through the little tutorial. There is no help, you are ours now. Join us. tip: try M-/ for auto completion
|
# ? Jan 8, 2012 15:59 |
|
DrMelon posted:I just started using Emacs today, and I'm currently going through the little tutorial. No help needed, you're one of us now. One of us! Tip: Menus are not for you any more (put this in your .emacs file): code:
i-search is great for navigating a file, C-s has become second nature to me whenever I need to find something in a file. fishbacon fucked around with this message at 16:17 on Jan 8, 2012 |
# ? Jan 8, 2012 16:11 |
|
Also, how to get help: C-h a - apropos, lets you search all the built in documentation C-h b - opens a new buffer containing all the key bindings in the current buffer C-h m - opens a new buffer with help for the current modes active (e.g. python-mode, help-mode, etc...) The C-s search Mr. Fish mentions is extremely useful when it comes to the last 2 buffers. I usually explore new modes by searching through the help buffers that are opened. The function names that are displayed are hyperlinks you can follow with a mouse click or <enter>. Also if you open the minibuffer for a command with M-x then you get tab completion of commands. The list of functions that appears when you hit tab twice is also searchable (you may be noticing a theme).
|
# ? Jan 8, 2012 16:44 |
|
Things that took me way too long to learn but are extremely helpful: M-<Space> is the default keybinding for the "just-one-space" function. It replaces all the whitespace around you with "just one space". It's extremely useful when merging two lines like: code:
code:
M-m goes to the first non-whitespace char of the line. It's like a better C-a.
|
# ? Jan 9, 2012 09:50 |
|
Suspicious Dish posted:Things that took me way too long to learn but are extremely helpful: I use 'just-one-space ALL the time. I also use 'delete-blank-lines (C-x C-o) all the time which is like the same thing but for lines.
|
# ? Jan 9, 2012 23:38 |
|
It isn't very old-skool of me, but I'm really digging ELPA. It's not quite like having apt-get for Emacs, but it's close. And it ships with Emacs 24, so there's some incentive to upgrade. If anyone decides to play around with it, you should probably include the Marmalade package repository in addition to the "official" repo, thusly: code:
Lots of nifty stuff in there. It's nice opening an Apache config, thinking "I bet someone's written a mode for this" and getting it installed in under a minute.
|
# ? Jan 11, 2012 22:23 |
|
More org mode fun. I've been playing with babel and I've just found out how to make it do SQL. A fairly common workflow for me is: 1) Oh it broke, maybe the clue is in the db. 2) Run a bunch of queries. 3) Curse my own stupidity. Step 2 is often a pain as I often need to run a bunch of similar queries and keep a log of all the queries run and their output for reference. Org babel lets me do this by its "every language now has a workbook magic" and I'm guessing a lot of other people do so here's how. To do this for postgres you need a src block like this: code:
You can insert a src block by typing <s<tab> btw. You can also use parameters, I'm using org mode 7.7, in 7.8 replace srcname with name. Parameters are delimited with a $ and are specified with :var param=value. Sadly it's just done with raw string insertion so features like using named tables as parameters are not going to work, to use a string as a parameter you need to double escape it like so: code:
code:
Then comes babel's party trick, you can pass the output of one codeblock to the input of another, even across languages. For example: code:
|
# ? Jan 17, 2012 00:45 |
|
Maybe someone here can help me out with a problem I'm having. I'm using multi-web-mode right now, and for some files that mix JavaScript and HTML, it freaks out when I try to indent. It belches several lines of just the character 'a' onto the screen and then sayscode:
|
# ? Jan 29, 2012 20:39 |
|
Have they invented a solid web/multi-filetype mode yet? MUMAMO is horrible and crashes on me all the loving time, and basically drove me to Textmate/Sublime 2.
|
# ? Jan 29, 2012 22:15 |
|
I honestly can't stand using any of the multi-modes that are available. All of them suck in one way or another. For the most part I try to keep things partitioned out into separate files. This is definitely one place where Emacs could use a ton of improvement.
|
# ? Jan 30, 2012 19:07 |
|
Random protip: Many Emacs key bindings also work in linux terminals and any OSX editing fields. For example C-a or C-a.
|
# ? Jan 31, 2012 13:22 |
|
ITYM C-e, but yeah, it's really cool when I suddenly realise I'm using those bindings outside of emacs and have been for ages. There's even a dabbrev-expand in readline which is not bound by default, enable it with:code:
Note: in SQL Server Management Studio C-e is "execute current buffer". Be very careful.
|
# ? Jan 31, 2012 13:40 |
|
Zombywuf posted:Note: in SQL Server Management Studio C-e is "execute current buffer". Be very careful. On a similar note, if you bind meta to command on a Mac, you've probably unexpectedly quit your web browser before by trying to refill a paragraph. If you want to get freaky about using Emacs outside Emacs, there's an Edit With Emacs Chrome extension, and Firemacs for Firefox. I frankly don't see much use for these, but if you do lots of complex editing in HTML textareas and, um, don't want to just copy and paste for some reason, maybe it would be useful. Or you could just run emacs-w3m!
|
# ? Jan 31, 2012 15:07 |
|
pgroce posted:Or you could just run emacs-w3m! I do this, it rules Also OS X surprisingly supports a ton of Emacs keybindings. I think there was a post earlier in the thread about it.
|
# ? Jan 31, 2012 16:21 |
|
You seem to have changed your tune on w3m Fren, how much effort is it to get it working? Aside, sometimes certain things (flymake mostly) generate 2 line messages, which makes the window at the bottom move up one line. This can be really jarring, anyone know how to make the bottom window shrink instead of the top window shrinking and the bottom moving?
|
# ? Jan 31, 2012 18:51 |
|
Hahah that's right, at some point in the thread I mentioned it may have been rather spergy, but w3m has replaced a lot of my web browsing. It's mostly just getting used to its capabilities and key navigation. It wasn't a lot of effort to get working. Just had to brew install w3m, check out emacs-w3m somewhere (cvs -d :pserver:anonymous@cvs.namazu.org:/storage/cvsroot co emacs-w3m), and load it up. I have avatars and sigs disabled, and here's the keybindings I use for navigating SA threads: code:
|
# ? Jan 31, 2012 19:03 |
|
I have fallen at the first hurdle, the ubuntu packages wont byte compile :-(
|
# ? Jan 31, 2012 19:45 |
|
Errm, I may have elided some steps. Check http://emacs-w3m.namazu.org/#installation
|
# ? Jan 31, 2012 20:01 |
|
Fren posted:This is a really stupid request. Does anyone know of a more thorough font-lock mode for Common Lisp? I feel like more stuff, like numbers, symbols, functions known to be provided by the implementation, etc. should be highlighted. I'd like to know this too.
|
# ? Jan 31, 2012 20:52 |
|
Is there a way to swap the command and control keys in OSX for emacs only? Also, I don't really understand why anybody would caps lock as control. I use caps lock a lot (people don't?) Most of the control combinations are on the left hand. I'd like to make stuff like C-x C-s easier.
|
# ? Feb 5, 2012 16:29 |
|
baby puzzle posted:Is there a way to swap the command and control keys in OSX for emacs only? Maybe check out Aquamacs. It doesn't actually solve this problem but it recognizes a lot of common OS X shortcuts like apple-S to save.
|
# ? Feb 5, 2012 16:48 |
|
The purpose is to use emacs in the same way that I do on Windows 7 at work, so that won't really help me.
|
# ? Feb 5, 2012 16:52 |
|
baby puzzle posted:Is there a way to swap the command and control keys in OSX for emacs only? Check out the following variables to put the modifier keys where you want them: code:
I used to use caps lock a fair amount, but I switched caps lock and control anyway and I think it's an improvement, especially since I can get 80% of caps lock by typing in lower-case and running upcase-word (or just M-u at the command line, as long as I've set -o emacs). Since that's most of where I use all-caps, it meets my needs nicely. I could streamline that more by writing a function that essentially works like upcase-word does by default, only backwards, so I wouldn't have to enter a negative prefix arg or go back a bunch of words before running it. Wouldn't help me with terminal prompts, alas. (Muddles about with elisp for a few minutes...) ...and here's a function to do just that. code:
pgroce fucked around with this message at 19:25 on Feb 5, 2012 |
# ? Feb 5, 2012 19:21 |
|
So, this kind of rules. Emacs-chess mode, which not only allows you to play across Emacs instances and with the standard Chess engines, but also online at FICS servers like freechess.org. Comes with ASCII and graphical display.
|
# ? Feb 19, 2012 03:50 |
|
How do I pare down the search path of a find-grep-dired (or whatever other function that might do the same thing) so that it will not take literally hours? I have two specific folders I want to look in that have a common base, but I want to avoid searching everything else under that base. I also only need to search headers. For example, I want to search both of these patterns: d:/dev/project/highlevel/code/*.h d:/dev/project/lowlevel/code/*.h
|
# ? Feb 26, 2012 01:12 |
|
baby puzzle posted:How do I pare down the search path of a find-grep-dired (or whatever other function that might do the same thing) so that it will not take literally hours? I'd just use M-x rgrep for this. Asks you what you want to search for, then a filename regex, then a search location. Don't know if there's a way to do a search and replace from rgrep though, so if that's why you're using find-grep-dired, I'm afraid I don't know :-/ Is anyone using Gnus and w3m to read HTML e-mail? I'm having an issue where entire messages that are formatted rather sanely are being rendered entirely in the face w3m-bold, which is really pretty distracting.
|
# ? Feb 27, 2012 20:39 |
|
I guess there is something wrong with my stuff because grep exits abnormally before finding everything. Oh well! ----- I'm feeling pretty let down by these tools so far. As hard as I try, I have yet to accomplish any work. Where are the supposed productivity gains?
|
# ? Feb 27, 2012 21:19 |
|
baby puzzle posted:I guess there is something wrong with my stuff because grep exits abnormally before finding everything. Oh well! See if there's an error at the bottom of the *grep* buffer. When you run rgrep, the resultant buffer shows you the entirety of the command that it's running, essentially in a command line, to perform the grep. Take that command and run it at a terminal prompt and see if it errors out irrespective of Emacs. Learning Emacs is work. Depending on what you're doing, and how long you've been doing it in another editor, and what you're trying to do in Emacs, it may be some time before you can do all of what you want, comfortably, in an intuitive way, and routinely. Emacs provides tons of tools to help diagnose what you may be doing wrong, and documentation to figure out how Emacs does what you're trying to do. Don't give up. If you could be a bit more specific about what it is you're trying to do, maybe we can help.
|
# ? Feb 27, 2012 22:35 |
|
Fren posted:...w3m has replaced a lot of my web browsing... Oh god, why aren't you using conkeror instead of this?
|
# ? Feb 27, 2012 23:29 |
|
vlack posted:Oh god, why aren't you using conkeror instead of this? Because Firefox.
|
# ? Feb 28, 2012 00:05 |
|
I do all my web browsing using wget and a cron job.
|
# ? Feb 28, 2012 00:24 |
|
orphean posted:I do all my web browsing using wget and a cron job. I'd honestly just prefer if there were a sort of Gopher-style web with image and LaTeX support and precious little else. As it stands, w3m allows me to browse modern websites in a terminal, and it's super easy to move stuff from Emacs into it. Like, check it out: (M-x boxquote-describe-function RET find-grep-dired RET) code:
|
# ? Feb 28, 2012 15:50 |
|
Fren posted:If you could be a bit more specific about what it is you're trying to do, maybe we can help. I am just trying to do a simple search and replace across an entire project, which will probably touch about 100 files. This takes seconds in Visual Studio, because it has everything indexed. Emacs has no concept of where my source code is (another issue I'd like to fix), and so it winds up searching through a bunch of unrelated stuff, taking hours to do. If the issue was urgent then I'd just do it with Visual Studio. Maybe first I need to figure out how to get an EDE project set up. I assume that once I have one, then emacs will index everything in it and I can search/replace throughout the project easily.
|
# ? Feb 28, 2012 17:26 |
|
If you're having trouble with search and replace, I'm not sure I would recommend trying to get EDE working. You said grep exits abnormally when you use find-grep-dired. What error are you getting? The function documentation I posted above describes the exact command line that is run to perform the grep. Run it outside of Emacs, and see if it comes up with an error. If it doesn't, run it within Emacs after flipping debug-on-error on (M-: (setq debug-on-error t) RET), and post the Backtrace that you get. find-grep-dired drops results to a dired buffer, with which you can % m *.h to mark your header files, and then Q oldstring RET newstring to perform the replace, then C-x s to save all the files you changed during the replace. Why doesn't that work for you? Also, find-name-dired takes a filename regex and provides you with a dired buffer, with which you can repeat the query replace described above. Why doesn't that work for you? There are about 2 or 3 dozen ways to accomplish variants of what you're trying to do: http://www.emacswiki.org/emacs/CategorySearchAndReplace Typically, the onus is on you to determine which solution fits your needs; this thread is here to help, but you're still not providing any detail about your problem. How many files are in your project? What's taking 'hours' to perform, the actual finding of files in the directory (which should be a single fstat call per file), the searching within files to find the needle you want to replace (which, given a hundred files, should not take very long at all), the actual replacement?
|
# ? Feb 28, 2012 18:37 |
|
Apparently I'm searching through 300,000 files, which is why it doesn't get anywhere. I'm trying to reproduce what was happening before, but it appears to be working now. Oh well. I can certainly just manually run this search multiple times in various locations, but that really isn't reasonable for actually getting work done.
|
# ? Feb 28, 2012 19:45 |
|
|
# ? Apr 26, 2024 04:50 |
|
baby puzzle posted:Apparently I'm searching through 300,000 files, which is why it doesn't get anywhere. Why would you have to run it multiple times in various locations? Why would you have to do so manually, when Emacs has a macro system, and, in the worst case, allows you to write what you want to do in Lisp and automate it? I think you may be going about this the wrong way. Don't think about how to do something in Emacs, think about what you want to do. Come up with some essential vocabulary for it. In this case, search and replace on files. Check the manual (C-h r i search TAB). The first result I find is 'search and replace in multiple files', which brings you to section 28.3.6, which describes using a TAGS file (caching file information much like Visual Studio does) and using tags-query-replace to perform the search and replace, which will only operate on the files that were cached in the TAGS file. The next obvious question is, how do you create a TAGS file? C-h r i tags finds me the term 'tags and tag tables', which brings you to section 28.3, not far from where you started, but with a menu of contents which includes 'Create Tags Table'. And so on. Yes, you're probably going to be doing this sort of thing a lot as you get the hang of Emacs. But all of this knowledge starts congealing together, and soon you'll start to have a more comprehensive idea of what Emacs is capable of. Emacs is so insanely powerful and it's a joy to use when all these things start coalescing in your head. EDIT: Emacs doesn't make your life easier. It makes your life harder, which gives you the tools so that /you/ can make your life easier. Catalyst-proof fucked around with this message at 20:22 on Feb 28, 2012 |
# ? Feb 28, 2012 20:19 |