emacs lisp call function with prefix argument programmatically

If I’m understanding you right, you’re trying to make a keybinding that will act like you typed C-u M-x grep <ENTER>. Try this: (global-set-key (kbd “C-c m g”) (lambda () (interactive) (setq current-prefix-arg ‘(4)) ; C-u (call-interactively ‘grep))) Although I would probably make a named function for this: (defun grep-with-prefix-arg () (interactive) (setq current-prefix-arg ‘(4)) … Read more

Confusing about the Emacs custom system

The short answer to you question is: use setq or setq-default for variables defined by defvar. use setq, setq-default, or the Customize mechanism for variables defined by defcustom Below is the long answer. The functions that you are going to use are the following: set is the main function to set the value of a … Read more

Render Markdown in Emacs buffer

Personally, I use the following workflow: run on a C-c C-c m to run Mark­down on the cur­rent buffer and pre­view the out­put in an­other buffer. move to html-mode on this other buffer (M-x html-mode) hide the html tags to display something close to the output (M-x sgml-tags-invisible) Then every time you want to refresh … Read more

How to modularize an emacs configuration?

My .emacs file loads ~/.emacs.d/init.el, which defines the following functions, written first for XEmacs, but working well enough for Emacs these days: (defconst user-init-dir (cond ((boundp ‘user-emacs-directory) user-emacs-directory) ((boundp ‘user-init-directory) user-init-directory) (t “~/.emacs.d/”))) (defun load-user-file (file) (interactive “f”) “Load a file in current user’s configuration directory” (load-file (expand-file-name file user-init-dir))) Then the rest of the … Read more

What are the major differences between Emacs Lisp and Common Lisp? [closed]

There’s quite a bit of crossover, especially at the beginner level, so whichever you start with will mostly transfer to the other. Some of the major differences: ELisp traditionally used dynamic scoping rules; Common Lisp uses lexical scoping rules. With dynamic scoping, a function can access local variables declared in calling functions and has generally … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)