texts: How to properly use emacs and slime to program in Common Lisp

texts:
I'm brand-spanking new to LISP. I'm trying to get started with it, and I installed Steel Bank Common Lisp as well as SLIME so I can program in emacs. As far as I know, Slime simply provides an interactive mode, whereas editting .lisp and .el files is done in emacs lisp-mode. I'm trying to figure out how to use them in tandem.

I have a basic program where I defun a fibonacci number function, and I would like to simply hit M-x slime and test it out in slime. When I last tried, it said the function is undefined, leading me to believe that the slime buffer is not connected in any way to the .el file I opened slime from.

Error Message:

; SLIME 2.20
CL-USER> (fib 30)
; in: FIB 30
;     (FIB 30)
;
; caught STYLE-WARNING:
;   undefined function: FIB
;
; compilation unit finished
;   Undefined function:
;     FIB
;   caught 1 STYLE-WARNING condition

Is there an easy way to do what I'm trying to accomplish? I'm looking put myself into a position that promotes test driven development in a powerful language like Common Lisp.

If you have any help on this issue, or have any advice or resources for someone picking up Lisp, it would be greatly appreciated. Thanks!


texts: Is there a way to configure C-g (or some other key?) to not be usable as normal input in any context, part of a key binding, etc, and instead have it quit in more contexts? e.g. I'd like C-x C-g to quit immediately (instead of saying C-x C-g is undefined, then quitting)


texts: How can I find the path to an executable with Emacs Lisp?

texts:
My current use case is to find where the Cask executable is (it can be installed in at least two places, and there's an issue open about this).

I need to require cask this way:

(require 'cask "~/.cask/cask.el")

But I need to find the correct path to that cask.el, and as far as I know, the easiest way to do that is through locating the executable.

How can I do this?


texts: Show org-todo-list with specific category

texts:
Can I pass an argument to (org-todo-list) so the buffer will only show item a specific category?

I tried something like (org-todo-list "personal"), but had no success.

I can still use < over a category, once I am in the org-agenda-mode. Is there a way to combine these steps into "open a new org todo view filtered by category"?


texts: `org-babel-load-file` doesn't always tangle source file

texts:
I'm on Org 9.3. I run the following test.
[OP@localhost bug1]$ ls
real.org  test.org

The contents of real.org are:
[OP@localhost bug1]$ cat real.org
#+PROPERTY: header-args :tangle yes

#+begin_src emacs-lisp
(setq count (+ 1 count))
#+end_src

The contents of test.org are:
[OP@localhost bug1]$ cat test.org
#+begin_src emacs-lisp
(setq count 0)
#+end_src

#+begin_src emacs-lisp
(org-babel-load-file "real.org")
count
#+end_src

I then do:
[OP@localhost bug1]$ touch real.el

Now executing test.org, I get:
#+begin_src emacs-lisp
(setq count 0)
#+end_src

#+RESULTS:
: 0

#+begin_src emacs-lisp
(org-babel-load-file "real.org")
count
#+end_src

#+RESULTS:
: 0

And the file real.el is still empty. I have two questions:

Why does this happen?
Is there a way to force .el file regeneration every time?

Some further observations:

If the org file being loaded (real.org in the above) is a symlink,
the .el file is never regenerated.
If the org file being loaded is newer, even if the .el file exists,
the .el file will be regenerated.
Finally, obviously if the .el file doesn't exist, it is created.


texts: DBus error when running TeX-evince-sync-view

texts:
I am trying to get my LaTeX View command to work properly in Emacs, but for some reason I just can make it happen.

Whenever I hit C-CC-C and enter the View command, Emacs automatically suggests TeX-evince-sync-view. However when I confirm that command, the minibuffer hangs until it eventually spits out:

  D-Bus error: "Message recipient disconnected from message bus without replying"

I have tried exporting my DBUS_SESSION_BUS_ADDRESS environment variable, but if Emacs is able to connect to DBus as it seems to be (given the error message), this shouldn't be the issue. I've also had a look here and a few other pages, but I couldn't get rid of that error.

In the meantime, whenever I want to run a View command, I have to erase the default TeX-evince-sync-view and manually type in evince document.pdf which gets annoying after  while. I have also tried making this other command the default View command, but no matter what I do about this, Emacs still gives me TeX-evince-sync-view every time.

A few other things:

I am using Emacs 25.3.1 on Arch Linux
My AuCTeX version is 12.1.1 (used to be 11.92.0, but nothing changed after the upgrade).
I don't have any View-related config in my ~/.emacs.
I have upgraded all my packages just in case before asking here.

Any ideas? Ideally I'd like TeX-evince-sync-view to work, but if it doesn't I'd like the simple evince command to pop up as the default.


texts: Org mode: How to tag and search the content of different text files?

texts: I have a huge number of text files (.txt), in which I store notes. I would like to add tags to the start of each of these files in order to characterize their content. The best would be to be able to, either chose tags from a list of tags already used (that dynamically expands for each new tag used), or if none of these tags are useful add a new one (therby expanding the dynamic list with this new tag). Does it already exist such a dynamic tagging functionality, and if so, how to I implement it? How can I search over these multiple file?


texts: evil mode - make helm quit with the escape key

texts:
I followed this guide to make escape quit from various modes...

;; esc quits
(defun minibuffer-keyboard-quit ()
  "Abort recursive edit.
In Delete Selection mode, if the mark is active, just deactivate it;
then it takes a second \\[keyboard-quit] to abort the minibuffer."
  (interactive)
  (if (and delete-selection-mode transient-mark-mode mark-active)
      (setq deactivate-mark  t)
    (when (get-buffer "*Completions*") (delete-windows-on "*Completions*"))
    (abort-recursive-edit)))
(define-key evil-normal-state-map [escape] 'keyboard-quit)
(define-key evil-visual-state-map [escape] 'keyboard-quit)
(define-key minibuffer-local-map [escape] 'minibuffer-keyboard-quit)
(define-key minibuffer-local-ns-map [escape] 'minibuffer-keyboard-quit)
(define-key minibuffer-local-completion-map [escape] 'minibuffer-keyboard-quit)
(define-key minibuffer-local-must-match-map [escape] 'minibuffer-keyboard-quit)
(define-key minibuffer-local-isearch-map [escape] 'minibuffer-keyboard-quit)
(global-set-key [escape] 'evil-exit-emacs-state)

To make helm quit using escape, I tried:

(define-key helm-map [escape] 'helm-keyboard-quit)

This didn't work. Setting other keys instead of escape works fine though.


texts:
I'm rebuilding my emacs configuration, and trying to compile without warnings. I'm using also cask. I have this case:

(require 'magit)

;; Enable a right limit of 70 chars for git logs
(add-hook 'magit-log-edit-mode-hook 'turn-on-auto-fill)

(provide 'my-magit)

(fullframe magit-status magit-mode-quit-window nil)
(setq magit-last-seen-setup-instructions "1.4.0")

(global-set-key (kbd "C-c g s") 'magit-status)

(require 'git-gutter)
(global-git-gutter-mode +1)

Compiling this, give this warning:

In toplevel form:
my-magit.el:10:7:Warning: assignment to free variable
    ‘magit-last-seen-setup-instructions’

I try and changing to

(defvar magit-last-seen-setup-instructions "1.4.0")

It works well, without warning, the difference with setq is that after that if another defvar is applied to this variable will ahve no effect, but could I apply it to the other variables like this or I will have issues for that. Another doubt is that I believe that this variable is defined in the package magit that is loaded previously. so I do not get why I get this warning.


texts: Magit equivalent of 'git remote add origin git@github.com:user/project.git'?

texts:
For those who are trying to determine how to do this here is the answer.
Yes the answer is in the docs!

I missed it on the first pass. Then looked at questions such as the below, trying b u and thinking it could be set there but this was not the case.
How do I set the upstream branch to push a local branch to in magit?


texts: Org-capture template with deadline of one month from today

texts:
As it seems, org-mode capture templates mechanism maybe have changed? I'm using:

Org mode version 9.2.4 (9.2.4-10-g3b006f-elpaplus)

What I'm trying to do is to have a capture template that will create a heading with a DEADLINE, it would prompt for a date, but would use +1m as a default date. So If I do something like this:

  ("s" "Someday" entry (file+headline "~/Dropbox/org/tasks.org" "Tasks")
              "* TODO %?\nDEADLINE: %^t\n")

This works, but the calendar prompt appears with cursor on Today's date, I want it to be +1m, so if I press RET - it will be a month from today. That possible, right?


texts: Scroll vertically while keeping horizontal position

texts: I'm viewing a file containing visually aligned columns in truncate line mode, and would like to scroll vertically without changing my horizontal scroll position. But scroll-down always moves the cursor to the first column. Is there a simple way to prevent this, and keep the current horizontal point position?


texts: Prevent auto-save-list directory to be created

texts:
Although I have disable auto-save and auto-backups, the directory auto-save-list is still autodramatically created in my .emacs.d directory.

(setq backup-inhibited t
      make-backup-files nil
      auto-save-default nil)

How can I prevent it to be created ?


texts: ctrl-backspace behaves differently across emacs environments, though .init file is same

texts:
I recently needed to start using another mac for work and I wanted to duplicate my spacemacs settings onto my new computer.  I simply copied all files located in .emacs onto my new computer, and it seems to be working smoothly (I probably got lucky).  There's just one small problem: on my old computer, ctrl-BACKSPACE removes whitespace to the point of the next indentation.  For example, in json:
{

  "name": "David",
     "job": "",
}

Typing ctrl-BACKSPACE when the cursor is in front of "job" will result in the following (desired)
{

  "name": "David",
  "job": "",
}

But on my new computer (same OS), it results in the following:
{

    "name": ""job": "",
}

So it looks like a whole line is being deleted.
Is there an easy fix to make sure the indentation is respected?
I believe the indentation settings are determined by flycheck.  I can give my .init file if it will be helpful.
On the working computer, ctrl-backspace is bound to the following:
<C-backspace> runs the command clean-aindent--bsunindent (found in
clean-aindent-mode--keymap), which is an interactive compiled Lisp function in
‘clean-aindent-mode.el’.

It is bound to <C-backspace>, M-DEL.

(clean-aindent--bsunindent ARG)

Unindents.
Bound to ‘M-backspace’ key. Searches lines backward, finds the one that
is indented less than the current one. Unindents current line to
align with that smaller indentation

[back]

On the new computer, ctr-backspace is bound to the following:
<C-backspace> runs the command backward-kill-word (found in global-map), which
is an interactive compiled Lisp function in ‘simple.el’.

It is bound to <C-backspace>, M-DEL.

(backward-kill-word ARG)

  Probably introduced at or before Emacs version 22.1.

Kill characters backward until encountering the beginning of a word.
With argument ARG, do this that many times.

[back]


texts: I want to try eshell, but I heavily relay on the zsh's history commands, which is in ~/.zhistory. How can I let eshell read these commands?


texts:
Is there a simple way (e.g. customization option) to disable some of org-mode's keyboard shortcuts? I normally use shift-right_arrow or shift-left_arrow to select text (expand region), but in org-mode this combination serves to promote/demote heading.

(Yes, I know there's an emacsen way of marking and expanding the region, but I was wondering if there's and out-of-the-box way of disabling this feature in org-mode...)


texts: What is the easiest way to check if a character belongs to a particular set of characters?

texts:
For example suppose that I would like to show the message "yes" if the current character is "a" or "d" or "x", ....
Of course I can write as below. But it is very long.
I am wondering if there is a more simple way to do it.
In this example the variable is char-after and the set is {a,d,x}. The problem can arise in other situation.

  (defun foo () (interactive)
    (if (or (eq (char-after) ?a ) (eq (char-after) ?d ) (eq (char-after) ?x ))
    (message "yes") (message "no")))


texts:
I use the following script to install Emacs 25 on Ubuntu,

sudo add-apt-repository -y ppa:ubuntu-elisp
sudo apt-get update
sudo apt-get install emacs-snapshot

When I start the emacs-snapshot program I get this error message

Debugger entered--Lisp error: (void-variable seq)
  byte-code("\302\303\304\305#\210\302\303\306\307#\210\310\311!\2037
  require(seq)
  byte-code("\300\301!\210\300\302!\207" [require cl-lib seq] 2)
  require(cl-extra)

It shows the seq package is missing, but I can't find it using the package-list-packages function.

How to fix this or is there another way to install Emacs 25 on Ubuntu?


texts:
In LaTeX I often use pythontex in a way that there is a block \begin{pycode}[sessionname] ... \end{pycode} where I make some calculations. Then in the following text I refer to variables defined there for example via \py[sessionname]{Variable}.

Now I can make a yas-snippet that expands for example py to \py[]{}. But then I have to manually insert the session name.

So how can I make a snipped which looks backwards and automatically inserts the session name of the previous pycode environment while expanding py?

If there is another snipped package which can do this, I am interested in it too.


texts:
My question is how to let the command SPC-m-c-Cget the function name automatically?

I am using 0.200.10@25.3.1 (spacemacs), on Ubuntu 16.04 64 bit
I am using cscope layer, it is great but with one function cannot be used normally.

Every time when I press SPC-m-c-C to call helm-cscope-find-calling-this-funtcion, I get error command-execute: Wrong type argument: commandp, helm-cscope-find-calling-this-funtcion
I then do M-x helm-cscope-find-calling-this-funtcion, it will then ask me to input the function name and after I input the function name, everything works well.

I have also searched for some similar questions, but they are not the problem I am facing.
ref001
ref002
ref003

My config file for cscope

(defun cscope/init-helm-cscope ()
  (use-package helm-cscope
    :defer t
    :init
    (defun spacemacs/setup-helm-cscope (mode)
      "Setup `helm-cscope' for MODE"
      (spacemacs/set-leader-keys-for-major-mode mode
        "cc" 'helm-cscope-find-called-function
        "cC" 'helm-cscope-find-calling-this-funtcion
        "cd" 'helm-cscope-find-global-definition
        "ce" 'helm-cscope-find-egrep-pattern
        "cf" 'helm-cscope-find-this-file
        "cF" 'helm-cscope-find-files-including-file
        "cr" 'helm-cscope-find-this-symbol
        "cx" 'helm-cscope-find-this-text-string))
    :config
    (defadvice helm-cscope-find-this-symbol (before cscope/goto activate)
      (evil--jumps-push))))


texts:
I have some problems with another package and think it's because of an old org-mode.
org-version gives me:
Org-mode version 8.2.5h (release_8.2.5h-687-g9d39aa @ /home/b0ef/.emacs.d/elpa/org-9.3.6/)

Not sure what this means. I'm running org-8.2.5h, but from an org-9.3.6 directory?
GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.14) of 2020-03-26, modified by Debian


texts:
I started using the graphical interface for emacs again after a bit.
and I've run into some problems. On boot the theme I'm using Calmer-forest is not getting loaded. However the rest of my .emacs file is getting loaded just fine. (For example I have it set to automatically go maximized on boot, and that is working fine. Along with my repositories.)

When I checked the Messages buffer I got this message:

Failed to enable theme: calmer-forest

Also if I go to my .emacs file, and I M-x eval-buffer the theme loads just fine and dandy.

I already checked this question, and I tried the adjustments listed in the answers. And they did not fix the problem, on boot my emacs frame was still in the white stock theme.

Let me know if any additional details are needed.
I would like to make note, that this is not a huge problem but more of an annoyance.

Finally I'll attach my .emacs

; Initialize preferences
(tool-bar-mode -1)
(add-to-list 'default-frame-alist '(fullscreen . maximized))
(setq inhibit-startup-message t)

; Package repositories
(require 'package) ;; You might already have this line
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/"))
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/"))
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
; Custom Packages
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes")
(add-to-list 'load-path "~/.emacs.d/lisp")
(add-to-list 'load-path "~/.emacs.d/lisp/ESS/lisp/")
(add-to-list 'load-path "~/.emacs.d/lisp/python-django/")
(add-to-list 'load-path "~/.emacs.d/emms/lisp/")
(require 'ess-site)
(require 'python-django)
(require 'emms-setup)
(emms-standard)
(emms-default-players)
;; Set your lisp system and, optionally, some contribs
                    ;Custom Variables
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(custom-enabled-themes (quote (calmer-forest)))
 '(custom-safe-themes
   (quote
    ("7997e0765add4bfcdecb5ac3ee7f64bbb03018fb1ac5597c64ccca8c88b1262f" default)))
 '(org-babel-load-languages
   (quote
    ((emacs-lisp . t)
     (R . t)
     (lisp . t)
     (ditaa . t)
     (python . t)
     (css . t)
     (sh . t)
     (ruby . t)
     (js . t))))
 '(org-babel-python-command "python3"))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )

(setq tramp-default-method "ssh")


texts: How to ignore certain filename patterns in `find-file`/`counsel-find-file`?

texts: When using stock find-file or counsel-find-file, is there a way to ignore certain files that I almost never want to open by hand? Examples include .elc files and backups.


texts: Run latexmk inside z shell instead of shell

texts:
Problem
I am using latexkm to compile .tex documents, and recently I got this error while compiling:
Running `latexmk' on `AF2021_serie5' with ``latexmk -bibtex-cond -pdf -synctex=1 AF2021_serie5''
Rc files read:
  NONE
Latexmk: This is Latexmk, John Collins, 17 Apr. 2020, version: 4.69a.
Latexmk: applying rule 'biber AF2021_serie5'...
Rule 'biber AF2021_serie5': The following rules & subrules became out-of-date:
      'biber AF2021_serie5'
------------
Run number 1 of rule 'biber AF2021_serie5'
------------
------------
Running 'biber  "AF2021_serie5"'
------------
sh: biber : commande introuvable
Latexmk: Errors, so I did not complete making targets
Collected error summary (may duplicate other messages):
  biber AF2021_serie5: Could not open biber log file for 'AF2021_serie5'
Latexmk: Use the -f option to force complete processing,
 unless error was exceeding maximum runs, or warnings treated as errors.

TeX Output exited abnormally with code 12 at Tue Oct  6 21:15:40

I am apparently not the only one to have had this problem (1) but the solution in the link did not fix it for me.
Solutions tried that do not fix the problem
I figured that

I am using zsh as my default shell when I open a terminal, while emacs seems to load sh.
Compiling the .tex files with latexmk from the terminal does not generate this error.
Launching emacs with SHELL=/bin/zsh emacs and then using C-c C-c latexmkdoes not generate this error.
Adding

(setq-default shell-file-name "/bin/zsh")
(setq-default explicit-shell-file-name "/bin/zsh")

to my .emacs does not fix the problem; however when I click on Run Shell Interactively, I can compile the .texwith latexmk and it does not generate this error.

Adding

(setq tex-shell-file-name "/bin/zsh")
(setq TeX-shell "/bin/zsh")

to my .emacs does not fix the error. It still seems that latexmk is ran through /bin/sh.
Additional information
Part of my .emacs:
;; == AucTeX == ;;
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq preview-auto-cache-preamble t) ; stop preview pestering
; (setq-default TeX-master nil)
(add-hook 'LaTeX-mode-hook 'visual-line-mode) ; Word wrapping
(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)
(setq LaTeX-electric-left-right-brace t) ; Automatic close parenthesis
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(setq reftex-plug-into-AUCTeX t)
(setq TeX-PDF-mode t) ; Compile as a PDF
(setq reftex-ref-macro-prompt nil) ; Disable annoying reference prompt screen

;; == RefTeX == ;;
(setq reftex-bibliography-commands '("bibliography" "nobibliography" "addbibresource"))

;; === LatexMK - automatically recompile and run bibtex ===;;
(add-hook 'LaTeX-mode-hook (lambda ()
  (push
    '("latexmk" "latexmk -bibtex-cond -pdf -synctex=1 %s" TeX-run-TeX nil t
      :help "Run latexmk on file")
    TeX-command-list)))
(add-hook 'TeX-mode-hook '(lambda () (setq TeX-command-default "latexmk")))

result of which biber (from zsh)
/usr/bin/vendor_perl/biber
result of which biber (from sh)
/usr/bin/vendor_perl/biber
Final question, I guess
What can I add to my .emacs so that latexmk is ran inside of zsh instead of sh?


texts: I'm working with a file which is zero-indexed. Using M-x linum-mode, I can get emacs to display line numbers. How can I get emacs to start counting from 0 instead of 1?


texts: flyspell inserts clipboard on top of correction

texts:
for me flyspell is broken (or at least the default setup of it) in all versions of Emacs from 24.x - 25.x, running on OpenSuSE Leap 42.3 within KDE 5.8.7 Plasma Desktop.

The behavior is as follows: correcting a word, i.e. choosing a word from the list of suggestions, will

insert the proper word at the cursor position but then
insert into this proper word and at the cursor position the content of the topmost entry of the clipboard

I.e. flyspell will always copy the clipboard content 'on top of' the corrected word.

Any suggestion how to fix this would be welcome.

Mark

Self-answering & workaround: it is unclear if this is an Emacs problem or a hardware issue on Linux. It happens on a Lenovo laptop with trackpoint buttons (t460s). Mouse-button 2, i.e. the middle button, is also used for scrolling in combination with the trackpoint. It seems that flyspell(Emacs?) cannot cope with that.
The solution is either to disable trackpoint scrolling with the middle button in xorg :( or to use mouse-button 3 for the 'correct word' as in How do I disable the emacs flyspell middle mouse correction?


texts:
I would like to repeat M-x string-inflection-camelcase on several words.
For example in:

foo_bar baz qux-quux quuz CORGE_GRAULT GARPLY

I place my cursor on foo_bar and then enter M-x string-inflection-camelcase, which changes foo_bar to FooBar. I can then move forward via M-f and C-f several times and press C-x ESC ESC, which brings up Redo: (string-inflection-camelcase). I can then press Enter to change CORGE_GRAULT to CorgeGrault.

However, this key sequence is slow compared to the C-x z z commands used for a basic repeat.

How can I re-execute string-inflection-camelcase more efficiently after moving my cursor around?


texts: buffer opens in window below if font size is changed

texts:
In my config file I changed the line

(set-face-attribute 'default nil :height 100)

to

(set-face-attribute 'default nil :height 90)

and suddenly, when I try to open a file in a separate vertical buffer with C-x 4 f the buffer opens up below the current buffer. If I change the value back to 100 everything works again as expected. I cannot for the life of me bisect my config file for the bazillionth time. Just drives me insane. When I do C-x 3 it opens up the buffer correctly in a vertical frame.

Minimalistic config:

(windmove-default-keybindings 'control)

;; prevent terminals in emacs to block  standard keybindings
(eval-after-load "term"
  '(progn
     (define-key term-raw-map (kbd "C-h") 'windmove-left)
     (define-key term-raw-map (kbd "C-l") 'windmove-right)
     ))

(add-to-list 'default-frame-alist '(fullscreen . maximized))

;;Save Interprogram paste
;;https://www.reddit.com/r/emacs/comments/30g5wo/the_kill_ring_and_the_clipboard/
(setq save-interprogram-paste-before-kill t)

;; enable clipboard
(setq select-enable-clipboard t)

;; Refresh buffer from filesystem periodically
(global-auto-revert-mode t)

(setq initial-scratch-message nil)

;; turn on highlight matching brackets when cursor is on one
(setq-default show-paren-delay 0)
(show-paren-mode t)
;; Overwrite region selected
(delete-selection-mode t)
;; Show column numbers by default
(setq column-number-mode t)
;; Prevent emacs from creating a bckup file filename~
(setq make-backup-files nil)
;; Disable the horrid auto-save
(setq auto-save-default nil)
;; Settings for searching
(setq-default case-fold-search t ;case insensitive searches by default
              search-highlight t) ;hilit matches when searching
;; Highlight the line we are currently on
; (when window-system (add-hook 'prog-mode-hook 'hl-line-mode))
(blink-cursor-mode 0)
;; Remove lame startup screen
(setq inhibit-startup-message t)
;; I don't care to see the splash screen
(setq inhibit-splash-screen t)
;; Remove trailing white space upon saving
(add-hook 'before-save-hook 'delete-trailing-whitespace)
;; Auto-wrap at 80 characters
(setq-default auto-fill-function 'do-auto-fill)
(setq-default fill-column 80)
(turn-on-auto-fill)
;; Disable auto-fill-mode in programming mode
(add-hook 'prog-mode-hook (lambda () (auto-fill-mode -1)))
;; We don't want to type yes and no all the time so, do y and n
(defalias 'yes-or-no-p 'y-or-n-p)
;; Disable the toolbar at the top since it's useless
(tool-bar-mode -1)
;; Disable the menu bar
(menu-bar-mode -1)
;; scrollbar ?
(scroll-bar-mode 1)
;; Don't ring the bell
(setq ring-bell-function 'ignore)


texts: Avoid cmd window for pinned emacs on Windows 10

texts:
This question How to start Emacs without the cmd.exe window (on MS Windows)? adresses how you start emacs without a cmd window in the first place.

This works out nicely until you pin emacs to your task bar, close it and open it again. Now you have the pinned emacs icon and another icon (not grouped with the pinned one) for the actual emacs frame.

How do I convince Windows to group these two icons (and all further emacs frames) together?


texts: How to add a key map in Emacs source code?

texts:
I found ESC-prefix and Control-X-prefix defined in keymap.c:

initial_define_key (global_map, 033, "ESC-prefix");
initial_define_key (global_map, Ctl ('X'), "Control-X-prefix");

But no matter what I try I can't add a map for Super (Hyper) key.
And this isn't working

Lisp_Object s_map;
...
s_map = Fmake_keymap (Qnil);
Fset (intern_c_string ("s-map"), s_map);
Ffset (intern_c_string ("S-prefix"), s_map);
...
initial_define_key (global_map, 0xffeb, "S-prefix");  // tried many codes
...
initial_define_key (s_map, 'z', "my-function");

Nothing:

s-z is undefined

I also have a question what #define Ctl(c) ((c)&037) does? Because 037 is no a key code of any Control (left or right).

Can you provide a working example of adding a key map to the source code?


texts:
As mentioned in this question, I can not use org mode properly within tmux. So, I would want to remap keybindings like alt+RET for creating a new bullet item or shift + left/right arrow to change an item hierarchy.

How would I do that?


texts:
I just installed a fresh spacemacs, and I'm trying to get SLIME working, but for some reason the package won't remain installed.
After opening a new spacemacs
M-x package-install RET slime

This works fine and I'm able to M-x slime and evaulate my lisp code. However, when I close spacemacs and reopen it, slime is no longer there, and I must repeat these steps.
I suspect it is because spacemacs isn't looking in the right spot for the slime package, but I'm not too familiar with how this works.
Has anyone experienced this problem?


texts: Why am i getting extra indentation-steps on react-router render function?

texts:
I am trying to write a school project in React with react-router v4 in web-mode. When i try to write the render props function web-mode inserts 4 spaces instead of the desired 2.

<Switch>
  <Route
    path={'/home'}
    render={ (props) => (
        <Home {...props} />  <--- 4 spaces
      )} />                  <--- this should be aligned with the 'r'
</Switch>

web-mode-code/markup/css-indentaion-offset are all set to 2.

This becomes a hugh pain both mentally and because of eslint rules that we use.


texts: Add date to mu4e email when forwarding or replying

texts:
I use Emacs and mu4e for email. If I forward an email, the body defaults to this:

From: me <>
To:
Subject: Fwd: ...
--text follows this line--

Sender <> writes:
...

I would like mu4e to add the date of the email forwarded, such as:

On 1 October 2019, at 18:07, sender <> wrote:
...

I looked at the source code of mu4e-forward, mu4e-compose, and mu4e~proc-compose without seeing where the text is added. I think it's in:

  (mu4e~proc-send-command
    "cmd:compose type:%s docid:%d extract-encrypted:%s use-agent:true"
    (symbol-name type) docid (if decrypt "true" "false")))

but I don't know how to hack "cmd:compose ..."

Has anyone tweaked the default message when forwarding or replying?


texts: Invalid coding system: auto-save-coding when trying to recover auto-save files

texts: Sometimes when I try to run recover-this-file I get an error Invalid coding system: auto-save-coding which prevents the file from being recovered. I had to manually find the autosave file and copy contents. Strangely it doesn't happen to all of my recover-this-file attempts and I'm not sure what's the cause of it. Also I could recover files with UTF-8 characters so I don't think non-ASCII characters are really the cause either.


texts: Skip over remaining errors in current file to next error in next file

texts:
tl;dr

I am using :cn in Evil's Ex command line and would like to use :cnf as well, but it is not there, and I don't know what function to bind it to.

Details

As a former Vim user who is slowly coming to see the light, I am using :cnext in Evil's Ex command line in Spacemacs to navigate errors from the Scala compiler/SBT. I am currently fixing errors caused by missing imports: thus, I can add one line at the top of the file and fix numerous errors. As such, I would like to skip straight to the next file with problems, i.e. Vim's :cnfile. :cnf is not bound, and I cannot find something appropriate to bind it to.

I did find that :cn is bound to next-error, which seems to be associated with Compilation Mode. However that seems to be misdirection as compilation-next-file gives "Not in a compilation buffer".

Even more Details

My setup includes the following, and I'm not entirely clear how much of this is relevant, so I'll list it all:

Spacemacs
Evil mode
Flycheck
LSP Mode
Metals


texts:
I have a lot of notes in separate files that I'd like to put on a hugo website using ox-hugo. However I can't seem to batch export the files.

I've tried:

using dired+ to execute diredp-do-apply/eval
using emacs --batch --eval "(progn (require 'org) (require 'ox-hugo) (org-hugo-export-wim-to-md))" "$@".

In both cases I get the message

The entire file is attempted to be exported, but it is missing the #+title keyword

which makes no sense to me since there are #+TITLE: title lines in each of the files and they export fine when visiting them in an emacs buffer using the same function.

Any help as to what I'm doing wrong is appreciated.


texts: Emacs takes a very long time to open a TeX file

texts:
After a fresh install of Emacs (GNU Emacs 25.1.1 (i686-w64-mingw32) of 2016-09-18)
and AUCTeX (last version from ELPA) on Windows Vista, when I open a TeX file, Emacs takes an extremely long time to load the file (>2minutes).
In the minibuffer I see a message telling Applying style hooks...; the delay starts exactly when I see this message.
After this delay, when I open the message buffer I see something like this:

Applying style hooks...
Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/geometry.elc...done
Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/amssymb.elc...done
Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/amsmath.elc...done
Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/amstext.elc...done
Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/amsbsy.elc...done
Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/amsopn.elc...done
Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/amsthm.elc...done
Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/pdfsync.elc...done
Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/epigraph.elc...done
Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/multicol.elc...done
Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/makeidx.elc...done
Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/fancyhdr.elc...done
Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/footmisc.elc...done
Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/relsize.elc...done
Loading c:/Users/user/.emacs.d/elpa/auctex-11.89.7/style/bm.elc...done
Applying style hooks... done

(Incidentally, the base names of the *.elc files are the names the packages I use in my TeX file).

With Emacs 24.5 I didn't have this problem.

Any idea how to solve this issue? How to disable the loading of these style hooks?

If I open an empty TeX file, this delay is significantly reduced.
If I run emacs without my init file, this delay disappears.

Edit: Thank you for your comments.
After your suggestions, I bisected my init file and I localized the code responsible for this delay. That was (setq TeX-parse-self t).


texts: How set a setting with #+OPTIONS to a list as argument?

texts:
Well, my desired behavior is to set this:

#+OPTIONS: tasks:(DONE IN-PROGRESS)

To export the tasks with these keywords, however I think I don't understand well how the syntax for list looks like. So setting this way doesn't works. I can set tasks:done to export the DONE tasks, but the IN-PROGRESS is useful to include for testing. (I'm writing notes on org-mode to export to LaTeX -> PDF). I can set too tasks:t, but I don't want TODO items.

On emacs internal documentation of org-mode I saw that:

org-export-with-tasks is a variable defined in ‘ox.el’.
Its value is t

Documentation:
Non-nil means include TODO items for export.

This may have the following values:
t                    include tasks independent of state.
‘todo’               include only tasks that are not yet done.
‘done’               include only tasks that are already done.
nil                  ignore all tasks.
list of keywords     include tasks with these keywords.

This option can also be set with the OPTIONS keyword,
e.g. "tasks:nil".

You can customize this variable.

And the official documentation of org-mode Export Settings I read that:

  tasks:
  Toggle inclusion of tasks (TODO items); or nil to remove all tasks; or todo to remove DONE tasks; or list the keywords to keep (org-export-with-tasks).

But I still don't have a clue how set the setting tasks as a list argument. Seems I'm losing something fundamental here. Thanks for any guidance here.


texts: Change prefix key for compose-character (C-x 8)

texts: According to the documentation, the key C-x 8 can be used to insert non-ASCII characters. For example, C-x 8 ' a will insert "á". Is it possible to change the prefix key to another (shorter) value, like for example, M-'? I find M-' to be easier to type than C-x 8, so this change would make inserting "á", "é", etc. much faster.


texts:
this question actually arises because I like to use non-monospaced fonts, (Sabon, Minion, Garamond, etc.) This cause a problem when use org-indent-mode, since the text under the headlines are now not aligned with the headlines. Example:

The font is Georgia. Now,if I change to consolas:

I think the problem is that in non-monospaced fonts, the "space" and the * does not take up the same space. Though I do not know how to solve this.
I've searched the internet and couldn't find a tutorial to fine tune the indentation myself. I've tried to read org-indent.el but it's a long shot for me to understand.
Help is greatly appreciated!


texts: Limiting theme to frame (for emacs 24 themes)?

texts:
Is it possible to have separate theme for every emacs frame (for new, emacs 24, themes)?

For old themes, there was color-theme-is-global, but I can't find anything similar for new themes...


texts: Error when activating org-mode unless speedbar loaded first

texts:
Whenever I open an org file before the speedbar package is loaded, org-mode produces the following error:
Symbol’s function definition is void: speedbar-add-supported-extension

The error above is resolved if I (require 'speedbar) in my init file but, as a learning experience, I was wondering if there's a way of deferring loading of speedbar until such a time when org-mode is actually initialized for the first time.
I've tried:

specifying the :after prop to use-package:
(use-package org
  :hook (org-mode . init/mode/org)
  :after speedbar
  :config
  (init/org-mode))

setting up an advice
(advice-add 'org-mode :before #'init/org-mode))

Nothing worked so far. Is there a way of accomplishing this?
EDIT
Using Emacs 26.3 and org-mode 9.1.9 .


texts: I am looking for a solution where i can write a string to a Buffer without actually visiting it. I want to achieve this purely through an elisp function. Is it possible ?


texts: gnus-registry-marks; Any chance to search or filter for?

texts:
i want to search or filter with the registry-marks i set.
Is this possible?
I couldn't find a function in the gnus documentations.


texts:
The function ps-print-buffer-with-faces prints an Emacs buffer.  Is
there a way to print a frame with more than one buffer in it?  I would
like to print an Emacs calc frame both with the RPN stack and the
trail buffer.


texts: Is it possible to enable minor modes in org babel blocks?

texts:
I use org-edit-special and it's really convenient, when editing source code, that's stored in org files. However I often only want to copy some code and I'm used to the highlighting of highlight-parentheses-mode when I'm reading elisp and I only want it to be turned on in this situation.

Another example is line numbers in large babel blocks. I avoid using files for my own code and I have several blocks that don't fit on my screen. As I don't use nlinum in my org files this would be nice to additionally emphasize large code blocks.

Is it possible to enable the features of minor modes in org buffers, but only activate them for certain blocks ? Just like org-src-fontify-natively enables syntax highlighting in source code blocks.


texts: What function will return the total EFFORT of the subtree at point?

texts:
I am looking for an elisp function that will return the total EFFORT of the subtree at point.

By "total EFFORT" I mean the "Sum times" value that would be
produced by giving the subtree a :COLUMNS: property of
%EFFORT{:}, and then switching the subtree to column view, and looking at the column value.

So in the example below, if point is on headline 'test' and I call hypothetical function get-subtree-effort, the function would return "0:14".

* test
:PROPERTIES:
:COLUMNS:  %EFFORT{:}
:END:
** e1
:PROPERTIES:
:Effort:   0:07
:END:
** e2
:PROPERTIES:
:Effort:   0:07
:END:


texts: Cycle Through Org Mode Todo Tags Based on Tag

texts:
I have one org file, inbox.org, which I use for keeping all of my todos.  I have todos of several categories, like:

work
memory
fitness
outreach

and so on.
Is there a way to order these tags to define a cycle, which would promote the next todo item with whichever tag comes next in the cycle, to A# priority?
In other words, I want to be able to define somewhere ("work", "memory", "fitness", "article", ...) and once I complete the next "work" item, it's moved to the back of the list, and now my next "memory" item (only one, preferably) is given A# priority.


texts: Recursion with let and cl-labels or just cl-letf?

texts:
I found this code on stackoverflow (from Rainer Joswig):

 (defun listFormat ()
   (cl-labels ((place-index (idx l)
        (if (null l)
            nil
            (append (list (first l)) (list idx)
                  (place-index (+ idx 1) (rest l))))))
    (place-index 1 l))))

and I changed it by adding a let form and cl-labels:

(defun listFormat ()
   (let ((l '(a b c d)))
   (cl-labels ((place-index (idx l)
                         (if (null l)
                             nil
                           (append (list (first l)) (list idx)
                                   (place-index (+ idx 1) (rest l))))))
     (place-index 1 l))))

Is this a good practice? In the code I'm working on I need to establish variables with let, then do a recursive function, i.e., I don't want the stuff inside the let to be repeated on each recursion. I'm wondering if there is a way to combine this under cl-letf. I try this, but it's not liking it:

(defun listFormat ()
   (cl-letf ((l '(a b c d))
             (place-index (idx l)
                          (if (null l)
                              nil
                            (append (list (first l)) (list idx)
                                    (place-index (+ idx 1) (rest l))))))
     (place-index 1 l)))

complaining of void function idx. So, is there a way to combine let content that shouldn't be resursed with an inner recursion function?


texts: Is (forward-char N)'s runtime complexity O(N)?

texts: Internally, the text of a buffer is stored as a char array. The encoding used is based on UTF-8, which may use a variable number of bytes to represent different code points. Does the variable-length nature of the encoding mean that (forward-char N)'s runtime complexity is O(N)? Or maybe other operations are O(N)?


texts: plantuml requires a header argument (Emacs 24 on Windows' Ubuntu Subsystem)

texts:
I'm trying to output images using plantuml-mode.  It seems I have plantuml-mode installed successfully, as I can activate the major mode, but I am unable to evaluate using C-c C-c:

PlantUML requires a ":file" header argument

Here is the code I am trying to evaluate:

#+BEGIN_SRC plantuml
@startuml
(*) --> "First Activity"
-->[You can put also labels] "Second Activity"
--> (*)
@enduml
#+END_SRC

And here is what I have in my .emacs file:

(require 'plantuml-mode)
(require 'ob-plantuml)
(add-to-list
   'org-src-lang-modes '("plantuml" . plantuml))

I have tried using plantuml-mode on a mac before and I never had to manually set a header argument.  Can anyone help me figure this out?


texts: Prevent call-process from stealing focus

texts:
When Emacs executes call-process after the focus has moved to another window (this is after a compilation step which takes some time to finish) it grabs the focus and causes the pointer to move to the upper-right of the Emacs frame. This is on Linux using gnome-shell.

Is there any way to disable this behavior? Either globally or on a per-call basis?

Edit: Found it. The frame was being explicitly set by select-frame-set-input-focus in a function that I was adding to compilation-finish-function. I should understand the code I copy-and-paste a little better.


texts: 80 columns with autofill-mode doesn't return automatically

texts:
I have set autofill to 80 with C-x f and autofill-mode is enabled (I see Fill in the modeline), but it doesn't return automatically after 80 characters.

How can I make it works ?


texts:
Caveat: I am a complete and total noob to e-macs.
Background: I've set up Emacs to open with one frame and two windows sized the way I want and to open an initial Org file every time in the left-hand window of the frame and a blank buffer in the right-hand window of the frame, just like I wanted.
Problem: In the left window of the frame, I have an Org file with links. Link A (for example) should open an Org file in the right window of the frame. Link B should open an Org file in the left window of the frame. I distinguish A from B by use of the word Main in my Org file names. Ex. MainList.org, MainShoppingList.org, GroceryShopList.org, HardwareShopList.org etc. So Emacs upon startup opens MainList.org (left window), I could follow a link to MainShoppingList (opens in left window) then select GroceryShopList (opens in right window). At least that's what I'd like.
What I've Tried:
(both attempts inside init.d file)
 ;; This gets EVERY link to open in another window
  (setq org-link-frame-setup
      '((file . find-file-other-window)
        (wl . wl-other-frame)))

 ;; this opens every link in the same window
 ;; I think I have the wrong "regexp" or variable (link)
  (setq org-link-frame-setup
    '(if (string-match "MAIN" link)
         (file . find-file)
       (file . find-file-other-window)))

Could anyone help me out here, point me in the right direction?


texts: If I move frame during Emacs startup, it moves back at the end of startup

texts:
I have a fairly long startup for Emacs 24.4 on Microsoft Windows 7. I try to move the frame where I want it during startup, but it snaps back after all the startup code is done running. I don't appear to have any Emacs settings in the Registry.

The simplest way to reproduce this is to run emacs -Q --eval '(sleep-for 3)' and move the frame with the mouse during the sleep time. After three seconds it snaps back to its initial location.

I tried to figure out at what point in Emacs startup this movement occurs by starting up normally (no -Q) with the following in init file:

(add-hook 'after-init-hook (lambda () (message-box "after-init")))
(add-hook 'emacs-startup-hook (lambda () (message-box "emacs-startup")))
(add-hook 'window-setup-hook (lambda () (message-box "window-setup")))

If I do this, I get all three message boxes before the frame moves back.

Is there a way to keep the frame where I move it during startup?


texts: Evaluate a variable when inserting text into a buffer

texts:
When I open a fresh file for coding, I like to insert a header like this:
#####################################################################
# Purpose:
# Author: me (me@someplace.com)
# Date:
#####################################################################

I keep this text in a file called header in ~/.emacs.d/ and I insert it like so:
;; Insert header to file
(defun header()
  "Insert header into file"
  (interactive)
  (insert-file "~/.emacs.d/header"))

which I call with M+x header. Very cool! I also have a function for adding the date:
;; Insert today's date
(defun today ()
  "Insert today's date"
  (interactive)
  (insert (format-time-string "%Y-%m-%d")))

which I invoke with M+x today after inserting my header text in order to populate the Date: field.
Q: Is there a way that I can merge these functions such that the date is automatically inserted after Date: when I insert my header text? For example, can I add (format-time-string "%Y-%m-%d") after Date: in my header file and evaluate it somehow when it is inserted?


texts: Powerline: display selected window's mode line in all windows

texts:
I know this is a slightly odd request, but I'd like to make all the mode lines for windows within a frame identical. I'm using powerline with the default spacemacs theme.

So, if I have three windows open with three different active buffers, I'd like the mode lines for all three to show information about the buffer in the currently selected window. (And if I select a new window, they should all change.)

I got the inactive/active styles to line up by redefining powerline-selected-window-active to always return t, but I can't figure out how to point them at the selected window's buffer rather than their own active buffer.


texts: Is it possible to use let-binding for setting keys?

texts:
in LaTeX mode C-cC-f calls the tex-file function. I performed a litte tweak to that function and I wrote a tex-file-mod function.
Now I'd like to call the tex-file-mode with the same key-binding during some scripts of mine and to restore the default behaviour when I exit these scripts.

Is there a way to do that using a let-binding way?

I hope I've been enough clear in my question.

EDIT. I tried, on a Drew's hint, this:

(let (latex-mode-map)
     (define-key latex-mode-map "\C-c\C-f" 'tex-file-mod))

But it doesn't restore the default key-binding at the script exit.


texts:
When accessing a database through an inferior process (M-x sql-msql) the history for the current session history (M-p/n) works Ok. But when restoring history entries from a previous session the string '\40' is found where spaces are supposed to be. ej. select\40username\40from\40users;.

I'm guessing the issue is related to 40 being 32, the ascii value of space, in octal. But I can't figure out where things go south. Any idea or how to fix this or what could be causing this behaviour?


texts: how to get today's total logged time programatically?

texts:
I'm trying to set the title of my emacs to how much work I've done in total.

I would like to get the time I've logged today programatically. (like when you open agenda and press 'R'). How do I do that?

I tried:  (as per this link)

(format " Today's total: %s " (org-minutes-to-clocksum-string (org-clock-sum-today)))

But that returns 0:00


texts: html-mode and custom backspace keybinding

texts:
I changed the C-h key binding to be used as backspace.

(define-key key-translation-map (kbd "C-h") (kbd "< DEL >"))

Now, this works flawlessy pretty much everywhere except in html-mode. When I'm in an HTML command minibuffer and press C-h, instead of deleting the last character this message appears:

  You are inserting a skeleton.  Standard text gets inserted into the buffer
  automatically, and you are prompted to fill in the variable parts.

How could I solve this problem if possible?


texts:
I want to quickly embed images in an org document and am trying to use org-download to help me.  However, due to a silly bug in Firefox, images are saved as .bmp files.  The result is that org-download embeds a .bmp which Emacs can't render.

I see three ways to solve this problem:

Fix Firefox
Configure Emacs to render .bmp files
Convert the saved files to .png or other format

Option 2 seems simplest.

So, how can I render .bmp images in Emacs?

I am using GNU Emacs 26.2 (build 1, x86_64-w64-mingw32) of 2019-04-13, obtained directly from gnu.org, on Windows 10.  It seems that one method to display .bmp files is to use imagemagick.  I have imagemagick installed and on my path.  Unfortunately, (image-type-available-p 'imagemagick) is nil, which I take to mean the GnuEmacs .exe was not compiled with imagemagick support.  I have configured Emacs to work with .png files, having installed the appropriate png dll.  I wonder, could the problem be solved similarly, i.e. via a libbmp.dll?  I could not find any such library.

Or, am I too far down the XY rabbit hole?  Is there a different approach which will allow me to quickly embed images in an org document?


texts: Emacs cannot start from spotlight, "Method 'zsh' is not known"

texts:
I just buy a new macbook and I want to move my old working env to it. I used emacs-plus@27.0.91 which was installed by homebrew:
d12frosted/emacs-plus/emacs-plus@27: stable 27.0.91, HEAD
/usr/local/Cellar/emacs-plus@27/27.0.91 (4,014 files, 131MB) *
  Built from source on 2020-07-15 at 20:36:39 with: --with-no-titlebar --with-jansson --with-mailutils --with-modern-icon

I cloned my old .emacs.d config repo and it works well from terminal using both -nw, and without -nw.
But when start Emacs from spotlight, Emacs will give me an error message Method 'zsh' is not known/Method 'zsh' is not known/tramp-error: Method 'zsh' is not known, the Emacs window shows the following error, and press any key now will also only triggers this error.
I tried to bug-hunt the init file, but found no error.
Btw, no zsh is found in my .emacs.d, though I am using zsh in terminal. And no settings relative to tramp.
Here is my .emacs.d : https://github.com/cmal/.emacs.d
Can you help me out?


texts: How can I prevent gdb *input/output* buffer from aggressively popping up in frame?

texts:
When using gdb with M-x gdb, the *input/output* buffer always pops up aggressively in any frame which has focus and isn't already displaying it. I would like the *input/output* buffer to stay quietly in the background unless I manually bring it up.

Here's a very simple example with emacs -Q

run M-x gdb. give a program of bash and hit Return

in the *gud-bash* window, enter run -c "while true; do echo hi && sleep 1; done"

Notice how the *input/output of bash* window pops up. If you dismiss that buffer with C-x 1 from the *gud-bash* window, it comes back as soon as gdb produces any more stdout. That's the behavior I don't want.

In particular, now run M-x make-frame (from the *gud-bash* window). Notice how in the new frame, *input/output of bash* also pops up! So it demands one window out of every single emacs frame.

How can I fix this?

Edit: I almost forgot to add - emacs version of

GNU Emacs 24.5.2 (x86_64-unknown-linux-gnu, GTK+ Version 2.24.30)


texts:
I use xdvi and auctex with

;;; 1
(setq tex-dvi-view-command "xdvi -editor 'emacsclient -a emacs --no-wait +%l %f'")

All works fine. Now I want xdvi to use the options -s 6 -geometry 917X736. First I tried

;;; 2
(setq tex-dvi-view-command "xdvi -s 6 -geometry 917X736 -editor 'emacsclient -a emacs --no-wait +%l %f'")

That doesn't work. Next I tried

;;; 3
(setq xdvi-program "xdvi -s 6 -geometry 917X736")

which also doesn't work. What does work is to remove 1 and use

;;; 4
(setq TeX-view-program-selection
  '((output-dvi "DVI Viewer")))
(setq TeX-view-program-list
  '(("DVI Viewer" "xdvi -geometry 917X736 -s 6 %o")))

which unfortunately looses the search forward via emacsclient. Does anyone know how to set the xdvi zoom and geometry options in 1, or to set the emacsclient in 4? I would be happy to use either solution. I'm using emacs-24.4 and AUCTeX 11.88. Thanks.


texts: Extending Go function arguments show hotkey

texts: how to add the ability to bind a hotkey to display the function's arguments? Is it even possible?


texts: Inhibiting `finished:` message from `async-shell-command`

texts:
Running (async-shell-command "echo test") prints echo test: finished to the echo area upon completion. I am running a function in the background on a loop with a special handler, and the message is just distracting for me. How can I programmatically disable it for this invocation?

Normally I would do this with a local (let ((inhibit-message t)) …), but this is presumably happening in a continuation somewhere.


texts: Switch to custom views in Agenda via org-agenda-view-mode-dispatch

texts:
Is ist possible to add custom views to agenda which can be accessed via org-agenda-view-mode-dispatch?

Its very convenient to press just "v" and "l" to make agenda show completed tasks. It would be great to be able to filter the current view for special TODO keywords or tags the same way. Like pressing "v" and "n" to only show todos with NEXT keyword in the current agenda view.

I am fairly new to emacs.


texts: Don't delete leading space after org-insert-link

texts:
When I do org-insert-link and input a link description the space before the description gets deleted. Can this be prevented?

Example:

I type: "see " (i.e. with space), then hit C-c C-l, insert link, description: "here".
The result is:
"seehere" instead of intended "see here" (with space between the words).


texts: Howto include a local theme in spacemacs

texts:
I have a local theme, firebelly, that I wish to use in my local Spacemacs config.

I've tried putting this into a custom layer.

~/.spacemacs.d/layers
├── firebelly
│   ├── local
│   │   └── firebelly
│   │       ├── firebelly-theme.el
│   │       ├── readme.md
│   │       └── screenshot.png
│   └── packages.el

With a simple configuration.

;; I have to manually do this to make colors work
(load "~/.spacemacs.d/layers/firebelly/local/firebelly/firebelly-theme")

(defconst firebelly-packages
  '((firebelly :location local)))

But Spacemacs still yields this error:

  An error occurred while applying the theme "firebelly", fallback on theme
  "spacemacs-dark". Error was: (error Package ‘firebelly-theme-’ is unavailable)

Of course I've tried these avenues, all to no avail.

Spacemacs custom color
What's the best way to use local
packages in spacemacs?
How to use a local version of a package
in spacemacs?


texts: Getting helm to do completion-at-point in comint-mode(and child modes)

texts:
Background

I am working with prolog in emacs and using prolog-inferior-mode which has comint-mode as a parent mode.

The default completion in comint-modes is rather terrible, and I was hoping to be able to use helm to do tab completion on the history. I discovered tab-always-indent and set it to complete, which triggers completion when appropriate upon hitting the tab key. I also discovered completion-at-point-functions and wrote a helm source that grabs the previous comint history, which is stored in comint-input-ring. This variable only exists locally in comint buffers, it seems.

I wrote the following code:

(defun get-comint-candidates ()
  (interactive)
  (let ((start (car comint-input-ring))
        (end (car (cdr comint-input-ring)))
        (completed (append (nthcdr 2 comint-input-ring) nil)))
    (butlast (nthcdr start completed) (- (length completed) end)))
  )

(defun comint-completion-source ()
  (interactive)
  (helm :sources '((name . "helm comint-mode")
                   (candidates . get-comint-candidates)
                   (action . (lambda (cand) (insert cand)))
                   )
        :input (thing-at-point 'word)
        )
  )

(add-hook 'comint-mode-hook (lambda () (setq completion-at-point-functions 'comint-completion-source)))
(setq tab-always-indent 'complete)

The problem

If I am inside the prolog comint buffer and call get-comint-candidates, it returns the candidates as it should. However, whenever I call comint-completion-source either manually or using the tab key, the completion buffer is empty. Moreover, I'm not sure if this is the right solution. I would prefer to be able to basically tell helm that it's supposed to complete from my source and use the default helm completion-at-point functionality, such that I don't have to manually take care of inserting only the parts of the chosen completion that I haven't already typed(that is to say, if I have typed fo and complete foobar, I want it to result in foobar, not fofoobar).

I would be very grateful for any hints or tips on how to solve this, as well as any on working with comint-mode and its children modes in general.


texts:
Recently I "fixed" issue with locking when I access LXSS backed P9 network FS mounted in Cygwin by:
(setq create-lockfiles nil)

I read (info "(emacs.info) Interlocking") but still didn't get it.
Is it defense against simultaneous writing from another Emacs? Or general outside edits?
Is it the "fancy" way to save file's timestamp?
Is it make sense to use this feature from Cygwin Emacs (which emulated symlink API)?
I believe that Emacs is doing mtime check (what about fsize??) anyway and this "symlink" business looks stupid...


texts: Can I have the git-log "--all" option be initially selected?

texts: When I press the "l" key in the main Magit status mode, it pops up a window where I can adjust the options to be passed to the magit log command.  Can I arrange for the --all option to always be initially selected, just as the --graph option is?


texts: Change C-z from Minimise to Toggle Evil Mode

texts:
I am a fairly new emacs user and would appreciate any help you could offer.

I have recently installed the evil mode package onto my emacs. The package itself works perfectly, however, the default toggle binding C-z is not working as expected. When outside of evil mode it minimises the current frame. If I invoke evil mode through M-x RET evil-mode then input C-z, it will toggle back as expected.

I have attempted a fix by adding the following to my init.el file in an attempt to overwrite the existing key binding:

(setq evil-toggle-key "C-z")
(require 'evil)

I have also tried

(global-unset-key (kbd "C-z"))

alone and in conjunction with the previous but this seems to completely unbind the key chord.

Does anyone have a solution which changes C-z from 'minimise frame' to 'toggle evil mode'?


texts: How to export tables in a xltabular environment to TEX/PDF without xltabular being nested in a "table" environment?

texts:
My goal is to have a table,

which can be customized with tabularX (width == textwidth),
can break over multiple pages
and is able to have zebra stripes (xcolor).

I tried many packages, even the (long)tabu environment, which does not work with xcolor.
What I try now is the xltabular environment. In Org-mode
  #+latex: \rowcolors{2}{lightgray}{white}
  #+ATTR_LATEX: :environment xltabular :width \textwidth :align |l|X|l|
  #+name: tbl:primersequencing
  #+caption: Table of forward (fwd) and reverse (rev) primers for sequencing. For more information see xxx.
  |---+----------------+---------------------------------+-----------------|
  |   | Name           | Sequence (5' \to 3')            | Origin          |
  | / | <>             | <>                              | <>              |
  |---+----------------+---------------------------------+-----------------|
  |   | LacOp- (fwd)   | CGG ATA ACA ATT TCA CAC AG      | standard primer |
  |   | TP 222 (rev)   | CAG ACC GCT TCT GCG TTC TG      | constructed by  |
  |   | malE 222 (fwd) | GGT CGT CAG ACT GTC GAT GAA GCC | standard primer |
  |   | M13F222 (rev)  | AGG GTT TTC CCA GTC ACG ACG TT  | standard primer |
  |---+----------------+---------------------------------+-----------------|
....
....
  |---+----------------+---------------------------------+-----------------|
  |   | LacOp- (fwd)   | CGG ATA ACA ATT TCA CAC AG      | standard primer |
  |   | TP 222 (rev)   | CAG ACC GCT TCT GCG TTC TG      | constructed by  |
  |   | malE 222 (fwd) | GGT CGT CAG ACT GTC GAT GAA GCC | standard primer |
  |   | M13F222 (rev)  | AGG GTT TTC CCA GTC ACG ACG TT  | standard primer |
  |---+----------------+---------------------------------+-----------------|

I am able to color it and to have its width equal to the textwidth. But I'm not able to break at the end of a page and continue on the next, because the org mode wraps it into an standard table environment (which can't split over multiple pages. This is also the problem with other environments (ltablex, lxtable...)
\begin{table}[htbp]
\caption{\label{tab:org6696853}Table of forward (fwd) and reverse (rev) primers for sequencing PERK-TMR constructs used in this work. For more information see \ref{sec:orgee2a843}.}
\centering
\begin{xltabular}{\textwidth}{|l|X|l|}
\hline
Name & Sequence (5' \(\to\) 3') & Origin\\
\hline
LacOp- (fwd) & CGG ATA ACA ATT TCA CAC AG & standard primer\\
TP 222 (rev) & CAG ACC GCT TCT GCG TTC TG & constructed by\\
malE 222 (fwd) & GGT CGT CAG ACT GTC GAT GAA GCC & standard primer\\
M13F222 (rev) & AGG GTT TTC CCA GTC ACG ACG TT & standard primer\\
\hline

....
....

\end{xltabular}
\end{table}

I'm not familiar with Elisp and advanced export modi. I tried to get a regex/ replace to work, but failed.


texts:
I'm trying to get to grips with printing from emacs.
I've added the following to my .emacs file:
(add-to-list 'lpr-switches "-P HP_ENVY_Photo_6200_series_685E88_")
(add-to-list 'lpr-switches "-o sides=two-sided-long-edge")
(add-to-list 'lpr-switches "-o number-up=2")

When I try to print (so far I've only tried with M-x print-region), the following is written to * Messages * (after a prompt about printing to the default destination):

Spooling with options -P HP_ENVY_Photo_6200_series_685E88_...
user-error: Spooling with options -P HP_ENVY_Photo_6200_series_685E88_...done: /usr/bin/lpr: No such file or directory

If I cut the displayed command and paste it to the command line, prefixed by lpr  and suffixed by a space and the name of an existing file, that file is printed without problem, which makes me think that I haven't mistyped the over-long printer name. What's going wrong?
I'm running Linux Mint Ulyana 20 and GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.14) of 2020-03-26, modified by Debian
UPDATE
From * Help * in response to C-h v exec-path

exec-path is a variable defined in ‘C source code’.
Its value is
("/opt/Qt/Tools/QtCreator/bin" "/opt/chromedriver" "/opt/fossil" "/opt/ActiveTcl-8.6/bin" "/usr/local/sbin" "/usr/local/bin" "/usr/sbin" "/usr/bin" "/sbin" "/bin" "/usr/games" "/usr/local/games" "/snap/bin" "/usr/lib/emacs/26.3/x86_64-linux-gnu")

From the command line:

$ which lpr

/usr/bin/lpr


texts: How to search for lines not containing some text?

texts:
In a large file, I want to find which lines which do not contain a given string, grep -v basically.

M-x grep helps, but it forces to protect special characters, is not interactive nor incremental, and doesn't let me edit the file at matches.

How to find such lines ?


texts: How to set a fractional font size in Emacs?

texts:
I'm so close to getting two 80-char vertical buffers side by side on a 1366px wide monitor. I've got a cool frame font,

(set-frame-font (font-spec :family "Monkey" :size 20 :antialias nil))

I've removed my scrollbars, set my fringe to 1px width, and my line numbers to dynamic.

I'm one column away from editing heaven. The thing is, my eyes can't handle the tiny fonts anymore, so I can't go down to size 19. I tried setting 19.5, but it just made the font larger.

How can I set a fractional font size in Emacs?

Environment:

Ubuntu 14.04 amd64
Emacs 24.3.1, installed from package


texts: How to make changing minor-mode lighter in modeline?

texts:
In minor-mode-alist documentation it is described that lighter can be a lisp expression that is evaluated to get text used in the display of minor mode in mode line. It has the form of (:eval ...)

Given a function that makes such a string upon evaluation, for example, called compose-mode-line (no parameters), how minor-mode's lighter can be set to results of evaluation of that function?


texts:
I have a similar problem to the one asked here Exporting org file breaks when upgrading to orgmode 8.3, org-mode cannot export org files and raises this error:

apply: Wrong type argument: listp, #("Peter's Emacs Config" 0 19 (:parent (#0)))

The solution aw has given works for me, that is, C-u M-x org-reload.

Nonetheless, I wanted to know why Emacs broke and how to fix such problems once and for all. Have not found anything on the Internet or on the GitHub page of org-mode.

I am using GNU Emacs 26.0.50.2 (x86_64-pc-linux-gnu, GTK+ Version 3.10.8)
 of 2016-10-26 and org-version 9.0.5.


texts: Unable to make `solidity-flycheck-solc` and solidity-flycheck-solium-checker-active work

texts:
I am unable to make  solidity-flycheck-solc work. I am not sure what I am doing wrong. solidity-mode works where the font color changes. But flycheck does not work like it does on python files.

In order to check activated, I typed uin foo or change keywords inside my .sol file, where there was no warning message generated, or their color changes to red or yellow.

$ solc --version
solc, the solidity compiler commandline interface
Version: 0.6.0+commit.26b70077.Darwin.appleclang
$ which solc
/usr/local/bin/solc

I have following setup in .emacs file:

(require 'flycheck)
(setq solidity-solc-path "/usr/local/bin/solc") ;; This better be set before requiring solidity mode.
(setq solidity-solium-path "/Users/alper/.npm-packages/bin/solium")
(setq solidity-flycheck-solc-checker-active t)
(setq solidity-flycheck-solium-checker-active t)

(require 'solidity-flycheck)
(require 'solidity-mode)
;; (load "solidity-flycheck")
;(load "solidity-mode")
(setq solidity-comment-style 'slash)
(add-hook 'solidity-mode-hook
          (lambda ()
            (set (make-local-variable 'company-backends)
                 (append '((company-solidity company-capf company-dabbrev-code))
                         company-backends))))
(provide 'init-solidity-mode)

(add-hook 'after-init-hook #'global-flycheck-mode)

=> I removed solidity-* files under ~/emacs.d/elpa/. Then I install through el-get, so it installs into el-get/solidity-mode where when I try to use (require ...) I get an error where it cannot find the file, so I use (load ...).

This I what I  get for M-x => flycheck-verify-setup:

Syntax checkers for buffer eBlocBroker.sol in solidity-mode:

  solidity-checker
    - may enable: yes
    - predicate:  t
    - executable: Found at /usr/local/bin/solc

The following syntax checkers are not registered:

  - solium-checker

Try adding these syntax checkers to `flycheck-checkers'.  Flycheck
Mode is disabled.  Use C-u M-x flycheck-disable-checker to enable
disabled checkers.

--------------------

Flycheck version: 31
Emacs version:    26.3
System:           x86_64-apple-darwin19.0.0
Window system:    nil


texts: Modify the modeline to show all emacsclients editing buffer

texts:
Is there a way to modify the Emacs modeline so I'll be able to see all the emacsclients or just the number of emacsclients actually editing/displaying the buffer I'm currently working on?

I've found inside server.el.gz:

;; The buffer local variable "server-buffer-clients" lists
;; the clients who are waiting for this buffer to be edited.
;; The global variable "server-clients" lists all the waiting clients,
;; and which files are yet to be edited for each.

And this is one example of ouput when I call M-x describe-variable server-buffer-clients:

server-buffer-clients is a variable defined in `server.el'.
Its value is
(#<process server <5>> #<process server <3>> #<process server <1>>)

Local in buffer basics.hs; global value is nil

  Automatically becomes permanently buffer-local when set.

Documentation:
List of client processes requesting editing of current buffer.

I don't really understand how to interpret the line: (#<process server <5>> #<process server <3>> #<process server <1>>). Thanks for your suggestions.


texts: tramp-default-method-alist unbound at startup?

texts:
Since upgrading to Emacs 24.5 my init file does not load.  Starting with the --debug-init option shows that tramp-default-method-alist seems to be unbound:

Debugger entered--Lisp error: (void-variable tramp-default-method-alist)

However, I can find nothing in the online manual that suggests that this variable has been renamed or deprecated.

The exact code in init.el that is causing the error is as follows (except for the server name inside the first set of double quotes):

(add-to-list 'tramp-default-method-alist
     '((regexp-quote "foo.com") "ssh"))

My intent, if it isn't clear, is to set SSH as the TRAMP method for all servers a.foo.com, b.foo.com, etc.  (These are remote machines I have to connect to every day for my work; if I don't set tramp-default-method-alist and don't specify ssh explicitly in the string passed to find-file, TRAMP defaults to scp which is much slower than SSH on these servers for some reason.)


texts:
The Emacs diary is configured in ~/diary as the default.

I want separate the configuration and my personal notes.

How could redirect the system's diary to other directory?


texts:
I would like my all my wanderlust *Summary* buffers to be sorted by "number" in "reverse" order.

I know how to manually request a sort, but I want this specified sort order to always be the default in all cases, without my having to run any commands.

I have tried doing (setq wl-summary-default-sort-spec 'number), but it doesn't seem to alter the *Summary* buffer sort order.

I haven't found anything in the wanderlust docs about specifying this default *Summary* sort order.

Can anyone point me to docs or examples of how to make this happen?

Thank you.


texts: org-habit graph on todo list agenda view

texts:
I'm using org-habit, and the habit graphs show up nicely on the normal agenda view.  However, I'd like to use the todo list with tag filtering, and there the habits look like normal todo items, without the habit graph.

How can I make the habit graph appear when using the todo list agenda view?


texts: evil-org defun to `O` or insert heading causing Wrong type argument

texts:
I'm trying to write a command that behaves like evil's O unless I'm on a line that is an org-mode heading, in which case I want the command to insert a new heading and enter insert mode with the cursor positioned on the same line as that new heading (after the leading * characters and space).

Previously I used evil-org-eol-call, but it seems that's been deprecated in favour of evil-org-define-eol-command, so I'm trying to use that:

(defun my/org-open-above ()
    (interactive)
    (evil-open-above 1)
    (org-insert-heading))

(defun my/either-O-or-org-open-above ()
    (interactive)
    (if (not (org-at-heading-p))
        (call-interactively #'evil-open-above)
        (apply (evil-org-define-eol-command #'my/org-open-above))))

When I evaluate the second defun above, I get:

Wrong type argument: symbolp, (function my/org-open-above)

and yet, evaluating in *scratch* I get:

(symbolp #'my/org-open-above)
t

What am I doing wrong?  Here's the definition of evil-org-define-eol-command:

(defmacro evil-org-define-eol-command (cmd)
"Return a function that executes CMD at eol and then enters insert state.
eol stands for end of line.
For many org functions such as `org-insert-heading', this creates a heading below the current line."
(let ((newcmd (intern (concat "evil-org-" (symbol-name cmd) "-below"))))
    `(progn
    (defun ,newcmd ()
        ,(concat "Call `" (symbol-name cmd) "' at end of line and go to insert mode.")
        (interactive)
        (end-of-visible-line)
        (call-interactively #',cmd)
        (evil-insert nil))
    #',newcmd)))


texts: How do I create a new directory from within ranger?

texts:
I have recently moved from dired to ranger.
While using it on a regular work day, I noticed there isn't any command for creating a new directory.

Is there a workaround or am I missing something?


texts: Make text Invisible with font-lock-keywords

texts:
I'm interested in changing my org-mode buffers to have a better looking logbook. My ideal state to end up in is that text that looks like this:

- State "WAITING"    from "WAITING"    [2018-11-16 Fri 16:00] \\
  description of why this task is still waiting
- State "WAITING"    from "WAITING"    [2018-11-16 Fri 11:20]
- State "WAITING"    from "NEXT"       [2018-11-15 Thu 11:55] \\
  Addressed feedback Bump on 2018-11-19 if not approved yet.

instead is formatted to look like this

- WAITING [2018-11-16 Fri 16:00] \\
  description of why this task is still waiting
- WAITING [2018-11-16 Fri 11:20]
- WAITING [2018-11-15 Thu 11:55] \\
  Addressed feedback Bump on 2018-11-19 if not approved yet.

I've gotten pretty close to  what I want with this code:

(defface mjh-subdued `((t :background ,mjh-base03 :foreground ,mjh-base02))
    "Subdued face for text that shouldn't be very visible.")
(font-lock-add-keywords
   'org-mode
   '(
     ("\\(State +\"\\)\\(TODO\\)\\(\" +from.*\\)$"     (1 'mjh-subdued) (2 'mjh-subdued)  (3 'mjh-subdued))
     ("\\(State +\"\\)\\(NEXT\\)\\(\" +from.*\\)$"     (1 'mjh-subdued) (2 'mjh-subdued)  (3 'mjh-subdued))
     ("\\(State +\"\\)\\(WAITING\\)\\(\" +from.*\\)$"  (1 'mjh-subdued) (2 'mjh-waiting)  (3 'mjh-subdued))
     ("\\(State +\"\\)\\(DONE\\)\\(\" +from.*\\)$"     (1 'mjh-subdued) (2 'mjh-subdued)  (3 'mjh-subdued))
     ("\\(State +\"\\)\\(CANCELED\\)\\(\" +from.*\\)$" (1 'mjh-subdued) (2 'mjh-canceled) (3 'mjh-subdued))
 ))

With this, the text isn't invisible, but it is subdued so it doesn't draw much attention. Ideally, I want the text that is currently formatted as mjh-subdued to be invisible (and zero-width).

But I'm stuck. I can't figure out how to add the 'invisible text property to the matched groups. According to search based fontification, I should be able to add text properties for the (matcher . facespec) form, but I can't figure out how I need to get it worked. Changing one of the (1 'mjh-subdued) to (1 (face 'mjh-subdued :invisible t)) does not work. (and breaks what I do have working)

Any ideas on where I should look for this? I tried looking through the source for font-lock-add-keywords, but it's pretty dense.

I can add the code for the other faces if it matters, but they just change the TODO keywords to be colored differently.


texts: Enable `cc-mode` documentation highlightning per minor mode

texts:
I am writing a minor mode for enabling support for JML within Java files.
I realized the syntax highlighting with cc-mode's support for documentation comments.

It works if I set c-doc-comment-style to (jml javadoc) in a file-local variable. Enabling JML doc comments interactively (similar SO question) with

(add-to-list 'c-doc-comment-style '(java-mode . jml))
(c-setup-doc-comment-style)

does not work. (The call of c-setup-doc-comment-style is explicit mention in the documentation.)

Has anyone experience with interactive en- and disabling doc comment highlighting in cc-mode and can give me a hint on my mistake?
Or should I file a bug report?

Via the great font-lock-studio, I found out that the font-lock-keywords
are not updated by c-setup-doc-comment-style.
In particular the entry:

(lambda
  (limit)
  (c-font-lock-doc-comments jml-start-multiline limit jml--font-lock-doc-comments))
  (0 nil)

is missing.

Tested with built-in cc-mode from GNU Emacs 26.1.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2018-05-29.


texts: Show a warning when there are duplicate headings in org-mode

texts:
Sometimes I have quite long org-mode documents. I tend to insert new headings and sub-headings throughout the whole document. However sometimes I think that I already used this text and begin searching in the document. The easier way would be to just insert the heading and have org-mode show some warning when this exact text exists somewhere in the document as heading. Currently I think best would be if the color of the heading changes.
Is this possible and if yes, how can this be done?


texts:
How could I disable all python shell interaction in emacs on python-mode?

Such as:

C-c C-z       open a python shell
C-c C-c       run the content of the buffer in the opened python shell
C-c C-r       run the selected region in the python shell
C-c C-c       python-shell-send-buffer
C-c C-p       run-python

python-shell-send-buffer locks the emacs and I am unable to use it, hence I want to disalbe it.

I have set those keybindings to nil but still they are working.

(global-set-key (kbd "C-c C-p") 'nil)
(global-set-key (kbd "C-c C-c") 'nil)


texts: Can I (or should I) toggle off the left side of bookmark-list display (Bookmark+)?

texts:
I started using Bookmark+. Haven't customized it at all,
it seems its using the left half of the screen to show what seems like "duplicate" information.

As I using this tool right?


texts: How to deal with user arguments with magit transients?

texts:
I understand the infix flags work. However, I'm not sure how best to work with argument inputs. I have read the docs as well as looked at some examples from the magit source code but it's still a little bit beyond me as I need some really basic examples to get me started:
Given these two functions:
(defun say-hi:fn (&optional args)
  (message "%s" (<read-args> args)))

(define-transient-command say-hi ()
  "Say Hi"
  ["Arguments"
   ("-g" "Greeting" "--greeting")
   ("-n" "Name" "--name")]
  ["Actions"
   ("H" "Hi" say-hi:fn)])

How do I customise the default Greeting to be "Hello" and the default Name to be "World"?

How do I define  to sample <greeting> and <name> from args?

How do I limit the selection of <greeting> to be one of Hello, Hi and G'day?

How do I hook up <name> to be read from another input source such as counsel or a form widget?


texts: Org-mode font size changes with formatting

texts:
In Windows I've set my default font height to 120 with:

(set-face-attribute 'default nil :height 120)

This seems to not take effect in org-mode, however, when specially formatting is applied. For example, when I use // or ** to italicize or bold, the font size shrinks when the formatting is applied. What setting am I missing to have org-mode use the correct formatting with its specially formatted text. The rest of the text looks right. It's just the formatted stuff that is shrunk.

Example below. Note that after the "have," the text no longer aligns because the italicized have has shrunk:


texts: Trouble understanding load/load-path relationship

texts:
I'm working on a small function to recursively load my Emacs customizations.  In writing it, I noticed the argument of load, MUST-SUFFIX, requires the FILE argument to not include a directory name to capitalize on the suffix "autodetection" behavior (I only want it to load based on load-suffixes).

I thought I'd try temporarily setting load-path, since the description of load also mentions:

This function searches the directories in `load-path'.

When I tried setting load-path in a let to the current directory, it wouldn't load any of the files.  However, when I temporarily appended it to the beginning of load-path, it seemed to work.

I'm wondering what the difference is.  Since I am making use of functions from dash.el and cl-lib, do these need to be in load-path?

Here is what I wrote (sorry it's a bit jumbled, I threw it together rather quickly, since my current solution for the same task much slower):

(defun my-load-recursive (directory)
  (let ((load-path (cons directory load-path))
        (dir-contents
         (->> (directory-files directory nil nil 'nosort)
              (-remove
               (lambda (element)
                 (or (string-equal element ".")
                     (string-equal element ".."))))
              (-separate
               (lambda (file)
                 (file-regular-p
                  (expand-file-name file directory)))))))
    (destructuring-bind (files dirs) dir-contents
      (nconc
       (delq
        nil
        (mapcar
         (lambda (file)
           (when (load file 'noerror 'nomessage nil 'mustsuffix)
             (expand-file-name file directory)))
         (delete-dups (mapcar 'file-name-base files))))
       (car
        (mapcar
        #'my-load-recursive
        (mapcar
         (lambda (dir)
           (expand-file-name dir directory))
         dirs)))))))


texts: How to check if org entry is in an ordered list

texts:
Is there an existing function that indicates if an org entry is contained in an ordered list?

I am writing a hook that changes the next item in a list from TODO to NEXT.  I only want the entry to change when it is in an ordered list.  In the snippet below, changing Task A of A to DONE will trigger Task B of A to change its todo tag to NEXT.  However, changing Task A of B will not trigger Task B of B to change its todo tag.

* TODO Project A
  :PROPERTIES:
  :ORDERED: t
  :END:
  ** NEXT Task A of A
  ** TODO Task B of A
* TODO Project B
  ** NEXT Task A of B
  ** TODO Task B of B

Is there a function that will tell me that Task B of A is in an ordered list when point is on Task B of A?


texts: Fill-column conflicts with YASnippet [Examples in gif]

texts:
I use fill-column in my dot-Emacs. And I have the following setting:

(turn-on-auto-fill)
(set-fill-column 60)

The result looks like this:

Every time when the input exceeds columnnumber 60, it will break and proceed further on the new line.
Next to this, I use an YASnippet snippet, which will set up a proper structure for documentation of functions. The snippet is constructed as following:

#name : example of snippet foo bar
# --

#  EXAMPLE FOO BAR
/* $1
*
*/
public function f$2($3) {

} # End scope f$2

However, with the fill-column setting enabled, I ran into weird problems:

When typing in the docstring, the sentence get stucked at the end. I've expected it to proceed on a new line (with a new comment tag before), when the current line gets too long. But this is not the case.

Furthermore, the weird thingy is that this problem is not anymore when I delete the mirror on the last line in the snippet:

#name : example of snippet foo bar
# --

#  EXAMPLE FOO BAR
/* $1
*
*/
public function f$2($3) {

}

Then I get this instead:

But why? Can anyone explain why the last line is causing an error with fill-column? I don't see any relationship between these two things.

And how can I get the latest line mirrored, without the docstring stucked on first line?


texts: Specify repeater when setting deadline for org-mode TODO

texts:
With point on a TODO item in an .org file, I can use org-deadline (C-c C-d) to insert a deadline for the TODO. Is there any way to do this, and specify a repeater (e.g., +1w) at the same time?

Currently, I add a deadline using the method described above, then navigate to the end of the timestamp and manually add the repeater to the stamp. It doesn't seem like it will be possible from the org-deadline UI, because in that context +1w represents a delta ("a week from...") rather than a repeating interval. I have also looked through the documentation, and tried searching Emacs for commands of the form org*repeat*, but haven't come up with anything yet. However, it seems like a fairly common task, so I assumed there would be a related command.


texts: define-advice vs advice-add vs other (?)

texts:
Can someone explain and show the right/preferred way of advising functions in Emacs these days.

Official documentation says to use advice-add, but I've seen people using define-advice and I checked, they are both part of nadvice.el (which is as I understood ships with Emacs).

I'm not sure, but If I remember it right I think there were more ways to advice (some of them are now considered obsolete).

Also it's known that using lambdas to add hooks is kinda frowned upon. Is that the same for advising? Then why something like this is okay (or is it?):

(define-advice mu4e~stop (:after nil kill-mu4e-layout-after-mu4e~stop)
        (when mu4e-spacemacs-kill-layout-on-exit
          (persp-kill mu4e-spacemacs-layout-name)))

It seems define-advice is a macro that uses advice-add behind the scenes, but I don't see how it makes it easier to advise functions, what am I missing?

This all is very confusing.


texts:
Apparently hl-line+.el solves certain performance problems of hl-line-mode.

It is created in 2006, and last updated in 2018.

Despite that, it was never packaged to be available at e.g. melpa, which would be a bit more convenient than copy-pasting updates from wiki into a local setup.

Is there any reason, e.g. license terms, that prevents someone from creating and maintaining such a package? For instance, I can neither understand the license under which the specific file is made available, nor can I understand under which license files at https://github.com/emacsmirror/emacswiki.org/ are published.

While at it: is there a much better alternative to hl-line+ that makes it obsolete and not worth maintaining?


texts: Adding extra "\source{something}" command inside table and figure latex environments exported from org-mode

texts:
I'm writing a large document in org that I export to PDF through latex. The latex class that I'm using (set in org-latex-classes) defines a \source command that can be used inside table and figure environments to indicate the source of that material. Something like the code below in latex
\begin{figure}[htbp]
\centering
\includegraphics[width=\textwidth]{figure.pdf}
\caption{\label{thelabel}The caption.}}
\source{Modified from~\cite{bibkey}.}
\end{figure}

In org-mode we can include the figure as (without the \source command)
#+NAME: thelabel
#+ATTR_LATEX: :width \textwidth
#+CAPTION: \caption{The caption.}
[[figure.pdf]]

My question is: How can I tell org-mode to add \source{whatever} inside the exported figure environment? Is there something I can pass to #+ATTR_LATEX: ??? to add what I need inside the environment?
Note: Unfortunately the \source command cannot be put inside the caption.

Edit: After more research I found this question on stackoverflow which is the same question as this one. Essentially, it comes down to either  NickD's answer, or creating a filter, but with the filter solution there does not allow specifying what comes inside the \source command and this using :caption seems like the only way to go.


texts:
How can I do the following in emacs:

Suppose the cursor is at position A in my text. Then

open a calendar
chooses the date by clicking with the mouse or navigating with the keyboard
insert the choosen date at A

The solution should work in all modes and the date format should be configurable.


texts: How to make internal links in org-mode case insensitive

texts: If I have a heading called "heading1", I can link to it within the same org file with [[heading1]], but cannot link to it with [[Heading1]]. Is there a way to make links case insensitive?


texts:
I am using the Tomorrow-Eighties color theme from the color-theme-sanityinc-tomorrow package. Unfortunately when using Helm, not all of the correct colors seem to be applied. I've had an interaction with the developer of the theme, and he's not seeing the same thing I'm seeing, so I'm worried it's something unique to my setup.

The screenshot below shows what my helm-find-files buffer looks like. As you can see, the background color for directories gets messed up, and the current line highlight is also ugly, and not typical for this theme. What do I need to change to get helm to use the theme defaults for background colors and the current selection?


texts: How can I change which shell script mode I'm in?

texts: Occasionally, emacs opens a file in shell-script[fish] when I want it to open in shell-script[bash]. How can I manually change the subtype of shell-script mode that I'm in?


texts: Reflection on function argument signatures

texts:
Is there anything built into elisp for reflection on function argument signatures?

I have used (length (cadr (symbol-function #'my/function))), but this notably fails on built-in C functions.

I'm sure there are probably limitations because of function representation and there being argument keywords and destructuring in different contexts, but the goal here is strictly exploratory.

Possibilities:

signature length (arity)
has optional args
min signature length
...


texts:
I have been trying to add a custom keyboard command that will find a functions definition using S-mouse1.

The issue is that I need two mouse clicks for this to work.  The first click is to move cursor to the function who's definition I want to find. The second click is the S-mouse-1 to trigger the function to find it's definition.

Here is what I have added to my .emacs:

(global-set-key (kbd "<S-mouse-1>")
            (lambda ()
              (interactive)
              (xref-find-definitions (thing-at-point 'word))))

An ideal solution would update point based on my mouse position and then use thing-at-point to pass the symbol into xref-find-definitions

I tried adding the following solution to my config without success: https://emacs.stackexchange.com/a/30856/21056


texts:
Say that emacs throws some error that I don't understand. Or maybe the error says "Symbol's value as variable is void: modes", but there are many occurrences of the symbol modes in my code, so I need some context. Can Emacs be configured to mention the line number of the lisp code so I can know what code is causing the error?

I have tried doing (setq stack-trace-on-error '(buffer-read-only)) and ran the perpetrating code in an effort to get a stack trace. No stack trace either.

I have also tried calling edebug-defun on my function and stepping through it. It is not until I step out of the function that the error is thrown.

(I am really not as interested in the cause of the particular error I am facing currently as I am in developing general debugging skills for elisp. Please advise on how I can gleam a line number, or a sexp, or a stack trace from an error.)


texts: Find out the purpose of a Prefix Command listed in describe-bindings

texts:
Is there any easy way to determine the purpose of a prefix key shown in
the output of (describe-key Chk?

I walked through my (kbd "C-x <key>") and (kbd "C-x C-<key>") combinations
to find out what they are all bound to.

The method worked fine, except for prefix keys. Then, the Chk output in the minibuffer
just showed the prefix keys typed so far, without saying something like "Prefix key for
xxx mode", or "Prefix key for register actions (C-x r)."

I looked at the output of describe-prefix-bindings too, but for prefix keys, it just
said things like this, without saying anything about the source or purpose of the prefix.

C-x RET         Prefix Command
C-x ESC         Prefix Command
C-x 8           Prefix Command
C-x r           Prefix Command
C-x n           Prefix Command
C-x             Prefix Command
C-h 4           Prefix Command

How can I find out the purpose of a Prefix Command listed in the output of describe-bindings?


texts: M-x package-autoremove is blocked by system packages

texts:
Emacs doesn't want to autoremove packages from elpa because some of them are system packages.

How can I launch autoremove ignoring system packages?

  Error enabling Flyspell mode: (stringp nil)106 packages will be
  deleted: notmuch, ws-butler, winum, which-key, volatile-highlights,
  vi-tilde-fringe, uuidgen, use-package, undo-tree, toc-org, spinner,
  spaceline, smartparens, s, restart-emacs, request, rainbow-delimiters,
  projectile, powerline, popwin, popup, persp-mode, pcre2el,
  parent-mode, paradox, packed, org-bullets, open-junk-file, neotree,
  move-text, macrostep, lorem-ipsum, linum-relative, link-hint, info+,
  indent-guide, iedit, hydra, hungry-delete, hl-todo,
  highlight-parentheses, highlight-numbers, highlight-indentation,
  highlight, hide-comnt, help-fns+, helm-themes, helm-swoop,
  helm-projectile, helm-mode-manager, helm-make, helm-flx,
  helm-descbinds, helm-core, helm-ag, helm, goto-chg, google-translate,
  golden-ratio, flx-ido, flx, fill-column-indicator, fancy-battery, f,
  eyebrowse, expand-region, exec-path-from-shell, evil-visualstar,
  evil-visual-mark-mode, evil-unimpaired, evil-tutor, evil-surround,
  evil-search-highlight-persist, evil-numbers, evil-nerd-commenter,
  evil-mc, evil-matchit, evil-lisp-state, evil-indent-plus,
  evil-iedit-state, evil-exchange, evil-escape, evil-ediff, evil-args,
  evil-anzu, evil, eval-sexp-fu, elisp-slime-nav, dumb-jump, diminish,
  define-word, column-enforce-mode, clean-aindent-mode, bind-map,
  bind-key, avy, auto-highlight-symbol, auto-compile, auctex, async,
  anzu, aggressive-indent, adaptive-wrap, ace-window, ace-link,
  ace-jump-helm-line, proceed? (y or n) y

  package-delete: Package
  ‘notmuch-0.26.2’ is a system package, not deleting


texts: How to get buffer position given line number and column number?

texts:
I'm trying to swap the contents of a region with the text of the same width region below it. I think I should be able to atleast correctly capture the region on the next line using the code below, assuming I can get the positions for them. Any suggestions on how I should implement pos-at-line-col or is there already a function to do this?

(defun region-selected ()
  "Return a list of the currently selected region if active."
  (if (use-region-p)
      (list (region-beginning) (region-end))
    (list nil nil)))

(defun column-number-at-pos (pos)
  "Analog to line-number-at-pos."
  (save-excursion (goto-char pos) (current-column)))

(defun tabular-swap-region-down (beg end)
  "Swap the highlighted text with the same region on the next row."
  (interactive (region-selected))
  (let* ((selection (buffer-substring-no-properties beg end))
         (line      (line-number-at-pos beg))
         (bcol      (column-number-at-pos beg))
         (ecol      (column-number-at-pos end))
         (next-line (1+ line))
         (next-beg  (pos-at-line-col next-line bcol))
         (next-end  (pos-at-line-col next-line ecol))
         (next-sel  (buffer-substring-no-properties next-beg next-end)))
    (message "Region: %s Beginning column: %s Ending column: %s"
             next-sel (int-to-string bcol) (int-to-string ecol))))


texts: Emacs server exit when losing connection to Xserver

texts:
I run Emacs on development host under X Window as:

$ emacs24

with ~/.emacs:

(require 'server)
(server-start)

Next when I connect to Emacs as:

$ ssh -Y localhost
ssh$ emacsclient -c
C-x C-c
ssh$ exit

or as:

$ startx xterm -- `command -v Xnest` :1 -geometry 800x600
xnest$ emacsclient -c
C-x C-c
xnest$ exit

main Emacs exit.

I like ability to join to my Emacs session from remote host for getting working context immediately. But when I come to original host or try to re-establish X connection - I have to start new Emacs.

How to make Emacs live when I close remote X connection?

UPDATE I don't try --daemonas think that (server-start) are equivalent form.


texts: Adding a Spacemacs layer for "classic" emacs mode

texts:
I' trying to wrap https://github.com/hading/chordpro-mode in a layer for Spacemacs. I ran M-x configuration-layer/create-layer and from there followed the documentation: https://www.spacemacs.org/doc/LAYERS.html.
Now I have a file ~/.emacs.d/private/chordpro-mode/packages.el, containing this (without the doc-comments):
(defconst chordpro-mode-packages
  '(
    chordpro
    (chordpro :location (recipe
                             :fetcher github
                             :repo "https://github.com/hading/chordpro-mode"))
    )

(use-package chordpro
            :defer t
            :init
            :mode "\\.pro$"
            )

I also added chordpro-mode to dotspacemacs-configuration-layers in .spacemacs.
Now, starting Emacs it gives me the bad stare: Symbol's function definition is void: use-package. The error goes away if I remove the latter entry, but still Spacemacs does not load the mode when I open a *.pro file and instead gives me File mode specification error: (file-missing Cannot open load file chordpro-mode)
I don't know what I did wrong. Can someone please point me to where I'm off?