elisp

How can I highlight unmatched HTML tags in Emacs?

对着背影说爱祢 提交于 2019-12-24 04:56:18
问题 I'd really like to catch unbalanced HTML tags as I edit HTML snippets inside Emacs. For example, JSFiddle offers this: I've found that there's also a wrapper for weblint but that only support HTML 4. flycheck support HTML checking using tidy, but that assumes the current buffer is a complete HTML page. I often edit templates which are included in other templates, so my buffer rarely has a <html> or a <head> in it. How can I highlight unbalanced HTML tags, without writing full HTML documents?

Request.el “cannot create connection to api.stackexchange.com”

梦想的初衷 提交于 2019-12-24 04:37:23
问题 I'm using the request.el library (available via MELPA) to try and create a basic framework from which to start work in earnest on a Stack Exchange mode for Emacs. All I want to do is to be able to return the object as parsed by json-read to the calling function, but I can't even seem to make a connection. I understand that to have my function return the object, the call must be made synchronously, so that is what :sync t is there for. I've considered making it an asynchronous call, but I don

Emacs 24 error on startup

人走茶凉 提交于 2019-12-24 02:13:07
问题 I have been using emacs snapshot for a while now but recently it has been crashing a lot. So I switched to Emacs 24. But once I installed it and started it up it started showing error and wouldn't load anything in my init.el when I ran it in debug mode, I got this. Debugger entered--Lisp error: (void-function package--description-file) (package--description-file pkg-dir) (expand-file-name (package--description-file pkg-dir) pkg-dir) The full trace is here. Any help in fixing this or

Emacs 24 error on startup

限于喜欢 提交于 2019-12-24 02:13:03
问题 I have been using emacs snapshot for a while now but recently it has been crashing a lot. So I switched to Emacs 24. But once I installed it and started it up it started showing error and wouldn't load anything in my init.el when I ran it in debug mode, I got this. Debugger entered--Lisp error: (void-function package--description-file) (package--description-file pkg-dir) (expand-file-name (package--description-file pkg-dir) pkg-dir) The full trace is here. Any help in fixing this or

Elisp rename macro

筅森魡賤 提交于 2019-12-24 01:41:15
问题 How can I rename elisp macro? To be more accurate, I want make defun to be synonym to cl-defun . I do not care about time or memory overhead. 回答1: Summary I don't think you can do that - at least not easily. Since cl-defun expands to defun , you will get an infinite macroexpand loop when using defun if you do the obvious (defalias 'defun 'cl-defun) . The is a way... So what you need to do is save the original defun : (fset 'defun-original (symbol-function 'defun)) . copy the definition of cl

How do I eval the code when run its test in elisp with Emacs?

大兔子大兔子 提交于 2019-12-24 00:47:14
问题 I'm writing some small puzzles to learn Emacs Lisp. However, my current workflow is way too tedious : change the code eval-region or eval-buffer code change the test eval-region or eval-buffer test code M-x ert , then press enter to run tests How do I setup Emacs or the tests, so I can just "run the test" and Emacs will eval all codes for me ? 回答1: You probably should not run your tests within your Emacs session anyway. Rather, run the tests in a fresh Emacs session: $ emacs -Q -b -l my

How do I eval the code when run its test in elisp with Emacs?

淺唱寂寞╮ 提交于 2019-12-24 00:41:08
问题 I'm writing some small puzzles to learn Emacs Lisp. However, my current workflow is way too tedious : change the code eval-region or eval-buffer code change the test eval-region or eval-buffer test code M-x ert , then press enter to run tests How do I setup Emacs or the tests, so I can just "run the test" and Emacs will eval all codes for me ? 回答1: You probably should not run your tests within your Emacs session anyway. Rather, run the tests in a fresh Emacs session: $ emacs -Q -b -l my

Use orgmode agenda content in html

非 Y 不嫁゛ 提交于 2019-12-23 23:03:56
问题 I am working on an agenda and orgmode works great in all of senses. Unfortunatelly I am stalled in one point: to export orgmode agenda content to HTML. I know how to export the .org to ics and it works fine. I know how to export the .org to html and it also works. But when you export .org to HTML you miss the content of the agenda. I mean, if I have schedulled an event, it is like: * Convocatoria de Proyectos Visualizar15 DEADLINE: <2015-04-05 dom> http://medialab-prado.es/article

C Comment in Emacs - Linux Kernel Style v2

断了今生、忘了曾经 提交于 2019-12-23 22:22:24
问题 I received an answer about C Comment in Emacs - Linux Kernel Style that works great but when emacs comments ( comment-dwim ) it's padding the second * long_function_name_vari and last */ lines with spaces (before the comment) not tabs like I have configured it. How to avoid that? And how easily to make a comment using this style? /* void main() * { * int i; * int b; * printf("format string"); * } */ 回答1: Customizable variable comment-style is defined in newcomment.el saying ... (extra-line t

Modifying function; saving to new function in lisp

可紊 提交于 2019-12-23 18:33:54
问题 So I thought one of the advantages of lisp (among other languages) is its ability to implement function factories (accept functions as arguments; return new functions). I want to use this capability to make small changes to a function and save it as a new function so that if changes are made to the original function, they are also reflected in the new function on which it is based. Note: I am not the one writing the original function so I can't necessarily encapsulate the common parts in a