In this StackOverFlow question, I created an employee database and provided a select-by-first function. How can I write a select-by-first-pattern where the record is returned if any part of the string/symbol matches?
(select-by-first-pattern 'ev); Returns all records containing "ev" (eg. Steve)
Here's the code needed to construct th...
How to use nth function in lisp if my my variable is combination of list and cons-cell
for eg:
(setq aa '(1 2) )
(nconc aa (+ 1 2))
this return me (1 2 . 3)
when i say (nth 1 aa) it returns 2
but when i use (nth 2 aa ) it throws error
...
My version of Emacs is 23.0.91.1. Ubuntu did not catch up with 23.1, yet. Anyway,
I have an strace capture, and wanted to see file descriptors usage.
So, wanted to see "^(open|socket)" regexp on occur, but didn't work.
Grouping regexp does not work in Emacs regexp?
...
I need to get selection as a string in my Emacs Lisp function.
...
Sometimes I got itchy finger and kill some buffer that I meant to bury instead. The problem is, I use tramp to edit files from multiple machines, and those file names get long and nasty and just in general I'm not that good at finding where my files are anyways. So I would like to have emacs keep track of the files I just closed so that ...
Hi,
I'm writing a parser in Emacs Lisp. It's a parser for text files
looking like this:
rule:
int: 1, 2, 3, ...
string: and, or, then, when
text:
----------
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque
in tellus. In pharetra consequat augue. In congue. Curabitur
pellentesque iaculis eros. Proin m...
hey
I am trying to learn lisp, using emacs dialect and I have a question.
let us say list has some members, for which predicate evaluates to false. how do I create a new list without those members? something like { A in L: p(A) is true }. in python there is filter function, is there something equivalent in lisp? if not, how do I do i...
As many other people interested in learning Lisp, I feel the resources available are not the best for beginners and eventually prevent many new people from learning it. Do you feel it could be created some sort of community, with a website, forum or something, that provides good (as in quality) resources/tutorials, for Lisp users, possib...
I want to have sort of indiacator at left side of the line wherever I have in the source code
#TODO: some comment
//TODO: some comments
The indicator could be a just mark and I already enabled line numbers displayed at emacs.
...
Occasionally I use AWK to extract and/or reverse columns in a data file.
awk '{print $2,",",$1}' filename.txt
How would I do the same using Emacs Lisp?
(defun awk (filename col1 ; Test awk
(awk "filename.txt" 1); Only column 1
(awk "filename.txt" 2 1); Column 2 followed by column 1
(awk "filename.txt" 3 2 1); Columns 3,2 then 1
...
Hi,
I have been a programmer for a decade now, but I believe this is the first time I've ever asked a question on a forum. I just can't figure this out and can't find the answer already online.
I am trying to turn on CUA mode so that emacs is more bearable for a windows user (normal copy paste functions). I am running Windows 7 and i...
I have a function in which I pass a filename followed by several integer parameters. The problem is that I now want to run my code as a Unix script, using command-line-args-left to pass parameters from the command line. When #1 calls process-args, a list is created with all of the values. In #2, a list of a list {eg. ((1 2 3)) } is cr...
Forgive the "duplicate" question. I'd like to see this solved in Emacs Lisp too, and if I just tagged it for both topics, I probably would have only gotten one answer. The Emacs answer should be sufficiently different that it's probably worthwhile to have it.
I want to teach myself Spanish and I've got several word lists like
the data...
I'm trying to tweak the dired-find-file function in emacs on Windows XP so that when I open (say) a pdf file from dired it fires up a copy of Acrobat Reader and opens that file with it, instead of opening it within emacs. But I can't work out what variant on shell-command/call-process to use. Here's what I have so far:
(defadvice dired-...
I would like to start a few shells, and set their directories from my .emacs. Opening them is easy:
;; run a few shells.
(shell "*shell5*")
(shell "*shell6*")
(shell "*shell7*")
But I would like to specify their directory, too.
...
Hi, all
I want to make my muse directory more flexible, so I save the muse base directory path in a variable, like this:
(setq my-muse-base-dir "d:/project/notes")
(setq muse-project-alist
`(
("Home"
((concat my-muse-base-dir "/muse/home")
;; ("d:/project/notes/muse/home"
:default "index")
(:base "html"...
Rinari hasn't been updated in the last few months, and there doesn't seem to be such progress made in the branches on github.
I've never tried emacs-rails, but from what I can see, the same applies.
So, is there a rails mode somewhere that's compatible with v3 ?
...
Hi, I often have multiple processes running (R, Python, eshell/shell), and for each I often have an associated script from which I send snippets. For this purpose I usually split each frame into two windows vertically so that my script file (e.g., .py) is in the top window and the REPL or interactive program is in the lower window (e.g.,...
Hi,
I'm writing a plugin for emacs to compile and run a java source file with one keystroke.
Now I would like to find out the name of the main class or if there is none.
Anyone knows how to match a java main class name with regexp?
My first thought, in pseudo code regex is
find the first word preceded by "class " and succeeded by "{"....
I want to save data to a file in my elisp program. I have a multi-dimensional list that I want to save to a file, so I can restore it the next time my program runs. What's the easiest / best way to do this?
I realise, of course, that I can simply write my data to a buffer in a custom format and then save the buffer, but then I'd have to...