Hot answers tagged

5

All functions and variables defined in a file that gets loaded are put into the global environment. Although Emacs has installable packages, those packages are not isolated from each other in any way. If two files define functions or variables with the same name then you'll get a warning when the second one is loaded. You can find out where a function was ...


4

Yes! This is command-log-mode which can be installed from Melpa. You have to add the function to whatever modes you want to record, like (add-hook 'python-mode-hook 'command-log-mode) Then, to invoke the log window as shown in the video M-x clm/open-command-log-buffer Open a Python file (in my example) and start manipulating the code to see your ...


3

The application of a lambda expression was used to populate the local variables in the expression, so for example what you can today write as (let ((x 12)) (message (number-to-string (- (* 4 x) (/ x 2))))) you wrote as ((lambda (x) (message (number-to-string (- (* 4 x) (/ x 2))))) 12) The lambda expression is the car of the whole form.


3

Almost every mode puts some kind of text in the mode line, which is the line of text at the bottom of every buffer. You can also type C-h m (or M-x describe-mode)to get long-form documentation about every mode that is currently active. This includes their names as well as all of their keybindings.


3

Use describe-function by typing C-h f and, when asked for the function, type the name of the mode which is itself a function.


3

Org mode does a bunch of context-dependent actions by binding a key (e.g. C-c C-c or C-c RET) to a generic function (org-ctrl-c-ctrl-c or org-ctrl-c-ret). The function looks around to determine a context (am I in a header? or a source block? or a table? etc.) and then calls another function (e.g. org-insert-heading) depending on that context. I don't know ...


3

C-h a runs apropos-command, and so will only show you interactive commands, not variables like make-backup-file-name-function. You could use apropos-user-option in combination with a non-nil value of apropos-do-all to search more extensively. Interactively you can use a prefix argument C-u to tell most 'apropos' commands to use their apropos-do-all ...


3

You can use func-arity added in 26.1. C-h f func-arity: func-arity is a built-in function in `C source code'. (func-arity FUNCTION) Return minimum and maximum number of args allowed for FUNCTION. FUNCTION must be a function of some kind. The returned value is a cons cell (MIN . MAX). MIN is the minimum number of args. MAX is the maximum ...


3

There is. See (info "(org) External Links"): [[help:princ]]


2

I am not a Ubuntu user, on Debian this Elisp intro come from emacs-common-non-dfsg. I think that should do it : https://packages.ubuntu.com/search?lang=en&keywords=emacs-common-non-dfsg


2

You can use substitute-command-keys, e.g., (substitute-command-keys "\\[keyboard-quit]") ;; => "C-g" though if there are multiple key bindings, it returns only one of them (the "first" one), for example, (substitute-command-keys "\\[kmacro-start-macro]") ;; => "C-x (" see also it's docstring and (elisp) Keys in Documentation.


2

Try this: (defun foo (function &optional descriptionp) (unless (commandp function) (error "Not a command: %s" function)) (let* ((key (car (where-is-internal (or (command-remapping function) function) overriding-local-map nil nil))) (desc (and descriptionp (key-description key)))) (or desc ...


2

I use eldoc, this screenshot shows the first line of concat's docstring: (define-advice elisp-get-fnsym-args-string (:around (orig-fun sym &rest r) docstring) "If SYM is a function, append its docstring." (concat (apply orig-fun sym r) (let* ((doc (and (fboundp sym) (documentation sym 'raw))) (oneline (and doc (substring doc 0 (...


2

To discover an existing command that moves up or down lines, use command apropos-command, bound to C-h a by default. Commands involving lines often have line in their name. So try that: C-h a line RET. Among the displayed command names and their descriptions, you'll find next-line and previous-line.


2

M-: (setq debug-on-message "Entry repeats: SCHEDULED") The stack traces should show you what is causing each instance of that message. See C-hig (elisp)Using Debugger for help on the debugger. When you're done, M-: (setq debug-on-message nil)


2

You can execute arbitrary elisp code from a link: [[elisp:(message "Hello")][Greeting]] Clicking on the link runs the code and you get a greeting in the echo area. All you have to do is figure out what code to run. The first step is to find out the keybinding of C-h f, so do C-h c C-h f RET and you see that C-h f is bound to the command describe-...


2

There's M-x describe-mode, which is bound to C-h m by default. It shows the current major mode, as well as all current minor modes. If you want to jump directly to the description of your current major mode, then either evaluate (describe-function major-mode) (via M-:) or bind it to a key, for example: (defun my/describe-current-major-mode () "...


2

You may want to try ivy + ivy-rich. The relevant section of the documentation has this screenshot: You need to include the following lines in your init.el: (require 'ivy) (ivy-mode 1) (require 'ivy-rich) (ivy-rich-mode 1) (setq ivy-use-virtual-buffers t) (setq enable-recursive-minibuffers t) (global-set-key (kbd "M-x") 'counsel-M-x)


1

OP seems to be missing the point already clearly made in the two answers given: you cannot do what you are asking. Emacs uses a voluntary naming convention, not syntax or compilation rules, to define namespaces. It may sound like a recipe for chaos, but in practice it works very well. What you are doing when you name your function s-join is (effectively) ...


1

In Elisp, all functions names normaly (but not necessarily) reside as an entry in a global environment (obarray). In Elisp functions can be redefined. Which means the function definition which has been evaled (or loaded) last will be the only one, which is known and used. This way you can change functions in your init file, you just need to be sure your ...


1

I don't know about "straight-forward", but you can do it as follows: (let* ((comps '(("faz" "Pogo quote part 2") ("foo" "Regular fubar") ...)) (completion-extra-properties `(:annotation-function ,(lambda (s) (format " %s" (cadr (assoc s comps)...


1

You should use M-x helm-apropos (in the helm-elisp.el library), which you can use to describe commands, functions, variables and faces. Pressing C-j shows a preview of the documentation.


1

When you're in the agenda buffer try C-h m which should give an overview of the current mode, show which commands are available and list their keybindings. There are a few other ways to access the built in documentation (as found in the manual) that you might want to explore.


1

In addition to C-h f which gives you information about functions as you found out, the C-h prefix key leads to all sorts of other documentation as well: variables, keys, log messages, modes, the Info manuals and much more - type C-h ? to get the list.


1

Is there any package that does that, or a way to achieve it? One such package is Show Key (code: showkey.el). Global minor mode showkey-log-mode keeps a log of such events, in a separate frame. It's refreshed with each new event, and it's kept on top of other frames without stealing the input focus. Various user options control what events get logged, etc.


1

You can automatically have the *Help* window be selected when it is displayed, by customizing option help-window-select. help-window-select is a variable defined in help.el. Its value is t Original value was nil Documentation: Non-nil means select help window for viewing. Choices are: never (nil) -- Select help window only if ...


1

For this particular case... In that call to org-auto-repeat-maybe we see this: (when org-log-repeat (if (or (memq 'org-add-log-note (default-value 'post-command-hook)) (memq 'org-add-log-note post-command-hook)) ;; We are already setup for some record. (when (eq org-log-repeat 'note) ;; Make sure we take a note, not only a ...


1

You can call describe-minor-mode to get help on any minor mode. It prompts you to enter either a symbol or an indicator from your mode line, and gives you the help for that mode. I don't think that there's anying similar for major modes.


1

Use C-z C-h. That shows you a list of all the keys, and their commands, that have C-z as a prefix key.


1

The user thblt@irc.freenode.net#emacs provided the following implementation of a function that shows the documentation in the echo area at the bottom of emacs: (defun showdoc (f) (interactive (list (thing-at-point 'symbol t))) (message "%s: %s" f (documentation (intern f)))) I noticed that if the docstring was long, as for example with interactive, ...


Only top voted, non community-wiki answers of a minimum length are eligible