texts: Function to add a number at the end of a line to another number on the top line

texts:
I'm trying to implement a gamification system in org-mode.

Basically, I assign a number of points to a checkboxed task and when I tick the checkbox I add the number of points to a total at the top of my file.

I'm trying to write a function that does this automatically, like for example turning this:

Total points: 45

- Things to do today
  - [ ] Wa|sh clothes: 5

into this:

Total points: 50

- Things to do today
  - [X] Wa|sh clothes: 5

when the cursor is at the vertical bar.

How would I write a function that extracts the number from the end of the line and stores it in a variable, extracts the top number and stores it in a variable, adds the variables together and replaces the top number with the new total?


texts: Org-ref not communicating with Tex-live?

texts:
Org-ref cannot tell that I have biblatex-caspervector installed.

Is this because of some packages that I missed?


texts: How do I keep all emacs dotfiles in one directory?

texts:
I would like to keep all emacs related stuff (backup files, emacs-places, ido-last, etc.) in one place, namely ~/.emacs.d directory.

Is there general option for this or I have to set it individually for each package?


texts: Navigate cursor position history with line-based jumps

texts:
I use point-undo to jump between positions in the cursor history. However, point-undo uses every previous position of the cursor, and I often experience that what I actually want is to jump just to the last/next line where my cursor was. So I don't want to jump around within one line. In other words, I would like the cursor history to store only the last position per line.

How to do this?


texts: On Linux/Mac, how to start single instance?

texts:
I just want single instance. I just use a simple .emacs for config, which has

(use-package server
  :ensure t
  :init
  (server-mode 1)
  :config
  (unless (server-running-p)
    (server-start)))

It works on MS windows. But on Linux (Ubuntu 18 LTS)/Mac OS, then 2nd instance started with warning:

*Warning (server): Unable to start the Emacs server.
There is an existing Emacs server, named "server".
To start the server in this Emacs process, stop the existing
server or call ‘M-x server-force-delete’ to forcibly disconnect it.*

May you please give me some suggestion?

Emacs version: 26.2


texts:
I'm getting mixed results with xref-js2 and want to confirm if what I'm seeing is expected or not. I'm using Emacs 27, and I have the following config:
(require 'ripgrep)
(require 'js2-mode)
(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))
(require 'xref-js2)
(setq xref-js2-search-program 'rg)
(add-hook 'js2-mode-hook (lambda ()
  (define-key js2-mode-map (kbd "M-.") nil)
  (add-hook 'xref-backend-functions #'xref-js2-xref-backend nil t)))

When I call xref-find-definitions M+., sometimes it will jump right to the correct definition, but sometimes it doesn't. For example, when trying to locate the definition for a function selectStepGroups, I get this result:
/src/components/Steps/Steps.js
139: groups: selectStepGroups(state),
/src/entities/selected/on-remove.js
68: const stepGroups = selectStepGroups(allState);
/src/entities/step-groups/reducer.js
20: export const selectStepGroups = state => state[TYPE];
/src/entities/step-groups/step-groups.test.js
12: expect(selectStepGroups(transformed)).toBe(transformed.stepGroups);

From this result, I think it means that the xref backend is found, and it's using ripgrep. However it doesn't seem like it's filtering results based on the JS2 AST, as only the third result is a valid definition (the rest are just string matches.)
Is this the expected behavior? If not, have I misconfigured something?


texts: "void-variable" error when adding advice to `kill-ring-save`

texts:
I am trying to add an advice to kill-ring-save and kill-region, so that when I call them with no active regions, instead of throwing an error, the line the point is currently on would be marked automatically. I am requireing the package simple.el because this is where kill-ring-save and kill-region are defined.

(require 'simple)

(defun mark-line-if-no-active-region ()
  "When the adviced function is called in an interactive context
with no active region, mark the current line as the active region."
  (interactive
   (if mark-active (list (region-beginning) (region-end))
     (list (line-beginning-position)
           (line-beginning-position 2)))))

(add-function :before kill-ring-save (lambda () (mark-line-if-no-active-region)))
(add-function :before kill-region (lambda () (mark-line-if-no-active-region)))

However, it appears that emacs doesn't recognize kill-ring-save. When launching with --debug-init, Emacs produces the following error.

Debugger entered--Lisp error: (void-variable kill-ring-save)
  default-value(kill-ring-save)
  (lambda nil (default-value 'kill-ring-save))()
  advice--add-function(:before ((lambda nil (default-value 'kill-ring-save)) lambda (gv--val) (set-default 'kill-ring-save gv--val)) (lambda n$
  eval-buffer(#<buffer  *load*-570600> nil "/Users/nalzok/.emacs.d/custom/setup-editing.el" nil t)  ; Reading at buffer position 2025
  load-with-code-conversion("/Users/nalzok/.emacs.d/custom/setup-editing.el" "/Users/nalzok/.emacs.d/custom/setup-editing.el" nil t)
  require(setup-editing)
  eval-buffer(#<buffer  *load*> nil "/Users/nalzok/.emacs.d/init.el" nil t)  ; Reading at buffer position 443
  load-with-code-conversion("/Users/nalzok/.emacs.d/init.el" "/Users/nalzok/.emacs.d/init.el" t t)
  load("/Users/nalzok/.emacs.d/init" t t)
  #f(compiled-function () #<bytecode 0x4009f5e9>)()
  command-line()
  normal-top-level()

I have tried replacing kill-ring-save, 'kill-ring-save, and #'kill-ring-save, but the same error persists. I'm using Emacs 26.1 installed from Homebrew on macOS.

By the way, I would appreciate it if you can explain what does the hashtag (#) preceding a quote (') does.


texts: Problems with font in the Startup Screen

texts:
When I start Emacs 24.4.1 (with -Q parameter), my welcome screen looks quite strange:

This text is in plain English, right? What is so special about it that causes this peculiar rendering? For all other buffers everything is fine... There are 'buttons', but buttons in other windows work OK. Perhaps it has something to do with the logo?

I would like to know

The cause of the problem;
How to fix it.


texts: Get a timeline of clocked time in org-mode

texts:
In an attempt to figure out how I've been spending my time, I've started logging my time spent on different tasks with org-clock-in and org-clock-out.

I often find myself editing clock entries by hand, for instance, when I realize that I should have clocked in 20 minutes ago. So is there a way to see a) which clocks are currently running (or haven't been terminated properly because I forgot to clock out before exiting Emacs), and b) a list of clock entries?

I can get a table that shows the total amount of time I've spent on each task, but I can't get a list that says,

9:00--9:30   Project A
9:18--10:00  Project B
10:00--11:00 Meeting
11:45--13:00 Lunch

which would let me see overlapping times (like Projects A and B, above) and gaps (like the one between Meeting and Lunch). Is there such a thing?


texts: why can't edit in buffer after save in file?

texts:
In file I disable Read-only mode (by C-x C-q):

But if I want to edit buffer I get message:

Text is read- only


texts: Which faces do Ivy/Counsel use in the minibuffer?

texts:
Which faces are being applied to the indicated text, i.e. the strings 3114, M-x, and C-x C-c, in the following screenshot?

I am using the packages Ivy and Counsel, in case that is relevant.


texts: What are some resources for learning to write a major mode for a programming language such as Haskell? I know such things exist but I would like to learn how to do it, it seems like a fun and interesting project.


texts: What's the meaning of rebase in magit status buffer?

texts:
In magit status buffer, it said:

Head:     feature/event
Rebase:   origin/feature/event123
Tag:      8000.102 (9)

But if run git status, I don't see such Rebase information if simply run the following in command line

git status

What's the meaning of Rebase here?


texts:
For some reason I cannot explain, org-copy (C-c M-w) does not work from Org Agenda (mini-buffer saying C-c M-w is undefined).

org-refile (C-c C-w) does work from the agenda and org-copy as well from any other org file.

How to make org-copy work from the Agenda? Should I be using org-agenda-write (C-x C-w) to export a unique header?


texts: Org: including clock-out timestamp in clock table report

texts: I'd like to have a clock table report include the date in which each task was completed. Is it possible to have a column for the last clock-out date? Using :timestamp t only works for the scheduled or deadline timestamp...


texts: Every mode in Emacs has its own rules for indentation. I don't want that. How can I disable it and have custom indentation rules for every mode?


texts: Graphical Glitch/Screen Tearing in Emacs

texts: I'm currently having difficulty with a graphical glitch in Emacs 24.4.1. Occasionally all the text in my current frame will tear, and I'll have to force Windows to redraw everything by covering up the Emacs frame with another window. This doesn't seem to happen with any consistency, and only occurs with Emacs. I'm not entirely sure how to reliably reproduce the error, rather it just happens randomly whenever I'm working in it. Any help would be greatly appreciated, and an example picture is attached below.


texts: Unable to locate preview-latex.el after installing the AucTeX package in Emacs24

texts:
I've installed AucTex as per the official instructions with package-list-packages, however there is no trace of preview-latex. Helm displays no results for M-x auctex.

After installing Auctex with package-list-packages, (load "auctex.el" nil t t) returns true, but (load "preview-latex.el" nil t t) does not.

I've reinstalled Auctex from scratch (by having a backup of my .emacs.d), and arrived the same results.

How can I produce preview-latex.el? And why am I not seeing any traces of Auctex?


texts:
I have rebound C-u to another function, and try to use C-j for the prefix, but now it seems I cannot use the prefix in org-mode. It does seem to work in other modes though.
; This is the relevant part of my current config (I think)
(global-set-key "\C-j" 'universal-argument)
(define-key universal-argument-map "\C-j" 'universal-argument-more)
(define-key universal-argument-map "\C-u" nil)
(define-key global-map "\C-u" nil)

(use-package org
  :bind
  (:map org-mode-map
        ("C-e" . next-line))
  )

How can I make C-j the prefix in org-mode?


texts: Export Org-mode Headers Level 4 or Above as Headers in Texinfo

texts: I am writing software documentation using Org-mode, but I also want to export the result as a Texinfo file.  The process works well, however, Texinfo transforms level 4 headings into numbered lists instead of subsubsections, etc.  The documentation indicates to use #+OPTIONS: num:6 exporting as subsubheadings, etc. instead of numbered lists for any header of level 6 or lower.  Has anybody run into this issue and know how to deal with it?  It is not a huge problem, but my INFO files would be easier to navigator with the proper layout.


texts: add an indicator or annotation on filed which current input is expandable in yasnippet

texts:
I have a snippet called struct.
And I write text complex_struct in a snippet field. yasnippet will expand
complex_struct with the snippet struct. I have to move backward one
character to avoid this behavior.

So I hope there is an indicator like make cursor change color to red, and style.
Or change text face etc.

Here is the snippet code:

# -*- mode: snippet -*-
# name: struct
# key: struct
# --
struct ${1:name} {
  $0
};

# -*- mode: snippet -*-
# name: complex_struct
# key: complex_struct
# --
complex struct ${1:name} {
  $0
};

When I type text like the following:

complex_struct|

The point is at position (|).
It will be expanded from snippet struct instead of complex_struct. I don't
want to change yasnippet expand detect characters list. Just want to show which
text is expandable (Like struct in this case).

I have a demo code to change cursor style dynamically:

;; change cursor dynamically when prefix text is expandable.
(defun my-cursor-change-on-snippet ()
  ;; (yas-next-field-or-maybe-expand)
  (if (or yas-triggers-in-field ; FIXME: improve condition
          (yas-next-field-will-exit-p))
      (progn
        (set-cursor-color "red")
        (setq cursor-type 'hollow))
    (set-cursor-color "cyan")
    (setq cursor-type '(hbar . 2))
    )
  )

(add-hook 'post-command-hook #'my-cursor-change-on-snippet)


texts: How do I change the working directory used by pdb/gud?

texts:
When running M-x pdb from Emacs, the current directory seems to be set to that of the directory of the script you are running, so

pdb ~/path/to/project/__main__.py

Would set the working directory to ~/path/to/project/. However, what if I need the working directory to be a different directory - say, one directory back? Is there a way to set the directory that pdb/gud uses as the "working directory"? At the first pdb prompt I can change the directory with os.chdir(), which works, but I would like to not have to do this every time. Thank you!

Update:

I have found that one potential solution would be to set gud-chdir-before-run (mentioned by @Nsukami_ below) to nil and then change to the desired directory with (cd "/path/to/directory")  before running pdb. I tried doing this with the gud-mode-hook but the directory is changed too late. I have also, tried to do this with by advising pdb and gud-mode-hook, but don't yet have the lisp skills for this apparently...Is there a good way to call cd before gud-mode-hook/ before the dubugger starts?


texts: I use a terminal from within Emacs via M-x RET ansi-term RET. The problem is that when I run a program which echoes a lot of output, ansi-term first scrolls with the output (such that the last line of the echoed output is always at the bottom of the terminal) but the scrolling often "breaks" such that ansi-term stops scrolling with the echoed output - i.e. I am looking at some line where scrolling "broke" and there is a lot of new output that I don't see unless I press C-n which puts me to the newest echoed line. But then the scrolling breaks again soon... Does anybody know how to fix this? I can provide any debug output you wish.


texts: How does emacs know to use `helm-find-files` in this context?

texts:
There is a stock emacs function called append-to-file that is defined as follows (in files.el):

(defun append-to-file (start end filename)
  "Append the contents of the region to the end of file FILENAME.
When called from a function, expects three arguments,
START, END and FILENAME.  START and END are buffer positions
saying what text to write."
  (interactive "r\nFAppend to file: ")
  (write-region start end filename t))

I'm running spacemacs, which runs helm. When this stock function is called via M x append-to-file, an interactive prompt comes up that seems to use helm-find-files to help the user find a file to input into this stock function.

Question: How does this emacs function -- which was presumably written years before helm ever was -- know to call helm-find-files when prompting the user for an input file in the minibuffer?

Motivation: The reason why I'm curious about this is that I'm ultimately wanting to call a different interactive file-finding function (one other than helm-find-files) with this function (for example I'd like it to invoke helm-projectile-find-file which is slightly different).

EDIT: Using bmag's answer, I have a partial solution that doesn't use helm-projectile-find-file but instead uses the shell find command to get a list of files I'm interested in.

In particular, I'm interested in the list of files brought up by the shell command find -L /path/to/files -wholename */capture.md). How can I put this result into :sources below and have the appropriate buffers come up?

(defun helm-append-to-file (start end)
  (interactive "r")
  (let ((filename
         (helm :sources ... ;; <--what do I put here?
               :buffer "*helm append to file*"
               :prompt "File to append to: ")))
    (append-to-file start end filename)))


texts: Position the cursor at a specific point in a custom Emacs grep command

texts:
I have created this custom grep command in Emacs to search for contacts:
 '(grep-command
   "grep --color -nH --null grep -ie '^name' -A 1 ~/diary/*.org")

I would like to be able to position my cursor automatically in the minibuffer at the start of ^name rather than at the end of the string. Is this possible?


texts: outline minor mode folding enhancements wanted

texts:
This query is two questions both related to latex major mode (not Auctex), outline minor mode, code folding.  I eventually solved these questions myself.  My "answers are given below the ========== line.

Question 1:
I am using the following initialization so that each latex file has its body hidden (i.e. folded) when it is first opened.  However, the lower level headings are still showing.  How do I prevent the lower level headings from showing?

(add-hook 'latex-mode-hook
    (lambda ()
        (outline-minor-mode 1)
        (setq outline-regexp "%{{{{\\|%{{{\\|%{{\\|%{")
        (outline-hide-body)))

Question 2:
I want the following keybinding to be effective if and only if latex-major-mode is active (assumes that outline minor mode will also be active):
a. C-M-mouse-1 should toggle outline-show-entry and outline-hide-entry, depending on whether entry is currently hidden.
b. C-M-mouse-3 should invoke (outline-hide-sublevels 2).

=======================================================

Answer to Question 1:
The outline-hide-sublevels function was malfunctioning.  Documentation indicated that I should code my own function and refer to it with the outline-level variable.  I changed the tail end of my lamda clause to :

(setq outline-level 'my-latex-outline-level)
; (outline-hide-body)
(outline-hide-sublevels 2)))

The (default) latex-outline-level function is:

(defun latex-outline-level ()
    (if (looking-at latex-outline-regexp)
        (1+ (or (cdr (assoc (match-string 1) latex-section-alist)) -1))
        1000))

I could not get the match-string function to work correctly.  So I chose the following kludgy but simple alternative (works for me, but not recommended for everyone):

(defvar my-latex-outline-regexp '"%{{{{\\|%{{{\\|%{{\\|%{")

(defun my-latex-outline-level ()
    "Personalized latex outline level.

Uses regexp that lists longest match strings first.  On match,
returns length of matched string.  On no match, returns 1000."
    (if (looking-at my-latex-outline-regexp)
        (- (match-end 0) (match-beginning 0))
        1000))
;;;

Answer to Question 2:
Actually, this solution is just routine research, so I should not have included the second question; I was just frustrated because of the first question.  Looking at https://www.emacswiki.org/emacs?action=browse;oldid=KeyBindingDiscussion;id=ChoosingKeysToBind I found:

(eval-after-load 'text-mode
        '(define-key text-mode-map (kbd "'") 'maybe-open-apostrophe))

Unfortunately, I wasn't able to alter the above to work okay in latex, so I used the local-set-key command instead.  My initialization was changed as follows:

;;; new function added

(defun my-toggle-outline-entry ()
    "Toggle outline folding entry, hidden or shown.

This code folding function uses the outline-invisible-p function to determine if
specific outline entry is hidden or shown.  Based on this determination, the
visibility of the entry is toggled."

    (interactive)
    ;;
    (if (equal (outline-invisible-p) nil)
        (outline-hide-entry)
    ;; else
        (outline-show-entry)))
;;;

;;; local key bindings added

(add-hook 'latex-mode-hook
    (lambda ()
        ...
    (local-set-key (kbd "<C-M-mouse-1>") 'my-toggle-outline-entry)
    (local-set-key (kbd "<C-M-mouse-3>")
            (lambda () (interactive) (outline-hide-sublevels 2)))
;;;

I think a warning should be added

After implementing these keyboard bindings, I twice lost all the data in an outline-minor-mode code folding entry.  I suspect that the culprit was the mouse-save-then-kill function, which is globally bound to mouse-3.  My resolution was to hijack mouse-3 within [major mode = latex, minor mode = outline] by changing the (outline-hide-sublevels 2) key binding away from C-M-mouse-3 to simply mouse-3.


texts: Searching for lines matching a criterion: where am i going wrong?

texts:
I am trying to record all the lines with the word bad in a Emacs-buffer
with a simple elisp function

(defun bad-line-numbers ()
  (beginning-of-buffer)
  (setq sec-lines ())
  (while (re-search-forward "bad" t nil nil)
    (cons (thing-at-point 'line) sec-lines ))
  (message sec-lines)
  )

I tried this function, by evaluating (bad-line-numbers) in a buffer but I get the error Wrong type argument: integer-or-marker-p, t after the point goes to the beginning of the buffer.
Where am i going wrong?


texts:
I seem to remember from several years ago, an alternative and better package and/or command to "Time-stamp: <...>".  I can't seem to find it now.

Does anyone know of this?

I want to use this in C code, not in the file header.


texts: yasnippet for org-mode templating : elisp list type problem

texts:
I want to use yasnippet to create a generic template for my org-mode files including latex export classe (letters, memos, articles, etc...)
It's not that complicated, but I would like Yasnippet to offer me to choose from the list of latex classes I have configured myself with (add-to-list 'org-latex-classes ...).
Therefore I introduced in my snippet the following line:
#+LATEX_CLASS: ${2:$$$(yas-choose-value '(org-latex-class))}
However, it seems that the variable is not recognized as a stringp :
yas--move-to-field: Wrong type argument: stringp, (sequencep org-latex-class)
Is there a way in elisp to convert sequencep to stringp ? Could it solve the problem ?


texts: How to open `shell` or `eshell` in a new window or frame

texts:
By M-x eshell or M-x shell Emacs opens a shell or an eshell in the current window.
How to open this shell or eshell in a new window?


texts: I'm a bit lost on what I can use the TeX input mode for. What I'd like to achieve is a mathematical notation like ∑ᵢ₌₁ᴺ ∑ⱼ₌₁ᴹ in pure UTF text and it seems to mostly work, i.e. \sum _ i _ = _ 1 works, but \sum_t gives ∑ₜ which I guess means that the symbol _t is not supported by the current (what exactly?). When I try M-x describe-input-method Ret TeX I also see that _t is not supported. So, is this a limitation with a particular font, UTF itself, my computer or moon phase? And is there a solution? I tried both on my computer, with Mac OS X and a remote server, both seem to miss similar subscript letters.


texts: How to remove files from recentf / ivy-virtual-buffers?

texts:
I find ivy's virtual buffers feature ((setq ivy-use-virtual-buffers t)) very handy for navigating to files whose buffers have been closed. Like ido's virtual buffers,it uses recentf to present those files as if their buffers were still open when switching buffers.

However, occasionally I want to remove clutter from ivy-switch-buffer by removing 'virtual buffers'. ido has C-k, which does what I want. I've found that ivy's kill action does not always work for this purpose.

How can I reliably remove virtual buffers from the ivy-switch-buffer list, preferably using ivy itself?


texts: Error adding LaTeX class to org-latex-classes

texts:
I am trying to register the jfm LaTeX class (Journal of Fluid Mechanics) with the Org LaTeX export backend.

After looking around, I have put the following elisp snippet into my .emacs

(with-eval-after-load 'ox-latex
   (add-to-list 'org-latex-classes
                '("jfm" "\\documentclass{jfm}"
                  ("\\section{%s}" . "\\section*{%s}")
                  ("\\subsection{%s}" . "\\subsection*{%s}")
                  ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
                  ("\\paragraph{%s}" . "\\paragraph*{%s}")
                  ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))) .

Basically, I've looked up how the article class entry looks like and just made the minimal necessary changes.

Exporting the minimal, empty article with only title defined works and pure text works. For example,

#+TITLE: On the Uptightness of Stackoverflow Mods
#+LATEX_CLASS: jfm
#+LATEX_HEADER: \usepackage{graphicx}
#+LATEX_HEADER: \usepackage{epstopdf, epsfig}
#+LATEX_HEADER: \usepackage{float}

Here is the text that does not produce any errors.

shall indeed compile without errors.

However, as soon as I add an Org heading somewhere in the above example,

say * Introduction, and try to export to LaTeX, I get the following error:

org-export-get-all-transcoders: Wrong type argument: org-export-backend, [cl-struct-org-export-backend nil latex ((underline lambda (o c i) (format "\underline{%s}" c))) nil nil nil nil] .

Org package summary on my emacs build:

Status: Installed in ‘org-20170821/’,shadowing a built-in package.
Version: 20170821 Summary: Outline-based notes management and
organizer Other versions: 9.1.14 (gnu), 9.1.9 (builtin)


texts: "ESC" no longer works as meta; how can I restore functionality?

texts:
I mistyped some command sequence and ESC stopped working as a meta prefix in Aquamacs (it still functions as usual in the command-line emacs, including both Apple's system version and the command-line version that comes with Aquamacs). Afterwards, hitting ESC generates the <escape> function key. Unfortunately, I didn't notice in time for view-lossage to tell me what I did. I restarted Aquamacs in the hope of restoring functionality, but the issue persisted.

I've hunted around in the startup files I know of that have been modified recently (~/.emacs, ~/.emacs.d/{.emacs.desktop,SessionDesktop.el}, ~/Library/Preferences/Aquamacs Emacs/{.emacs.desktop,customizations.el}), but all of the relevant settings I can find seem to be correct. ESC is still listed as a prefix command in the bindings for major mode; globally, its binding is listed as ESC-prefix. meta-prefix-char is listed as 27. When started without init files, ESC works as meta prefix.

key-translation-map doesn't appear to have an entry for ESC (I didn't see anything with emaps-describe-keymap, and (lookup-key key-translation-map [27]) returns nil).

What else might I examine to determine which setting to change? Is there any other steps I should take to restore ESC as the meta prefix?


texts: Why are some buffers not displayed in the menu-bar?

texts:
Notice in the screenshot below, the *Paradox Report* buffer is not
displayed in the menu-bar, even though it's clearly a buffer in the
buffer-list.

An easy way to test this is to run M-: (get-buffer-create "*hello*"), and then look for this buffer on the menu-bar.

I'm guessing the menu-bar tries to be smart and ignore some buffers
the user probably doesn't care about. My question is what criteria
does it use? and how can I get around it?

That is, when I create the *Paradox Report* buffer, I want to ensure
it will get displayed on the menu-bar.

After I manually visit the buffer once it does get displayed on the menu-bar.
The buffer name does not start with a space (is is "*Paradox Report*").
It seems this only happens on (development code for what might become) Emacs 25.


texts: Show additional lines that are not part of the file

texts:
What I want is the opposite of code folding. Code folding looks like this:

Unfolded:
1 * Top Level
2 ** Second Level
3 Info that belongs to Second Level
4 More Info that belongs to Second Level
5 ** Another Second Level
6 More Info

Folded (usually with a "..." at the end of Second Level):
1 * Top Level
2 ** Second Level
5 ** Another Second Level
6 More Info

What I want looks like this:

Unexpanded:
1 * Top Level
2 ** Second Level
3 Info that belongs to Second Level [Expandable]
4 More Info that belongs to Second Level
5 ** Another Second Level
6 More Info

Expanded:
1 * Top Level
2 ** Second Level
3 Info that belongs to Second Level [Expandable]
  Additional info
  More additional info
4 More Info that belongs to Second Level
5 ** Another Second Level
6 More Info

The main idea is that I don't want the additional information to be part of the actual file. The information is sourced from elsewhere. How can I inject these pseudolines into my buffers?


texts: Stop Emacs from adding all subdirs to default-directory

texts:
I'm having trouble stopping Emacs from loading all packages in my default-directory. When I call c-h v load-packages I get a listing of all subdirectories inside my elpa directory, which I want to avoid.

I have the following in my startup files:

(setq package-enable-at-startup nil)

and I do not have the following:

(let ((default-directory user-emacs-directory))
  (normal-top-level-add-subdirs-to-load-path)
  )

(I have it commented, though).

In spite of that, I still get the following when I ask Emacs to show me the value of load-path:

 ("/Users/nivaca/Dropbox/emacs/elpa/adaptive-wrap-0.5/" "/Users/nivaca/Dropbox/emacs/elpa/async-20150818.1154/" "/Users/nivaca/Dropbox/emacs/elpa/auctex-11.88.8/" "/Users/nivaca/Dropbox/emacs/elpa/autopair-20140825.427/" "/Users/nivaca/Dropbox/emacs/elpa/color-theme-20080305.34/" "/Users/nivaca/Dropbox/emacs/elpa/dedicated-20090428.1231/" "/Users/nivaca/Dropbox/emacs/elpa/dired+-20150830.1456/" "/Users/nivaca/Dropbox/emacs/elpa/duplicate-thing-20120515.948/" "/Users/nivaca/Dropbox/emacs/elpa/expand-region-20150902.558/" "/Users/nivaca/Dropbox/emacs/elpa/flx-ido-20140821.2033/" "/Users/nivaca/Dropbox/emacs/elpa/flx-20140921.739/" "/Users/nivaca/Dropbox/emacs/elpa/flycheck-20150831.1343/" "/Users/nivaca/Dropbox/emacs/elpa/highlight-parentheses-20150421.2328/" "/Users/nivaca/Dropbox/emacs/elpa/hl-indent-20141227.1330/" "/Users/nivaca/Dropbox/emacs/elpa/hl-line+-20150104.2222/" "/Users/nivaca/Dropbox/emacs/elpa/hl-sentence-20140802.920/" "/Users/nivaca/Dropbox/emacs/elpa/ido-hacks-20150331.1209/" "/Users/nivaca/Dropbox/emacs/elpa/ido-ubiquitous-20150630.926/" "/Users/nivaca/Dropbox/emacs/elpa/ido-completing-read+-20150630.926/" "/Users/nivaca/Dropbox/emacs/elpa/indent-guide-20150713.2327/" "/Users/nivaca/Dropbox/emacs/elpa/leuven-theme-20150818.556/" "/Users/nivaca/Dropbox/emacs/elpa/lua-mode-20150804.2302/" "/Users/nivaca/Dropbox/emacs/elpa/markdown-mode+-20120829.510/" "/Users/nivaca/Dropbox/emacs/elpa/markdown-mode-20150904.656/" "/Users/nivaca/Dropbox/emacs/elpa/mc-extras-20150218.234/" "/Users/nivaca/Dropbox/emacs/elpa/move-text-20140307.1644/" "/Users/nivaca/Dropbox/emacs/elpa/multi-term-20150220.1320/" "/Users/nivaca/Dropbox/emacs/elpa/multiple-cursors-20150710.456/" "/Users/nivaca/Dropbox/emacs/elpa/neotree-20150904.609/" "/Users/nivaca/Dropbox/emacs/elpa/paradox-20150812.732/" "/Users/nivaca/Dropbox/emacs/elpa/let-alist-1.0.4/" "/Users/nivaca/Dropbox/emacs/elpa/pkg-info-20150517.443/" "/Users/nivaca/Dropbox/emacs/elpa/epl-20150517.433/" "/Users/nivaca/Dropbox/emacs/elpa/pretty-mode-20141207.1152/" "/Users/nivaca/Dropbox/emacs/elpa/rainbow-delimiters-20150320.17/" "/Users/nivaca/Dropbox/emacs/elpa/second-sel-20150105.46/" "/Users/nivaca/Dropbox/emacs/elpa/seq-20150709.1040/" "/Users/nivaca/Dropbox/emacs/elpa/smart-mode-line-20150803.338/" "/Users/nivaca/Dropbox/emacs/elpa/rich-minority-20150305.516/" "/Users/nivaca/Dropbox/emacs/elpa/smartparens-20150813.1451/" "/Users/nivaca/Dropbox/emacs/elpa/dash-20150829.433/" "/Users/nivaca/Dropbox/emacs/elpa/spinner-1.4/" "/Users/nivaca/Dropbox/emacs/elpa/tabbar-20141109.143/" "/Users/nivaca/Dropbox/emacs/elpa/undo-tree-20140509.522/" "/Users/nivaca/Dropbox/emacs/elpa/use-package-20150817.2257/" "/Users/nivaca/Dropbox/emacs/elpa/diminish-20091203.1012/" "/Users/nivaca/Dropbox/emacs/elpa/bind-key-20150321.213/" "/Users/nivaca/Dropbox/emacs/elpa/volatile-highlights-20141004.2240/" "/Users/nivaca/Dropbox/emacs/elpa/yasnippet-20150811.1222/")

Ultimately, the issue at hand is that I don't want Emacs to automatically load AuCTeX (I have eliminated all references to it from my startup files, but it still keeps loading itself).

Any ideas on how to stop this?

Update

Even with no startup file (I removed my .emacsd file) I get the same value for load-path. This happens even if I start with emacs -Q.


texts: Is there a way for EMMS to create playlists based on an existing directory structure?

texts:
I (finally!) have a working EMMS to play my music collection, and would like to sort it into playlists. At the moment, my music directory (~/Music/) is already organized into folders (at the first level) which I would like to form the new playlists. Thus, I have an arrangement similar to this:

The contents of ~/Music/foo should form a playlist foo
The contents of ~/Music/bar should form a playlist bar
etc.

Can this be done in EMMS, and if so, how? Ideally, I would like to do it programmatically, so that in future, if I add more music, it'll generate another playlist for me automatically.


texts: I've just installed header2 from elpa and -- now what? I'm afraid I can't fathom where to begin with this beast. I'd like to make a custom org-mode header. Is there a tutorial somewhere that can get me going on it? I've only found the original "OriginalHeaderEl" code, which lists user commands such as make-header. I do this, and a generic-looking emacs lisp file header stuff appears. Obviously, I haven't customized (created a template?) for what goes into my header yet. How is this done? I saw this, but it tells me nothing about how to customize, etc., not the EmacsWiki homepage for header2 either. This shows a beginner's roll-your-own, which would be fine, but it's not the same as grokking an important piece of the Emacs eco-system like header2....


texts: Can't load spacemacs - it's trying to delete pspp-mode

texts:
I am a vim user who only uses emacs for my org-mode todo file, so I really don't know what I'm doing. After updating Ubuntu to 19.04 (and thereby updating emacs to 26.x), I'm getting an error when I open a file:

error: Package 'pspp-mode-1.0' is a system package, not deleting

When I look at the backtrace, it shows core-configuration-layer.el calling delete-orphan-packages, which is I assume where this problem is ocurring.


texts: Where is the information passed to `custom-set-variables` and `custom-set-faces` stored?

texts:
The post's title pretty much says it all.

In particular, I want to find out what happens if I invoke custom-set-variables twice, with completely different arguments each time.  E.g.

(custom-set-variables '(this "foo"))
(custom-set-variables '(that "bar"))

Does this have the same effect as

(custom-set-variables '(this "foo")
                      '(that "bar"))

?

And ditto for custom-set-faces.


texts: How to deselect a symbol selected by `elpy-multiedit-python-symbol-at-point` for renaming?

texts: I wanted to rename a variable, so I selected all its uses by C-c C-e (elpy-multiedit-python-symbol-at-point) and changed its name. How do I deselect it so that changes in one line don't appear in other lines?


texts:
Windows 10, Emacs 25.1, Package helm

Here content of my Helm-mini:

As you can see there are buffer with extensions .log and buffers with extenstions .txt
If I want to show only buffer with extensions .txt

I use pattern: .txt

Here result:

Question:
Is it possible to show all buffers with extenstions .log and extensions .txt ?


texts: How to remove the remaining commands of removed built-in packages?

texts:
I've read here that you can delete the built-in packages from emacs at /usr/share/emacs/25.2/lisp in order to get rid of their commands which may clutter the minibuffer every time you want to execute something via M-X or at auto-completion pop ups as you type in Emacs Lisp mode.

However, I still can see the packages that I've deleted when I run M-x package-list-packages RET in the package list marked with "built-in" status just as before. And more importantly, I still encounter their commands in the minibuffer or at auto-completion pop ups.

I've removed several dozens of packages that I don't need, their commands can't function, but they still appear. How can I completely remove the remnants of these built-in packages?


texts:
I encounter this problem almost always when i am working on a python-pygame project. Every second time when i evaluate the whole buffer with C-c C-c or with C-c C-l the pygame window open for a very short time and then every thing crashes including the python interpreter, and i get this error message:

Process Python segmentation fault (core dumped)

Does anyone know what the reason is and how can i fix it? I am on ubuntu 16.04 and using the default python-mode of emacs24.


texts: Insert trigonometric function to org file

texts:
When inserting trigonometric function or other mathematics formulas,
I usually insert an image to org file as

Is it possible writing such a formula to org.


texts: How can disable TAB to execute selected line in `counsel-M-x`?

texts:
I am using counsel-M-x, it has little bit different behavior than smex, where TAB may execute the line.
Is it possible to use TAB only for toggling where I just want to disable feature to execute the found command if its solo match?

Basic example:
Type M-x list-packages enter and pressing two TABs one after another will executute list-packages. I just don't want runnung the command to take place.


texts: I have spacemacs and when I search for a word using / once it turns out that I can't access it later on using the up arrow. This feature is present in vim so how do I cycle through search history after hitting / ?


texts: error request-default-error-callback generated by Activity watch mode

texts:
I have this error since installing the activity watch mode package.
Any idea on how correct it ?
The only setup I did was
(global-activity-watch-mode)

I've tried
 (setq global-activity-watch-mode nil)

Didn't make this error go away...


texts: How to turn every ALL CAP word in a buffer into Title case?

texts:
I need to fix a large .bib file where all proper names are in ALL CAPITALS (thanks ProQuest!)

Is there an elisp function that searches a buffer/region for words in all capitals and turns all characters except the first one into lowercase letters?

E.g.

DOE, JOHN --> Doe, John

I found a couple of functions on Xah Lee's excellent site that work on cases (Toggle cases, Title cases), but I don't know enough elisp to turn either of them into what I need.


texts: When I export to LaTeX -> PDF the footnote description is placed on the same page the reference appears.  Instead, I'd like all the descriptions to appear in the end of the article.  Is this possible?


texts: C-< and C-, keys are echoed as C-\ in no-window mode

texts:
I'm trying to edit multiple lines with multiple-cursors package. MC package has C-< keybinding but when I do C-< (Control+less-than sign) it is echoed as C-\ (Control+backslash).

I don't know how to solve it. The same applies to C-, (Control+comma) as well. I activate MC with C-S-c C-S-c (Control+Shift+c Control+Shift+c) keybinding.

I can share my code if that will help.

Edit 1: My OS is MS Windows 10 and emacs is 25.2.1.


texts: Is possible to have alternate table rows in another color in org-mode tables?

texts:
I would want something like this, for some specific tables with many rows (so columns are easier to read):

I know about stripes mode (and sometimes I resort to using it), but that changes format for the whole buffer, not just one table in it (the image below was taken using a locally modified version of stripes.el, btw)


texts: upgrading org version8 export-block to org version9

texts:
I have been trying org-export with ox-trac for trac wiki format but ox-trac was developed for org version 8.x and I am running org version 9. Given that :export-block is obsolete now, so the export fails.  I have opened an issue on the ox-trac github development page but it appears that the development has ceased.
I am willing to upgrade it to v9, please help with some pointers to begin with.


texts: Copy non-printable characters as displayed by Emacs

texts: Very similar to this question: Copy text as it is rendered by Emacs but what I need is to coy the ^M, ^E and so on characters as they are displayed. (Otherwise the text in clipboard gets truncated).


texts:
I'm interested in making a major mode to display PGN files nicely.  I'm trying to create my own faces since the defaults don't seem super-appropriate.

My mode definition looks like this:

(defface my-r-face `((t (:foreground "red")))  "Red highlight")

(setq pgn-highlights
      '(("Pi\\|Infinity" . font-lock-constant-face)
    ("Sin\\|Cos" . font-lock-string-face)
    ("[0-9]+\\." . font-lock-keyword-face)
    ;; ("%.*" . my-r-face) ;; This doesn't show up (the relevant text appears just like the default text
    ("%.*" . font-lock-comment-face) ;; works great - relevant text looks like the comment face
    ))

(define-derived-mode pgn-mode fundamental-mode "mymath"
  "major mode for editing mymath language code."
  (setq font-lock-defaults '(pgn-highlights)))

A typical file that I'd like to use this on is:

[Event "?"]
[Site "?"]
[Date "2019.6.3"]
[Round "?"]
[White "Mike"]
[Black "Mikey"]
[Result "*"]
[WhiteELO "?"]
[BlackELO "?"]

%Created by Caissa's Web PGN Editor
1. e4 e5 2. Nf3 Nc6 3. Bc4 Bc5 4. O-O Nf6 5. d3 d6 6. Nc3 a6 7. a3 Be6 8.
Bxe6 fxe6 9. h3 O-O 10. Be3 Ba7 11. Ra2 Qe8 12. Qc1 Nh5 13. Qd2 Nf4 14. g3
Nxh3+ 15. Kg2 Qh5 16. Rh1 Qxf3+ 17. Kh2 Nxf2 18. Rf1 Qh5+ 19. Kg2 Qf3+ 20.
Kg1 Qh1#

The issue is the line with the comment (%Created by...).  If I use the built-in font-lock-comment-face then everything is highlighted nicely and the comment looks like the normal comment.  But if I change it to use my-r-facethen the comment is not highlighted, and instead appears be be the default font face.

What am I doing wrong here?


texts: Unable to restore point in magit commit buffer

texts:
When I open commit buffer (pressing c c), the pointer is shown in random locations instead of showing point at beginning of buffer. This is quite annoying as I have to manually move point every time.

I also checked this FAQ in magit and added these to init file

(setq session-name-disable-regexp "\\(?:\\`'\\.git/[A-Z_]+\\'\\)")

(with-eval-after-load 'pointback
  (lambda ()
     (when (or git-commit-mode git-rebase-mode)
     (pointback-mode -1))))

But still point is not getting restored. I even tried  this

(defun restore-point ()
   (interactive)
   (when (string-match ".git/COMMIT_EDITMSG" buffer-file-name)
      (goto-char (point-min))))
(add-hook 'git-commit-mode-hook 'restore-point)

Still its not restoring. Any idea what might be going wrong here?

Magit config is here and emacs config.


texts:
I am currently using pweave but will eventually need to switch to org mode on emacs.  The biggest issue i encounter is the persistence of variables and packages imported.
Here is the pweave code:

#' Import module and create a variable:
import numpy as np
from numpy import pi, sin
x = np.arange(-2*pi, 2*pi, 0.1)
print(x[0:5])

#' now we calculate sin(x)
y = sin(x)
print(y[0:5]

#' let's graph that
import matplotlib.pyplot as plt
plt.plot(x,y)

That is no problem in python's pweave, but in org mode, it fails to keep the variable and its type and the imported modules from one block code to the next.

Here is the org mode attempt:

* Import numpy module and create a numpy array:
#+BEGIN_SRC python :exports both
import numpy as np
from numpy import pi, sin
x = np.arange(-2*pi, 2*pi, 0.1)
return(x[0:5])
#+END_SRC

* Then we calculate the sine of the numpy array created in previous block.
  At this stage, in pweave, both the array created and the module imported
  are already stored and available for use in the next block. And this is
  precisely where the bock code hits the road block in org mode because it
  did not cache the module nor the array for future use.
#+BEGIN_SRC python :exports both :results file
y = sin(x)
import matplotlib.pyplot as plt
fig = plt.figure()
plt.plot(x,y)
plt.savefig('~/fig.pdf')
return '~/fig.pdf'
#+END_SRC

* finally, plotting x vs. y:
#+BEGIN_SRC python :exports both
return(y[0:5])
#+END_SRC

It also raises the following question: do i really need to open a new block code just for the purpose of printing y?  How the previous block code handle 2 returns,the file and the print of variable y?

Anyone has a solution for this, please ?

Thanks


texts: Automatically highlight elements in an XML buffer

texts:
I spend a lot of time in XML buffers using nxml-mode (Emacs 26). Out of hundreds of XML elements, I am only interested in one or two. How can I have Emacs always show the XML elements I'm interested in with a different colour? This will help me keep track of the important elements while working without having to keep searching with C-s and C-r.

For example, in the following XML file, I want the tags for element THING_NAME to show up in a different coloured font instead of the default blue, and leave the tags for elemenst XML_FILE, THING_VERSION, and THING_TYPE in the default colour.

<?xml version='1.0' encoding='ISO-8859-'?>
<XML_FILE>
  <THING_VERSION>2.2</THING_VERSION>
  <THING_NAME>BOB</THING_NAME>
  <THING_TYPE>ITEM</THING_TYPE>
</XML_FILE>

Here's a screenshot. It would be great if the highlighted tags for THING_NAME were in a different colour, like pink or red, to make it easier to see in large files.

[

I've tried adding font-lock-add-keywords to init.el but it had no effect. For example:

(font-lock-add-keywords 'nxml-mode
        '(("THING_NAME" . font-lock-keyword-face)))

I also tried adding a hook to the mode using add-hook from the Emacs manual:

(add-hook 'nxml-mode-hook
         (lambda ()
          (font-lock-add-keywords nil
           '(("\\(THING_NAME\\)" 1
              font-lock-warning-face t)))))

After reading the nxml-mode Emacs documentation and Emacs wiki entries, and installing themes from MELPA and looking at the code, I'm still unsure of how to proceed.

This has been driving me crazy! Any help would be very appreciated, and I'm sure many others would find this useful. Maybe I am approaching this the wrong way. Would it be better to have an always-on search that permanently highlighted specific matches?

Solution after the response from glucas, shown below

Thanks to glucas I created a regexp interactive highlight for "THING_NAME". The keys I typed were:

 M-s h r   THING_NAME   RET   RET

I extended this to good final solution by creating a keyboard macro to automatically bind C-c t to the interactive highlight in ~/.emacs.d/init.el. The macro is named thingname, so I can also type M-x thingname. Notice how the regexp search term "THING_NAME" is escaped as "?T ?H ?I ?N ?G ?_ ?N ?A ?M ?E":

(fset 'thingname
  [?\M-s ?h ?r ?T ?H ?I ?N ?G ?_ ?N ?A ?M ?E return return])
(global-set-key (kbd "C-c t") 'thingname)

Applied to the example XML above, it looks like this:

You can add multiple highlights, each with a different colour, by repeating the call to M-s h r as many times as needed. Here, I add another highlight for "THING_WEIGHT" to the same binding:

(fset 'thingname
  [?\M-s ?h ?r ?T ?H ?I ?N ?G ?_ ?N ?A ?M ?E return return
   ?\M-s ?h ?r ?T ?H ?I ?N ?G ?_ ?W ?E ?I ?G ?H ?T return return])
(global-set-key (kbd "C-c t") 'thingname)


texts: Hook for rainbow-delimiters doesn't work

texts:
I use the following to setup rainbow-delimiters.
(use-package rainbow-delimiters
  :hook (prog-mode . rainbow-delimiters-mode))

When open a clojure file, the rainbow-delimiters-mode is not enabled.  I add some print messages to the rainbow-delimiters-mode function,
(define-minor-mode rainbow-delimiters-mode
  "Highlight nested parentheses, brackets, and braces according to their depth."
  nil "" nil ; No modeline lighter - it's already obvious when the mode is on.
  (font-lock-remove-keywords nil rainbow-delimiters--font-lock-keywords)
  (message "**** WIERD A")
  (when rainbow-delimiters-mode
    (message "**** WIERD B")
    (font-lock-add-keywords nil rainbow-delimiters--font-lock-keywords 'append)
    (set (make-local-variable 'jit-lock-contextually) t)
    (when (or (bound-and-true-p syntax-begin-function)
              (bound-and-true-p font-lock-beginning-of-syntax-function))
      ;; We're going to modify `syntax-begin-function', so flush the cache to
      ;; avoid getting cached values that used the old value.
      (syntax-ppss-flush-cache 0))
    ;; `syntax-begin-function' may break the assumption we rely on that
    ;; `syntax-ppss' is exactly equivalent to `parse-partial-sexp' from
    ;; `point-min'. Just don't use it, the performance hit should be negligible.
    (when (boundp 'syntax-begin-function)
      (set (make-local-variable 'syntax-begin-function) nil))
    ;; Obsolete equivalent of `syntax-begin-function'.
    (when (boundp 'font-lock-beginning-of-syntax-function)
      (set (make-local-variable 'font-lock-beginning-of-syntax-function) nil)))
  (when font-lock-mode
    (if (fboundp 'font-lock-flush)
        (font-lock-flush)
      (with-no-warnings (font-lock-fontify-buffer)))))

When opening a new clojure file, it will print out:
**** WIERD A
**** WIERD B
**** WIERD A
**** WIERD B
**** WIERD A


texts: Setting primary frame across displays on MacOS

texts:
I am working with 2 emacs frames, one on my laptop monitor (1) and the other on a larger external display (2).
Whenever I switch between applications, e.g. between shell and Emacs, the Emacs cursor will be placed on the frame on the laptop, i.e. the smaller screen (1). I then switch by doing C-x 5 o every time, which I'd like to avoid.
Edit(3/13):
It is important to note that the application I switch to, e.g. the shell, is going to be on the small monitor (1). That is to say, I want the primary focus of Emacs to stay on the frame on monitor (2) even when switching to an application on monitor (1) temporarily. The process described in the comments works fine if my frame and the application I switch to are on the same monitor

Is there a way to set one frame as the initial / primary one?

I found this question, which seems related but the command in the answer did not work for me. I could not find anything helpful in the man either.
Any pointers are appreciated as I am new to this!
Running emacs 25.3 on Mac OS Sierra 10.12


texts: How to debug inability to load library `auto-complete`

texts:
I am a new to Emacs , i downloaded auto-complete , moved it to ~/.emacs.d/plugins/ then modified the .emacs file to look like :

(add-to-list 'load-path (file-name-as-directory
                     (expand-file-name "~/.emacs.d/plugins/auto-complete"))\
)

(require 'auto-complete)
(global-auto-complete-mode t)

(ac-config-default)
(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.
'(menu-bar-mode nil)
'(package-archives (quote (("melpa" . "http://stable.melpa.org/packages/") ("g\
nu" . "http://elpa.gnu.org/packages/")))))
(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.
)

when i restart emacs , it displays the following error :

Warning (initialization): An error occurred while loading `/Users/zeaksilva/.emacs':

File error: Cannot open load file, auto-complete

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace.


texts:
I have just installed spacemacs recently.
I press fd to switch from insert state to normal state, but it does not work.

The combination keys fd shown on the editor then disappear, but when I press SPC key, it inserts a space character in the buffer.

This is spacemacs behavior when I pressed fd

Is there any configuration that I missed?


texts:
How can I permanently rebind keys?

I'd like to rebind C-i, C-j, C-k, and C-l to act like the arrow keys.  However, when using

(global-set-key (kbd "C-l") 'forward-char)

it will only do so for the session; the bindings don't persist after restarting Emacs.

Is there some way to automatically do this every time on startup or via a config file or something?


texts: Switch to *grep* buffer after running rgrep

texts:
I have assigned C-c C-g to rgrep, this works fine, however I am still in the buffer I was in and not in the grep buffer which loads the results.

After hitting C-c C-g and running rgrep, I want to be in the grep buffer how do I do this?

I tried writing a new function

(defun rgrep-switch()
   (interactive)
   (rgrep)
   (switch-to-buffer "*grep*"))

but this is throwing an error.


texts:
I'm trying to set the default font for my Emacs based on a variable (so I can use a different font on a different machine):

(setq fontspec (concat ck-font-name "-" (number-to-string ck-font-size)))
(set-default-font fontspec)
(set-fontset-font "fontset-default" nil
                  (font-spec :size ck-font-size :name ck-font-name))
(add-to-list 'default-frame-alist '(font . fontspec))

This basically works but the last line throws a warning:

frame-notice-user-settings: Invalid font: fontspec

I know what the problem is (fontspec seems to not be defined when the list gets evaluated), but I don't know how to fix this; my elisp-fu is not good enough.

Can somebody explain me or give me a pointer where I can read how to fix this?


texts: List of hooks inhibited by inhibit-modification-hooks

texts:
The documentation of inhibit-modification-hooks states

Non-nil means don't run any of the hooks that respond to buffer changes.

This affects before-change-functions and after-change-functions,
as well as hooks attached to text properties and overlays.
Setting this variable non-nil also inhibits file locks and checks
whether files are locked by another Emacs session, as well as
handling of the active region per select-active-regions.

Besides before-change-functions and after-change-functions, how can I get a list of all "hooks attached to text properties and overlays"? Are these the only hooks that inhibit-modification-hooks inhibits or are there others? For example, wouldn't first-change-hook be inhibited as well?


texts:
Using Spacemacs, if I SPC f r to search for recent files I am prompted for a pattern. I can enter e.g. a value of our which will match a file named Journal.org.

However if I do C-x r b to jump to a bookmark, and then enter some text to match, the match appears to only work at the beginning of the bookmark name. In other words, entering git will not match in the bookmark jump list a bookmark of KB/Git. However, if I have jumped to KB/Git previously, searching for git will offer KB/Git in the jump history.

Is there a way of suggesting bookmark names where the entered pattern matches any part of the bookmark name, like it does when searching for recent files?

I am aware I can co C-x r l and then search with / but am wondering if I can get the same result using C-x r b.


texts: How to conserve paragraph level indentation, after source code block in that paragraph, using Emacs org mode?

texts:
I'm editting the following file in emacs using org mode

- paragraph 1 which is part of a list and extends to multiple lines
  #+BEGIN_SRC
  . . . <some source code here> . . .
  #+END_SRC
  Continue the rest of paragraph 1

Now, my problem is that I don't know how to write the rest of paragraph 1 which comes right after the #+END_SRC on the same level of indentation, because although I hit Enter on the keyboard to insert a new line, it should remain at the same level of indentation of the paragraph 1 as it is still part of the same paragraph but Emacs just puts it at the beginning of the next line and doesn't conserve the current structure in terms of line indentation anymore (in regard to paragraph1 indentation level). Any idea? Thanks.


texts:
Given;

(setq whole '(group1 group2(element1 element2(suba subb subc)
   element3) group3))

I would to print some list of that list, like element2 sublist.

How can i do it?


texts: Optional argument in AuCTeX definition of environment

texts:
I want to create a style file for the tcolorbox environment. I have the following:

(add-hook 'LaTeX-mode-hook
      (lambda ()
        (LaTeX-add-environments
         '("tcolorbox")
         ))
      )

However, I want Emacs to query for the optional [title=] parameter. How can I do that?


texts: On Linux why should one choose Lucid over Gtk gui for emacs?

texts:
I run Ubuntu 16.04. On searching Ubuntu Software app for Emacs I am presented with two guis, Lucid and Gtk.

Which one should I choose and why?


texts:
I use org-mode with org-pomodoro.

Status bar at the bottom get's pretty long. Like:

-:**- leo.org   Top L50 (org Ind Helm drag Abbrev) [6:08 (bug 459487 - [Gtk] Replace deprecated ......)] [Pomodoro-19:42]

and it's only fully visable if there is only a single window(/frame).

Is it possible to display the status bar in the title bar of emacs instead? (I am using the GUI version of emacs.)

Or alt. Can I shorten it somehow myself via hacks? E.g only show the first xyz chars, and only show the last xyz chars and trim out the middle if it doesn't all fit?


texts:
I'm trying to write a document like this with emacs -nw
It will be exported via ftp to a website so a client can
see the research/report with their browser.
Essentially

ability to center a heading respecting the 80 column rule
ability autoindent without having to press space three times
Ability for a word to hyperlink to another spot - to make a TOC
Ability to export to html

Whats the best way to do this?
So far I have this, but it doesn't do point #3
emacs /tmp/example
M-x auto-fill-mode
(setq fill-column 80)
(setq left-margin-width 3) ;; not sure if needed
M-x center-line
M-x htmlfontify-buffer

Whats the best way to go about doing this?


texts: underscore ("_") randomly stops working for ESS

texts:
I am using iESS console and editor (ESS) for R programming, and often times (and randomly) the _ stops resulting in <-.

To temporarily hack it, I found that I could use ess-toggle-underscore or ess-toggle-S-assign here. BUT they don't seem to exist when I M-x or look at changing the value by M-x customize-variable.

I would like atleast a temporary hack like, using a command and resetting the behavior
I would like to get to the bottom of this! Can you guide me where I need to look?

P.S
The only way I reset the system is by restarting the buffer aka closing the file/console and opening it again.

Thanks!


texts: Filter plain org file by property (file not in agenda)

texts:
Let's say I have an org file with this structure:

* Books

** READING Some book title :@nonfiction:@psychology:
:PROPERTIES:
:AUTHOR: Cialdin
:PURCHASE_DATE: 25/02/2020
:END:

How would I filter by author=cildin? Basically something like org-match-sparse-tree but for property key value pairs?


texts:
I'm trying to get eldoc-mode to work in python-mode.  If I enter a python buffer and do

M-x eldoc-mode
M-x python-mode-switch-to-shell

This seems to work for some built-in functions, but mostly doesn't:

dir( gives imformation
import os gives imformation
import subprocess does not
A function I define does not

Is there anything else I need to do?


texts: spacemacs - How do I open from the recent file list?

texts: I see the recent files listed when I boot up emacsclient -nc. How do I open them in the current window?


texts: How to advise code to keep popup menus within frame?

texts:
How to advise code that pops up menus (like the ones you get by left-clicking a major-mode indicator in the modeline) to stay within the current Emacs frame?

Background:
Probably this is a bug within my window manager. I have a multi-monitor setup with one screen above the other. With Emacs's frame at the bottom of the upper screen its popup menus look like this:

But it should look like this:

I would not mind if this popup menu popped up far away from my mouse, as long as I was able to use the menu.

Note: with x-popup-menu placing of own popup menus is possible, so it should somehow be possible with those major-mode popup menus from modeline.


texts: How to programmatically extract configurations from a defcustom variable?

texts:
How do I programmatically extract key-value pairs from "Babel Languages" list in defcustom org-babel-load-languages section of org.el?

I want to read the "Babel Languages" configuration into an org-mode code block and return the full list of the available programming languages.

For example, I'm want to transform the input below:

  (const :tag "Awk" awk)
  (const :tag "C" C)
  (const :tag "R" R)

into an output value like this

(("Awk") ("C") ("R"))

I included the specific defcustom section from org.el for clarification.

(defcustom org-babel-load-languages '((emacs-lisp . t))
  "Languages which can be evaluated in Org-mode buffers.
This list can be used to load support for any of the languages
below, note that each language will depend on a different set of
system executables and/or Emacs modes.  When a language is
\"loaded\", then code blocks in that language can be evaluated
with `org-babel-execute-src-block' bound by default to C-c
C-c (note the `org-babel-no-eval-on-ctrl-c-ctrl-c' variable can
be set to remove code block evaluation from the C-c C-c
keybinding.  By default only Emacs Lisp (which has no
requirements) is loaded."
  :group 'org-babel
  :set 'org-babel-do-load-languages
  :version "24.1"
  :type '(alist :tag "Babel Languages"
        :key-type
        (choice
         (const :tag "Awk" awk)
         (const :tag "C" C)
         (const :tag "R" R)
         (const :tag "Asymptote" asymptote)
         (const :tag "Calc" calc)
         (const :tag "Clojure" clojure)
         (const :tag "CSS" css)
         (const :tag "Ditaa" ditaa)
         (const :tag "Dot" dot)
         (const :tag "Emacs Lisp" emacs-lisp)
         (const :tag "Fortran" fortran)
         (const :tag "Gnuplot" gnuplot)
         (const :tag "Haskell" haskell)
         (const :tag "IO" io)
         (const :tag "Java" java)
         (const :tag "Javascript" js)
         (const :tag "LaTeX" latex)
         (const :tag "Ledger" ledger)
         (const :tag "Lilypond" lilypond)
         (const :tag "Lisp" lisp)
         (const :tag "Makefile" makefile)
         (const :tag "Maxima" maxima)
         (const :tag "Matlab" matlab)
         (const :tag "Mscgen" mscgen)
         (const :tag "Ocaml" ocaml)
         (const :tag "Octave" octave)
         (const :tag "Org" org)
         (const :tag "Perl" perl)
         (const :tag "Pico Lisp" picolisp)
         (const :tag "PlantUML" plantuml)
         (const :tag "Python" python)
         (const :tag "Ruby" ruby)
         (const :tag "Sass" sass)
         (const :tag "Scala" scala)
         (const :tag "Scheme" scheme)
         (const :tag "Screen" screen)
         (const :tag "Shell Script" sh)
         (const :tag "Shen" shen)
         (const :tag "Sql" sql)
         (const :tag "Sqlite" sqlite))
        :value-type (boolean :tag "Activate" :value t)))


texts:
I am not sure which terms to search for this with, perhaps you can help. Sometimes when I move around my emacs window, some grey clutter emerges on the left hand side. The file that I am working on is growing in size (82 Kb), but is not that huge (I would expect). I also have gradually added a bunch of things to the .emacs startup, but again, not that much. The computer is not overloaded with other apps either. I'm working with Windows 7.

The clutter is purely visual and apart from hiding the some letters briefly does not obstruct the use in any way. The clutter is easy to get rid of with some scrolling or looping through buffers, which works sometimes. Writing on the clutter also forces the cluttered part to be updated with the proper contents.

Any idea which problems I may be facing? And could it increase with file size? It looks like this:

The image of how it looks like does not seem to work with google drive, but it should be visible here: https://drive.google.com/file/d/0B-vbd3c7HrSJS240aUMxaV9xZmc/view?usp=sharing

Update

The problem persists when starting up with emacs -Q (noinit), and with no open files.


texts:
Recently I've done a lot of work cleaning up some HTML files that were generated by LibreOffice.  It made me really wish for a way to edit the document structure, à la paredit-mode.

For example, for some reason LibreOffice rendered one particular ordered list like this:

...

...

...

I would have loved a way to put the point somewhere in the first ol and issue a command analogous to paredit-forward-slurp-sexp to pull the content of the second list into the first, and then repeat for all the remaining lists.

As another example, I also needed to insert some breaks in a set of nested divs:

    ...
    <-- point is here

I wished I could issue a command analogous to paredit-split-sexp twice to get this:

    ...

<-- point is here

Does such a thing exist?


texts: How narrow from cursor to end of buffer?

texts:
M-x narrow-to-region   - Narrow down to between point and mark

But I need to narrow from cursor position to end of buffer. Is it possible?


texts:
I may have missed something somewhere but I can't make babel work !

I have installed and enabled correctly python-mode and in org mode I enter the begin_src section by completing .

Everything stay grey and it with no code indentation, it seems that python isn't recognize.

In my .emacs I have loaded python for babel :

(org-babel-do-load-languages
 'org-babel-load-languages
 '((emacs-lisp . t)
   (python . t)
   ))

The org file section looks like this :

#+BEGIN_SRC: python
def hello( ):
    print "hello"
#+END_SRC

I haven't seen it working on my computer yet and I keep dreaming of it every night !

Is there any org hero in the area ?


texts:
Org agenda supports a powerful exporting function (org-agenda-write), which exports your agenda view to pdf, ps, html.. format beautifully. In this post, I hope to make that process automatically.

More specifically, I'd like to have a cron job that handles everything. A function (org-store-agenda-views) that comes close is described in the same link above. However, after tinkering for two hours, I still can't find what I want.

Currently, I have to do it manually:

Enter org agenda.
Launch log view, so I can see exactly how the entries are clocked.
Launch clock report mode, so I get a nice time summary table.
Fire (org-agenda-write).

As my attempt to do it automatically, I've tried

  (setq org-agenda-custom-commands
    '(("X" "EXPORT" ((agenda "" ((org-agenda-span 7)
                                 (org-agenda-log-mode-items '(closed clock state))
                                 (org-agenda-clockreport-mode t)
                                 (org-agenda-start-on-weekday 0))
                    )) nil (("~/agenda.html" "~/agenda.pdf"))))

as in the link. Notice that org-agenda-log-mode-items and org-agenda-clockreport-mode are the two closest variables I've found. But it did not affect the generated file..

Question

How to generate a full clocked agenda view automatically?


texts: Compiling Emacs from source on Ubuntu - problems with libxml2

texts:
I'm trying to install Emacs 25.1.rc1 on Ubuntu 15.10, and have pre-installed the usual dependencies i.e.:

autoconf
automake
libtool
texinfo
build-essential
xorg-dev
libgtk2.0-dev
libjpeg-dev
libncurses5-dev
libdbus-1-dev
libgif-dev
libtiff-dev
libm17n-dev
libpng12-dev
librsvg2-dev
libotf-dev
libxml2-dev

However, when I inspect the output of ./configure libxml2/xml2 is off and when I make && make install emacs and run it, M-x eww says Emacs wasn't compiled with libxml2

I need help!

UPDATE

I had previously installed using Linuxbrew, which had installed pkg-config as a dependency. (ed. Yes, I know, well it seemed like a good idea at the time!)

Removed it and recompiled Emacs.  Configure finds and reports libxml2 as expected.


texts: Strange behaviour of Solarized-theme in Org-mode

texts:
I installed the Solarized theme through package-install RET solarized-theme, and it went largely well but .org files have a strange appearance:

Note how it hides the line numbers. Here is how it looks on other files:

How do I make it so that org files have the same appearance as other files? Please note that I am new to this so I may not understand some things that are obvious to more experienced Emacs hackers.

My init.el file:

(package-initialize)

;;settings files location
(add-to-list 'load-path "~/.emacs.d/settings")
(add-to-list 'load-path "~/.emacs.d/elpa/")
;;import settings from other files
(require 'general-settings)

;;theme loading
(add-to-list 'load-path "~/.emacs.d/elpa/")
(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 (solarized-dark)))
 '(custom-safe-themes
   (quote
    ("8aebf25556399b58091e533e455dd50a6a9cba958cc4ebb0aab175863c25b9a4" default)))
 '(inhibit-startup-screen t)
 '(package-selected-packages (quote (solarized-theme))))
(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.
 )
(load-theme 'solarized-dark t)
;;ido
(require 'ido)
(ido-mode t)(package-initialize)

(setq package-archives
      '(("gnu" . "http://elpa.gnu.org/packages/")
       ("marmalade" . "http://marmalade-repo.org/packages/")
       ("melpa" . "http://melpa.milkbox.net/packages/")))

;;org-mode

;;markdown
(autoload 'markdown-mode "markdown-mode"
   "Major mode for editing Markdown files" t)
(add-to-list 'auto-mode-alist '("\\(.text\\|.markdown\\|.md\\)'" . markdown-mode))
(setq markdown-enable-math t) ;;enables math functions

my settings file (some useful things I borrowed from a friend):

;;------------------------------;;
;;   Global Editor    Settings  ;;
;;------------------------------;;

(setq current-language-environment "English") ;; Language
(setq inhibit-startup-screen t) ;; Don't show the start-up Screen

(menu-bar-mode 0) ;; Toggle menu bar

(require 'tool-bar) ;; Toggle toolbar
(tool-bar-mode 0)

(global-hl-line-mode 1) ;; Highlight line with cursorx

(if window-system (scroll-bar-mode 0)) ;; Toggle scroll bar
(require 'mwheel) ;; Toggle mouse wheel support for scrolling
(mouse-wheel-mode 1)

(transient-mark-mode 1) ;; Transient-Mark Mode (highlight selection

(global-linum-mode t) ;; Display line number at left
(line-number-mode 1)
(column-number-mode 1)

;; Text decoration

;; Window resizing bindings
(global-set-key (kbd "S-C-<left>") 'shrink-window-horizontally)
(global-set-key (kbd "S-C-<right>") 'enlarge-window-horizontally)
(global-set-key (kbd "S-C-<down>") 'shrink-window)
(global-set-key (kbd "S-C-<up>") 'enlarge-window)

(provide 'general-settings)


texts: I found myself over and over again looking at some Japanese texts (mostly in Emacs) and thinking that it would be nice to have some simple functionality to transcribe regular text with kanji characters into hiragana (I'm still a beginner and know only a handful of kanjis, so this would allow me to read Japanese texts without poring over a dictionary). So how can this be done in Emacs?


texts:
Is there a way to visually show the merge-base of two branches in Magit?

I think it should be easy to do, there's git merge-base that returns the SHA1 of the commit, so maybe we could mark it in the log screen?


texts: Evil-emacs: how to select last pasted text (like gv)?

texts:
How do I visually select the last pasted text with evil-emacs?

gv reselects the last visual selection. I'd like a function/snippet that does the same for my last pasted text.


texts: How to open new window below _all_ other windows?

texts:
Suppose my Emacs frame looks like this:
.-------------.
|a     |b     |
|      |      |
|      |      |
|      |------|
|      |c     |
|      |      |
|      |      |
'-------------'

Is is possible now to open another window below all other windows to get the frame that looks like the one below?
.-------------.
|a     |b     |
|      |      |
|      |------|
|      |c     |
|      |      |
|-------------|
|d            |
'-------------'


texts: Is it possible to evaluate src blocks after export in org mode?

texts:
I have an org-mode file foo.org:

#+TITLE: My Title

Hello world!

#+BEGIN_SRC python :exports none
  with open('foo.txt', 'a') as f:
      f.write('text appended!')
#+END_SRC

Issuing C-c C-e t a writes foo.txt. My python block should append the text text appended! to foo.txt. Is it possible to make this happen automatically upon export?

According to the answer to this question, the code

#+TITLE: My Title

Hello world!

#+name: test
#+BEGIN_SRC python :exports none
  with open('foo.txt', 'a') as f:
      f.write('text appended!')
#+END_SRC

#+CALL: test()

should work, but it is not working for me.


texts: Org-export: Convenient input/pasting of style information with many lines

texts:
When exporting an Org buffer to HTML, how can I inject a <style>-tag with many lines of contents into the head of the HTML document?

I know #+HTML_HEAD: and #+HTML_HEAD_EXTRA:. But that prefix must be added to all contents lines.

I also know about #+BEGIN_EXPORT html...#+END_EXPORT.  But the contents of those blocks end up in the body of the HTML document.


texts: How to hide/fold parts of messages in notmuch

texts:
I've been trying various combinations of folding modes for Emacs, trying to get them to work with notmuch-show-mode, but to no avail:

Given two messages like this:

Summary: Some Guy <someguy@example.com> (May 27) (replied)
Subject: About this
To: Some Other Guy <someotherguy@example.com>
Date: Wed, 27 May 2020 13:45:51 +0200

[ multipart/related ]
[ text/html ]
Dear some guy

This is a reply to your mail.

------------------------------------------------
HEADERS_HERE
This is my original mail.

Summary: Some Guy <someguy@example.com> (May 27) (replied)
Subject: About this
To: Some Other Guy <someotherguy@example.com>
Date: Wed, 27 May 2020 13:45:51 +0200

[ multipart/related ]
[ text/html ]
This is my original mail.

I want to collapse the part from "-----------." and until the next "Summary: ".

I spend the most time trying to get hs-minor-mode working with this in my init.el:

(with-eval-after-load 'hideshow
   (add-to-list 'hs-special-modes-alist
                '(notmuch-show-mode
                  "---------" ; START
                  "Summary:" ;END
                  "" ; COMMENT-START
                  nil ; FORWARD-SEXP-FUNC
                  nil ; ADJUST-BEG-FUNC
                  )))

But calling M-x hs-minor-mode gives this error:

hs-grok-mode-type: notmuch-show Mode doesn’t support Hideshow Minor Mode


texts: Using evil-mode with a function that does not work well with evil-mode

texts:
The great org-mode has a fast way to jump between headings in an org file; M-x org-goto or C-c C-j. This doesn't work with evil mode that well.

If I am on evil normal mode in an org file, C-c C-j gets me the org-goto interface alright but I stay in normal mode. The same happens if I'm in insert mode. Even when I'm in Emacs state.

It is after the invocation of C-c C-j when I have to manually intervene and jump into Emacs state by myself in order to have the functionality work as intended. When I'm finished there, I stay in Emacs state, which I do not desire.

I had these two obvious tries with the machinery but evil ignores both methods. I'm in normal mode, no matter what.

;; No go
(defun progo-org-goto ()
  (interactive)
  (call-interactively 'evil-emacs-state)
  (call-interactively 'org-goto))

;; no go; but the advice did run.
;; also tried "after"
(defadvice org-goto (before goto-advice activate)
  (message "adviced goto")
  (call-interactively 'evil-emacs-state))

So what kind of magic do I have to perform to have evil change to Emacs state during the org-goto and then return to normal mode afterwards?


texts:
I want emacs to release (instead of grabbing) the parent terminal when started through the command line. Better if it is possible to send error messages to some temporary file.
By that I mean something equivalent to emacs 1>/dev/null 2>/tmp/emacs.xyz.log &.
Is there a dedicated configuration option for this?


texts: Is there a variable which determines if the cursor is at the end or the beginning of the line

texts: Is there a built-in boolean variable to determine if the cursor is at the end or the beginning of the line?


texts: I'm looking for a command that behaves similiar to fixup-whitespace, but I want it to also remove line breaks between objects around point.


texts: Where is `personal dictionary` for `ispell` located?

texts:
C-h v ispell-personal-dictionary shows nil. Its docstring says:

Documentation:
File name of your personal spelling dictionary, or nil.
If nil, the default personal dictionary for your spelling checker is used.

My spellchecker is hunpsell, installed in C:\Hunspell, Windows 10. Emacs finds it and performs spellcheck without issues.

Can't find any personal dic in its folder and subfolders.

Edit: the first comment gives a link, which explains where the default location is.


texts: Is it possible to see if a library is loaded after another one?

texts:
I am trying to find out if a library has been loaded after another one. For example has the ox-bibtex library been loaded after the org-ref library. I know you can look at fboundp, featurep, but I need to know the order of loading.
I thought I coudl use something like (seq-position obarray 'org-ref-command) but obarray seems to have symbols that are not even loaded.
The reason for this is in this case, the second library is clobbering something in the first library, and I am looking for a way to see what order things have been loaded.


texts: Mode line overflow/interference with Spaceline

texts:
I am using Spaceline with the following configuration:

(use-package spaceline-config
  :config
  (setq-default
    mode-line-format '("%e" (:eval (spaceline-ml-main)))
    powerline-default-separator 'wave
    spaceline-flycheck-bullet "❖ %s")
  (spaceline-install
    'main
    '((evil-state)
      (version-control :when active)
      (projectile-root :when active)
      (buffer-id))
    '((remote-host :when active)
      ((flycheck-error flycheck-warning flycheck-info) :when active)
      (major-mode :face highlight-face)
      (("L" line column) :separator ":"))))

However there is some interference between the mode-line and Spaceline, causing an overflow effect. I've tried using Powerline, patching fonts and fiddling with the powerline height, but that doesn't seem to help.

This is on the Macports version of Emacs 25 on macOS. Font is Fira Mono.


texts: sanityinc-tomorrow-eighties theme fails to show dired mode colors

texts:
I have the theme sanityinc-tomorrow-eighties enabled using

(load-theme 'sanityinc-tomorrow-eighties t).

I love this theme but my dired buffers do not show colors. I have installed and enabled dired+ package that automatically enables colored dired buffers. I know that this theme is the culprit because when I change themes the desired colored dired buffer appear.

How can I get dired buffers to show colors with this theme enabled?

Edit.

When I tried C-u C-x = it directs me to the following.

  State : THEMED.
   Face used for directory names.
Lisp expression: ((t
  (:inherit
   (diredfl-dir-name))))

But I don't have a palette of colors to choose from. Not really know how to edit this.


texts: emasc daemon does not load my init.el completely but emacs do

texts:
When I run emacs, everything is Ok, my init.el is read. However, after starting a daemon (emacs --daemon), an emacsclient GUI frame (emacsclient -c) is not configured for the following setting:

font size

(set-face-attribute 'default nil :font "Inconsolata-12.5")

icons in the mode line (doom mode line)

(use-package doom-modeline
  :init (doom-modeline-mode 1))

ivy package (until I use it)

(use-package ivy
  :diminish
  :bind (("C-s" . swiper)
     :map ivy-minibuffer-map
     ("TAB" . ivy-alt-done)
     ("C-l" . ivy-alt-done)
     ("C-j" . ivy-next-line)
     ("C-k" . ivy-previous-line)
     :map ivy-switch-buffer-map
     ("C-k" . ivy-previous-line)
     ("C-l" . ivy-done)
     ("C-d" . ivy-switch-buffer-kill)
     :map ivy-reverse-i-search-map
     ("C-k" . ivy-previous-line)
     ("C-d" . ivy-reverse-i-search-kill))
  :config
  (ivy-mode 1))

Here (emacs --daemon is not loading gui elements) and Here (Opening frames from emacs-daemon) it is mentioned that Emacs daemon doesn't know about the graphical frame, so every/some option that is needed for GUI is sort of neglected. In my init.el I commented out every line that has that option, but it didn't help.
I couldn't find anything helpful in the manuals of emacs and emacsclient.
Is there any arguments that should I add when starting Emacs daemon (other than --daemon) or emacsclient (other than -c)? or I have to edit init.el file?
Debian Buster/Sid -- Emacs version: 27.1


texts: Make names of major modes shorter in the mode-line

texts:
I want to make names of major modes shorter. No longer than three characters. Is there any packages that do something like that?

It's better to shorten mode names in automatic fashion, so one doesn't need to constantly manage this thing manually. I'm ready to consider any principle of shortening. Most trivial would be to use abbreviations, so emacs-lisp-mode would become el, for example. interactive-haskell-mode would become ih. Not bad at all for a start.

I also like Unicode characters like Greek letters and other stuff to be mode names, currently I use sort of hack to “rename” modes, but maybe there is full featured package to do it?

Clarification: the question is about mode names (values of variable mode-name usually), they are displayed in mode line. I want to make major mode “lighters” shorter.


texts: How to remap the search backwards evil-ex-search-previous command of evil?

texts:
I want to remap evil-ex-search-previous to some other key than ,.
I tried
(define-key evil-motion-state-map "," 'evil-avy-goto-char-in-line)
(evil-define-key 'normal magit-mode-map "," 'evil-avy-goto-char-in-line)
(evil-define-key 'visual magit-mode-map "," 'evil-avy-goto-char-in-line)

However none of it worked. Using which key I see, that , is still bound to the old key.
How can I change this?


texts: How to make sure that Markdown files are opened in Emacs (like normal files) and not in an external application?

texts:
I have openwith installed in my Emacs. I use it to open spreadsheets, PDF, and other files in their respective external applications.
Recently I had an Org mode file with the following content:
 * [[file:c:/usr/dp/dev/misc/mentiflectax.com/content/posts/sometext.md][Text for the comment on Reddit]]

When I click on the link, a Windows dialog pops up "What application should this file be opened with?"
Since this is a Markdown file, I want it to be opened in Emacs like any other text file.
How can I achieve this, i. e. make sure that

Markdown files are opened in Emacs and
files of types configured via M-x customize-group RET openwith RET are still opened in the respective external applications?


texts: How to make Emacs render HTML without having to save the file?

texts:
If you have ever used JS Bin, you know that as you type your code (HTML, CSS, Javascript) on the right is updated to fit what you typed. I have found this to be one of the most useful tools for making little code snippets. However, I would like the same feature to be implemented into Emacs.

So, as I type/edit code in my Emacs buffers, the web page would refresh or load asynchronously without my having to save the file or refresh the page.

As a side note: I do not care if the web browser is internal like w3, or external like Google Chrome.


texts: org-cycle behaves differently for src blocks when evil-mode is enabled

texts:
I'm trying to indent my code in org src blocks, but it only works when evil-mode is disabled. I have set this variables for org-mode:

(setq org-src-preserve-indentation t
      org-src-tab-acts-natively t
      org-src-fontify-natively t)

Now, in a org buffer, when I have a code like this:

#+BEGIN_SRC python
if True:

#+END_SRC

and press TAB right below the if, emacs idents my code properly. But, if I enable evil-mode, it just doesn't work, even if I call org-cycle manually.

Both with and without evil-mode TAB is bound to org-cycle. The following picture shows the binding without evil:

and with evil-mode enabled:

My Emacs is version 25.3, and I've already tried emacs -q, so it's probably not related to my setup. I'm aware I can use C-c ' to edit in another window, I'd prefer to do it in the org buffer.


texts: How to disable IDO in ‘dired-create-directory’

texts:
I have this setup:

(setq ido-everywhere t)
(ido-mode 1)

Well, of course there is more, but I believe that this is relevant portion.

Some time ago I wanted to have IDO for dired-do-copy and dired-do-rename
and someone on IRC #emacs channel told me to add this to my config:

(put 'dired-do-copy   'ido nil) ; use ido there
(put 'dired-do-rename 'ido nil) ; ^

…it worked!

Now I would like to do the opposite: I need to completely disable IDO for
dired-create-directory, because it doesn't make any sense there (but
ido-everywhere activates it there).

Of course I have some other stuff like ido-ubiquitous, and ido-hacks,
but I don't know if I should try to mess with these packages to do what I
want to do.

Q: how to disable IDO for dired-create-directory?

Attention of future readers: @Drew's answer doesn't work, although it has been upvoted by people who didn't care to try it (including me). There are better (and more general) ways to do it, see below.


texts: Can Emacs detect the path of its executable?

texts: Suppose that I have two identical emacs (of the same version) on my system. One is placed at C:\Program Files\Gnu Emacs and the other one at different place, say C:\Program Files\New Gnu Emacs. Can a running Emacs detect which one is? For example, can it give the path of its executable (i.e., the path where emacs.exe or emacs.bin can be found)?


texts: Define the window location of the output of shell command

texts: I use  M-! to run the command shell-command. The output will open the buffer in a new window at the bottom. Can I configure it to appear on the right?


texts: How to include rst or markdown in org document?

texts:
How can one include ReStructuredText or markdown snippets in org document, so that when org file is exported in corresponding format, those snippets are part of text?

Can that be done with org-mode built-in exporters? Or with pandoc?

Rationale: rst format supports grid tables (unlike org), so i want to take and use them in my document. 2-step export (first to rst or markdown, then to html or docx or odt) will get me document i need.


texts:
I am trying to replace Microsoft Word(shudder) for this specific process. The process is not specific for email or traditional Mail but similar. The process is that I have a template file with variables that I pull from a spreadsheet. I'm able to "page" through the variables. I'm trying to replicate this in emacs. After searching I have found some cases of people accomplishing this but no details as to how. Thanks.

I'm going to try to explain further as requested. I need a template document that has variables that change per page like a mail merge(https://en.wikipedia.org/wiki/Mail_merge). My use case is not to print these so that is not needed. This is actually for automating the creation of 100's of router configs. Thanks again for all the replies.

Example:

hostname hostname-variable

!

username username-variable password 0 password-variable

!

no service pad

service timestamps debug datetime msec

And so on...

In Microsoft word you reference a excel spreadsheet for the variables. But I would be fine to reference the data in other ways. CSV, table, etc.

| Hostname-variable |username-variable | password-variable |
|-------------------+------------------+-------------------|
| Hostname1         |Username1         | password1         |
| Hostname2         |Username2         | password2         |
| Hostname3         |Username3         | password3         |
|-------------------+------------------+-------------------|

"Page 1" would look like this:

hostname Hostname1

!

username Username1 password 0 password1

!

no service pad

service timestamps debug datetime msec

And so on...

"Page 2" would look like this

hostname Hostname2

!

username Username2 password 0 password2

!

no service pad

service timestamps debug datetime msec

And so on...

"Page 3" would look like this

hostname Hostname3

!

username Username3 password 0 password3

!

no service pad

service timestamps debug datetime msec

And so on...


texts: edit a file on remote server using an existing session(by clone it)

texts:
I am able to clone a session after configure the configure file under .ssh

cat .ssh/config
host *
ControlMaster auto
ControlPath ~/.ssh/master-%r@%h:%p
ServerAliveInterval 60

After I connect to the remote server once, then I don't need to input password to it when connect to it the second time using the clone session approach.

But looks like emacs couldn't clone the session. When I open a file on emacs, it still need to ask for password. Is there anything additional need to configure?

The tramp I am using is:

tramp is a built-in package.

     Status: Built-In.
    Version: 2.2.13.25.1
    Summary: Transparent Remote Access, Multiple Protocol
Other versions: 2.2.13.25.1 (builtin).

After I added the following to the .spacemacs (I am using spacemac).

  (setq tramp-debug-buffer t)
  (setq tramp-verbose 9)

In in the debug buffer I will see it has the following and hangs there.

;; GNU Emacs: 25.1.1 Tramp: 2.2.13.25.1 -*- mode: outline; -*-
16:03:10.771969 tramp-get-file-property (8) #  file-attributes-string nil
16:03:10.772297 tramp-get-connection-property (7) # stat undef
16:03:10.772372 tramp-get-remote-stat (5) # Finding a suitable ‘stat’ command
16:03:10.772442 tramp-get-connection-property (7) # remote-path undef
16:03:10.772521 tramp-get-connection-property (7) # process-name nil
16:03:10.772591 tramp-get-connection-property (7) # process-name nil
16:03:10.772655 tramp-get-connection-property (7) # process-buffer nil
16:03:10.772759 tramp-file-name-handler (5) # Non-essential received in operation (file-attributes /ssh:test-server: string)
16:03:10.773157 tramp-get-connection-property (7) # uid-string nil
16:03:10.773240 tramp-get-connection-property (7) # gid-string nil
16:03:10.773315 tramp-get-file-property (8) #  file-attributes-integer nil
16:03:10.773769 tramp-get-connection-property (7) # stat undef
16:03:10.773839 tramp-get-remote-stat (5) # Finding a suitable ‘stat’ command
16:03:10.773903 tramp-get-connection-property (7) # remote-path undef
16:03:10.773973 tramp-get-connection-property (7) # process-name nil
16:03:10.774048 tramp-get-connection-property (7) # process-name nil
16:03:10.774115 tramp-get-connection-property (7) # process-buffer nil
16:03:10.774194 tramp-file-name-handler (5) # Non-essential received in operation (file-attributes /ssh:test-server:)
16:03:10.774587 tramp-get-connection-property (7) # uid-integer nil
16:03:10.774665 tramp-get-connection-property (7) # gid-integer nil
16:03:10.774756 tramp-get-connection-property (7) # test undef
16:03:10.774820 tramp-get-test-command (5) # Finding a suitable ‘test’ command
16:03:10.774887 tramp-get-connection-property (7) # process-name nil
16:03:10.774959 tramp-get-connection-property (7) # process-name nil
16:03:10.775027 tramp-get-connection-property (7) # process-buffer nil
16:03:10.775106 tramp-file-name-handler (5) # Non-essential received in operation (file-readable-p /ssh:test-server:)
16:03:18.005921 tramp-get-file-property (8) #  file-attributes-integer nil
16:03:18.006013 tramp-get-file-property (8) #  file-attributes-string nil
16:03:18.006082 tramp-get-connection-property (7) # file-exists undef
16:03:18.006163 tramp-get-file-exists-command (5) # Finding command to check if file exists
16:03:18.006258 tramp-get-connection-property (7) # test undef
16:03:18.006321 tramp-get-test-command (5) # Finding a suitable ‘test’ command
16:03:18.006399 tramp-get-connection-property (7) # process-name nil
16:03:18.006467 tramp-get-connection-property (7) # process-name nil
16:03:18.006540 tramp-get-connection-property (7) # process-buffer nil
16:03:18.006648 tramp-file-name-handler (5) # Non-essential received in operation (file-exists-p /ssh:test-server:)


texts:
I has some sybmol, e.g. O and I want to convert it to hex value.
The result must be 4f

How I can do this in Emacs 26.1 ?


texts: How remove whitespaces in the beginning of lines?

texts:
Emacs 26.1

I has the next text:

I need to remove all whitespaces in the beginning of the lines.
Every line has different count of whitespaces.
The result must be like this:


texts: Cannot enable org-roam mode - No EmacSQL SQLite binary available (windows 10)

texts:
Cannot make org-roam work under windows 10 because I get "No EmacSQL SQLite binary available".

What I've done:

Installed org-roam using M-x install-package.
Installed emacsql-sqlite3 using M-x install-package.
I have compiled the makefile in emacsql-sqlite folder via ubuntu's bash on windows 10.

P.S. I have tried following instructions on org-roam website. It's still not working.

What should I do to fix this issue?


texts: Help wanted. paced - populated Dictionary not saved

texts:
i managed to install and configure the paced package.
My system is Emacs "GNU Emacs 26.1 (build 1, x86_64-w64-mingw32)
 of 2018-05-29" on Windows 8.1 64.
Unfortunately the paced dictionary is not saved after repopulated.
I don't know why.
Does anybody here successfully use the package?

My config:
;; paced-mode
(require 'paced)
;; Activate paced
(global-paced-mode)
;; Load paced dictionaries
(setq paced-dictionary-directory "~/.emacs.d/paced-dictionaries/")
(paced-load-all-dictionaries)
;; Save paced dictionaries after repopulating them
(setq paced-repopulate-saves-dictionary t)
;; ;; Load async paced settings
(setq paced-async-load-file "~/.emacs.d/paced-async-mein.el")
;;(load "paced-async.el")
;; Enable Default dictionary in Org, markdown, and text modes
(setq paced-global-dictionary-enable-alist '((t . "Default")))
;;(setq paced-global-dictionary-enable-alist '((my-paced-files-check-p .
"Default")))
(setq paced-throw-error-on-no-current nil)
;; Repopulate the current dictionary after saving
(add-hook 'after-save-hook 'paced-repopulate-current-dictionary-async)
(define-advice ispell-pdict-save (:after (&optional _no-query _force-save)
paced-populate)
;; Repopulate the current dictionary after running spell check
(paced-repopulate-current-dictionary-async))
;; In Org-mode capf auf M-# setzen, da TAB Sonderfunktionen besitzt.
(global-set-key (kbd "M-#") 'completion-at-point)

Generator : (lambda nil org-agenda-files
Sort Method : paced--default-dictionary-sort-fun

The exclude function from the website is not working correct, because if activated then no words are inside the dictionary.
After check a buffer the command paced-print-current-dictionary shows words.
But after save and close buffer the dictionary is empty.
Strange.

Regards
Poul


texts: How to guess what version of a package is available on Melpa?

texts: I want to check if there is an update for the org package every time my emacs daemon starts. I was looking at package.el for clues on how to check if the current version of a package was older than the version available in the package repository of GNU and Org, but I couldn't follow the code in package-menu--find-upgrades, so I'm not sure how should I get the package version of the installed package and the version of the package available for the upgrade.


texts: Batch convert local HTML webpages to plain text

texts:
Here is my zsh code

function eweb() {
    emacsclient -t --eval "(eww-open-file \"$1\")" "(save-buffer \"$2\")"
}

There are two parameters, the first is the local webpage filename, for example, ./1.html. The second parameter is the filename I want to save the text to. For example, 1.org.
This code can open the webage successfully, but it cannot pass the second parameter to save-buffer.

What's more, it cannot finish the procedure silently, which means it cannot be used to batch convert HTML to text.

How can I solve these two problems?


texts: What compilers are used during installation of a package?

texts:
When I download and install auctex, I read that

  The simplest way of installing AUCTeX is by using the Emacs package
  manager integrated in Emacs 24 and greater (ELPA).  Simply do M-x package-list-packages RET, mark the auctex package for installation with i, and hit x to execute the installation procedure.  That's
  all.

  The remainder of this section is about installing AUCTeX from a
  release tarball or from a checkout of the AUCTeX repository.
     Installing AUCTeX should be simple: merely ./configure, make,
  and make install for a standard site-wide installation (most other installations can be done by specifying a --prefix=... option).

In both ways, what compiler(s) are used?

In the first approach, the output of installation said

Compiling file /home/tim/.emacs.d/elpa/auctex-11.87.7/auctex-pkg.el at Sun Sep 28 14:29:44 2014
Entering directory `/home/tim/.emacs.d/elpa/auctex-11.87.7/'

In the second approach, I searched in the Makefile, and don't find gcc or g++.


texts:
I have somewhat recently switched from neovim to spacemacs. After switching to the develop branch, taking some time to actually read the dotfile, reading the documentation of some layers, and adding some minor tweaks to some of them, I have gotten curious about learning more about emacs and spacemacs.
I am still a confused spacemacs user. When reading the bibtex layer, for example, I am still unsure whether I should carry out the installation of the org-ref and helm-bibtex packages and how (if at all) this installation should differ for spacemacs.
Anyway, overall, what would you recommend a beginner spacemacs user to read, do, watch, or whatever, in order to get a better grasp of spacemacs? I imagine that something important might be to learn some elisp, and I've taken a peek at the references in this question. Are these also advisable for spacemacs? What would you add?


texts: project.el: override project root with dir-local var?

texts: I have a situation where (project-current) gets the project root "wrong", i.e. not what I want it to be - specifically the project is part of a larger project that project.el doesn't know about. Is there any way to override that, using perhaps a dir-local variable or some other method?