texts: mangled terminal output after failing emacsclient / folding mode launch

texts:
I consistently get the following problem on Emacs 24.5.1 with folding package (version 20140401.3) for which I've found a workaround but would like to understand what was going on.

As you can see in the screenshot above, the emacs server started OK, but when I try to launch the emacsclient it just hangs there:

… after killing emacsclient with Ctrl+C I get into a situation where nothing is echoed on my terminal as I type a command and, moreover, the command's output is mangled (line feed characters are apparently missing):

Upon further investigation I noticed that this behaviour was dependent on the type of file I was trying to open with emacsclient. Some files triggered it, some not. Further digging pointed me to a message emitted by the folding package (version 20140401.3) when I was trying to open the offending files.

The message on the mini-buffer read:

  Folding error: mode is not in `folding-mode-marks-alist'

Upon adding the single line marked as "line-A" in my .emacs the problem went away:

(use-package folding
  :ensure t
  :config
  (folding-install-hooks)
  (defun my-always-fold ()
    (setq-local folded-file t))
  (advice-add #'folding-mode-find-file :before #'my-always-fold)
  (folding-add-to-marks-list 'json-mode "foo" "foo") ;; line-A
  )

However, even without the fix, directly opening the file using emacs (not emacsclient) does not result in this behaviour. Something a lot milder happens: the file is not placed in the buffer that's currently opened. Instead I am presented with the *scratch* buffer and the file I asked to open is placed in another buffer. This is what I see when I press C-x C-b:

… so I just use C-x C-b and navigate to my buffer to bring it up. And there is no mangling at all at the terminal. This leds me to believe that the problem may also be related to emacs daemon / emacsclient.

My questions are:

was this problem related to emacsclient or folding mode ?
how is it possible for emacsclient to mangle my terminal's output even after it's killed and how could I have fixed the terminal output?
is there another way to solve this problem? I don't want to have to specify folding marks for JSON files because folding makes no sense in JSON.


texts: Can I use emacs to execute elisp files witout opening emacs?

texts:
#!/usr/bin/clisp

(write-line "Hello World")

If I put this in a script it prints Hello World as expected.
What I'm wondering is there a way to use emacs-nox instead of clisp in the shebang and have it work the same way.


texts: How can I copy+paste `org-mode` headlines only?

texts:
I have an org-mode file containing a structure like this:
*** H1
**** H2
- Foo
  Foo
**** H2
Foo

Foo

I would like to make a copy of H1 and all it's subheadings, but none of the non-headline content. I would then like to be able to paste this copy, adding the following content to the file:
*** H1
**** H2
**** H2

Currently the way I do this is to collapse H1 using yy (I use evil-mode), move to the appropriate place, with p, and then manually delete all the non-headline content.
How can I copy+paste org-mode headlines only?


texts: What are the use cases of alternative package managers vis-à-vis `package.el`?

texts:
Background

I use emacs daily, but mostly to get things done. I don't really like
customising it more than adding packages and I don't like
troubleshooting. I want emacs to fade into the background the way a
good OS does and just get on with things. A while ago I found that
el-get allowed me to install the packages that I needed which were
unavailable with package.el and also gave me more control such as
selecting the maint branch of Org-mode rather than the bleeding edge
which can cause temporary problems. Now I'm not sure if I should be
using el-get or not.

Question

el-get seemed to be a great solution to the various repositories and
emacs hacks out there. It offered capabilities which were simply not
possible with package.el. Now that package.el in newer versions of
emacs (>=24.4) supports multiple repositories, what are the use cases for el-get and similar alternatives to emacs's built-in package manager?


texts: How do I match a closing bracket in Emacs lisp

texts: I would think this was really simple. I am trying to match closing delimiters in Emacs Lisp regex. I can match {}()[ no problem, but I cannot match ]. I have been using re-builder and have tried "[\\}\\)\\]]", "[\\}\\)]]", "[\\}\\)\\\]]", "[\\}\\)\\\\]]"and it still won't match the closing square bracket. The brace and the parenthesis match just fine. What am I doing wrong?


texts:
If I try to jump (using "j") in org-agenda to the month September, it sometimes takes me to January. I am using org 9.4.4. If I type any of these configurations, I am still going to January:
sept
septe
septem
septemb
septembe

If I type:
Sep
sep
September
september

I go to September. Is this a bug?


texts:
I am trying to login to my google account via eww, but eww just hangs with the following message:

  Loading https://accounts.google.com/signin/challenge/sl/password...

I have multifactor authentication setup for Google, and am not sure if eww supports this.

I have verified that I can connect https protocol by visiting https://example.com.

Is this a bug in eww or is there something that I am missing.


texts: Understanding why lsp-scala is not giving completions

texts:
I have installed lsp-mode, lip-scala, lsp-ui, company-lsp and many other packages.   When entering scala code, I often get popups to complete the method/class/variable name, which also add the relevant imports if needed.

However, this does not always happen.  I am new to lip-mode, so I am not sure how to debug what is going wrong.  What are useful commands/settings to figure out what is going wrong when it is not working?

I have configured it with

;; lsp configuration
(use-package lsp-scala
  :after scala-mode
  :demand t
  ;; Optional - enable lsp-scala automatically in scala files
  :hook (scala-mode . lsp))

There are lots of messages in *lsp-log* but none of them indicate any obvious to me.


texts: How to run blocks/cells of python code in emacs?

texts:
https://i.stack.imgur.com/TIxlR.png

The picture shows what I mean by "block" - I mean a cell of code that is delimited by some sequence of characters, in this case '#%%', that can be executed by the python/IPython console when the user types some keybinding while the cursor is in that cell.

It's very useful for interactive/explorative work because you can break your code up into logical chunks where each part can be worked on iteratively without running the entire script each time.

So if one part of my code ingests a large data frame and another part analyzes it, I can put each part in different cells so that while I'm playing around with how to best interpret the data I don't have to keep reloading the data frame on each iteration.

If emacs can do this kind of block/cell execution, I will wholly devote myself to its religion. Right now I know of a few possible ways in vim, but suffice it to say they are all terrible.


texts: Preview all LaTeX fragments in org mode?

texts: How can I call org-toggle-latex-fragment on all LaTeX fragments in an Org mode doc? I'm coming from Vim, so my instinct is to put something in the init.el that loops through the document and looks for $ and \[ to call org-toggle-latex-fragment on if the file extension is .org. How can I implement this, and is this generally a good approach?


texts: Possible to supress the: "Blocking call to accept-process-output with quit inhibited!!" message?

texts:
When running a process from a timer, this message is printed a lot.

Is there a way to suppress the message entirely?

For reference see: https://emacs.stackexchange.com/a/50681/2418


texts: Executing shell code block on org-mode in Windows 10

texts:
I'm trying to execute the following in Windows 10 on org-mode.
#+BEGIN_SRC shell :results raw
whoami
#+END_SRC

I expect output to be something like
laptop-m1sdlteu\logan

But I get this instead
#+RESULTS:
Microsoft Windows [Version 10.0.18362.657]
(c) 2019 Microsoft Corporation. All rights reserved.

c:\org-files>More?

To make this work I added 'shell' to org-babel-load-languages.
Thanks.


texts: How do you enter unicode characters in Spacemacs?

texts: I am currently using the normal Evil keybindings (defaults). How do I enter unicode characters such as U+21d2 ⇒ ? In routine applications such as Gedit or Firefox, we can use Ctrl+Shift+U 2 1 d 2 or in Vim, we can use Ctrl+V u 2 1 d 2. What is the equivalent in Spacemacs? I've tried Ctrl+V u 2 1 d 2 as well as Ctrl+V 2 1 d 2. The first one just doesn't work whereas the second one stops after two letters.


texts: How do you avoid pollution of Emacs namespace with "private" variables?

texts:
Probably it is misunderstanding of Elisp execution model by I think some variables are only pollute runtime.
For example let's consider read-string argument HISTORY. Probably user don't need to know about such mode specific variable, especially if there is no intention to share it with other modes...
I usually do:
(defvar my-mode-X-history nil "DOCS X")
(defvar my-mode-Y-history nil "DOCS Y")

By pollution I mean that describe-variable will show them if I enter prefix my-mode-.
Should I use some fancy prefix (like two dash my-mode--Y-history)? Is there magic lexical-binding erasing symbol name but keeping "slot" referenced in function bodies?


texts: How to define a bundle of variable-and-function pairs?

texts:
I want to define a bundle of variable-and-function pairs, e.g.: vl/path-doc points to my often used path, and vl/open-path-doc is used for open it in dired-mode.

I tried this piece of code:

(setq vivo-work-directory "~/Workspace/vivo/")

(defvar vl/paths
  '((aktualoj . "doc/aktualoj/")
    (doc . "doc/")
    (analysis . "analysis/")
    (lernejo . "lernejo/")
    (utils . "utils/")
    (topics . "vivo/topics/")
    (projects . "vivo/projects/")))

(defun vl/create-path-funcs (p-list)
  (mapc
   (lambda (x)
     (let* ((s (car x))
            (p (concat vivo-work-directory (cdr x)))
            (sym-p (make-symbol (concat "vl/path-" (symbol-name s))))
            (sym-f (make-symbol (concat "vl/open-path-" (symbol-name s)))))
       (progn
         (set sym-p p)
         (set sym-f (lambda () (interactive) (dired p))))
       ))
   p-list))

(vl/create-path-funcs vl/paths)

Then, I hope I can use M-x to invoke vl/path-doc, vl/open-path-doc, etc. But I failed.

Of course, I can define these pairs one by one. But if it's OK, I can change my vl/paths without re-defining anything else. So, if possible, how to define the pairs of variable-and-function based on a list?


texts: How can I see diff for specific changeset?

texts:
I want an analog of git show $REV / hg diff -c $REV /  svn diff -c $REV in Emacs when I know $REV.

Currently I open full history via C-x v L and search for specific revision and then type d or l ((


texts:
Instead of

|   | some value         |
|-- +--------------------|
| a | aaaaaaaa           |
|---+--------------------|
| b | bbbbbbb bbbbbbbbb  |
|---+--------------------|

I want

|   | some value         |
|-- +--------------------|
| a | aaaaaaaa           |
|---+--------------------|
| b | bbbbbbb            |
|   | bbbbbbbbb          |
|---+--------------------|

because sometimes the table is too long to display and I have to use scroll commands or bol/eol to view the table. Also I have no idea about how to get it nicely export to LaTeX. Thanks in advance!


texts: Where is `org-crypt` ? Need to install it with `use-package`

texts:
I am trying to use org-crypt but cannot find where exactly is this package hosted.

I have:

(require 'package)
    (add-to-list 'package-archives '("melpa" .   "http://melpa.milkbox.net/packages/") t)
    (add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t))

And then trying to use use-package:

(use-package org-crypt
:ensure t
:config
(org-crypt-use-before-save-magic)
(setq org-tags-exclude-from-inheritance (quote ("crypt")))
(setq org-crypt-key nil)
)

But this results in package 'org-crypt-' unavailable.
I cant find it in the package list too when I check with list-packages.


texts: `^ is giving \uparrow instead of \hat in AUCTeX with CDLaTeX

texts: I am very new to Emacs using AUCTeX + the minor mode CDLaTeX to type math documents. According to what I read in Auctex reference card the keybinding `^ should give me \hat but this is giving \uparrow instead, please help me to understand. Also please tell me how to get \hat{.} (. represents the cursor).


texts: Make helm-find-files work with `\input{file}` in latex files

texts:
If the cursor is on file of a line \input{file} in a latex file, helm-find-files doesn't recognize that I want to open file.tex, however calling ffap does. If I write \input{file.tex} it also works with helm.

So how can I make helm to recognize this case (same with \include).


texts: How to abbreviate version control information in the mode line?

texts:
Q: how can I abbreviate the version control information in the mode line?

Buffers visiting a file under version control display branch information in the mode line as VCtype-branch.  That's fine, but my mode line is already quite cluttered, so I'd like to abbreviate that information if possible.  I can always use short branch names, but I'm wondering if I can at least shorten the VCtype information (eg, Git-mybranch => G-mybranch).  How would I do this?

PS My understanding (which could be wrong) is that diminish would not be relevant in this situation.


texts: Replace selected text on [shift insert] is broken in emacs 25.1

texts:
I updated to 25.1 and found that copy/paste works differently.

For example when I select a word "visit" and try to replace this word with [shift insert], text in clipboard is inserted in the beginning of the selection, instead of replacing it.

When I select visit and type text, visit is replaced as expected.

I have enabled delete selection and transient mark modes, it worked well in 24.5.

Do you know how to fix it?


texts: vimish-fold fold overlay highlight colour

texts: Is there a way to change vimish-fold's fold highlight colour? I tried customize-group but didn't see an option to change it.


texts: How to auto-complete links to headlines in org-mode?

texts:
Given an example.org file having two headlines, I would like to
auto-complete links to 1headlines.

However hitting M-\ on [[* suggests *bold* words but not headlines.

Any ideas what I'm 2missing?

* Foo
Some *boldWord*
* Bar
Here I type [[*Fo followed by M-\ in order
to see *Foo suggested for autocompletion, though only *boldWord* is suggested.

Messages buffer returns:

M-\ runs hippie expand

M-\ on [[* runs Using try-expand-dabbrev-all-buffers

TAB runs org-cycle

Footnotes

1 https://orgmode.org/manual/Completion.html

2 https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Bcompletion/auto-completion#auto-complete


texts: "File error: Cannot open load file, No such file or directory, core-spacemacs" in aquamacs

texts:
I do not encounter this error in emacs

Aquamacs version 3.3, which is based on EMacs 25.1

Emacs on the other hand, is 25.2 (9.0)

How can I make spacmacs works with Aquamacs?


texts: `auth-source-search` cannot deal with multiple consecutive searches

texts:
I am a heavy user of https://github.com/yuya373/emacs-slack, and I noticed a weird behavior of auth-source-search: If I call this function multiple times, querying the second info always returns nil.
This is my slack configuration:
(let ((auth1 (car (auth-source-search :host "team1.slack.com")))
      (auth2 (car (auth-source-search :host "team2.slack.com"))))
  (slack-register-team
   :name "Team 1"
   :user "some_email1@example1.com"
   :token (funcall (plist-get auth1 :secret)))
  (slack-register-team
   :name "Team 2"
   :user "some_email2@example2.com"
   :token (funcall (plist-get auth2 :secret)))

And the second call to auth-source-search fails, making auth2 nil. So, Emacs cannot evaluate the expression (funcall (plist-get auth2 :secret)) since (plist-get auth2 :secret) is nil.
I am certain that auth-source-search is somehow broken, and have found a prior question to this: `auth-source-search` returns nil for valid queries . A comment to this question suggested to add :port keyword argument to auth-source-search, but in this case I cannot because the Slack auth info does not contain any port fields.
How can I solve this issue?
Edit: My .authinfo looks roughly like this:
host team1.slack.com user some_email1@example1.com password ...
machine imap.gmail.com login ... port ... password ...
machine smtp.gmail.com login ... port ... password ...
host team2.slack.com user some_email2@example2.com password ...

That is, the entry of team1.slack.com comes before that of team2.slack.com.
My Emacs is of version 27.1, configured with Spacemacs at the develop branch's latest commit.


texts:
I use Ben Whitmore's excellent http://benwhitmore.altervista.org/coelacanth-type-family/Coelacanth font in org-mode. The font family is provided in several OTF files.
Setting
xfthb:-PfEd-Coelacanth-light-normal-normal-*-22-*-*-*-*-0-iso10646-1
as variable-pitch works well and looks good.
But I'm unable to set the italic face to Coelacanth's Italic. I tried the Customize Face dialogue, I tried Lisp expressions with variations of the xfthb string above, with one or more normals substituted with italic, but the result looks like (and is, by C-u C-x =) the uninitializied version.


texts: I'm behind a firewall. What domains should I whitelist to be able to download packages from melpa? The JavaScript really obfuscates it.


texts: Spacemacs: Cannot open load file: git-gutter+

texts:
I'm trying install spacemacs on elementary OS,

emacs --version: GNU Emacs 24.3.1

emacs --daemon
(Spacemacs) --> refreshing package archive: marmalade... [1/4]
Contacting host: marmalade-repo.org:443
Contacting host: marmalade-repo.org:443
Saving file /home/mateuspv/.emacs.d/elpa/archives/marmalade/archive-contents...
Loading vc-git...
Loading vc-git...done
Wrote /home/mateuspv/.emacs.d/elpa/archives/marmalade/archive-contents
(Spacemacs) --> refreshing package archive: melpa... [2/4]
Contacting host: melpa.org:443
Contacting host: melpa.org:443
Saving file /home/mateuspv/.emacs.d/elpa/archives/melpa/archive-contents...
Wrote /home/mateuspv/.emacs.d/elpa/archives/melpa/archive-contents
(Spacemacs) --> refreshing package archive: org... [3/4]
Contacting host: orgmode.org:80
Contacting host: orgmode.org:80
Saving file /home/mateuspv/.emacs.d/elpa/archives/org/archive-contents...
Wrote /home/mateuspv/.emacs.d/elpa/archives/org/archive-contents
(Spacemacs) --> refreshing package archive: gnu... [4/4]
Contacting host: elpa.gnu.org:443
Saving file /home/mateuspv/.emacs.d/elpa/archives/gnu/archive-contents...
Wrote /home/mateuspv/.emacs.d/elpa/archives/gnu/archive-contents
(Spacemacs) --> installing package: git-gutter+@version-control... [1/3]
(Spacemacs) --> installing package: git-gutter-fringe+@version-control... [2/3]
(Spacemacs) --> installing package: helm-flx@spacemacs-base... [3/3]
Error (use-package): git-gutter+ :**init: Cannot open load file: git-gutter+**
Truncate long lines enabled

How can I fix that?


texts: How to add symbols to prettify and pretty modes?

texts:
I am trying to configure Emacs with ProofGeneral (the Coq IDE) to display mathematical symbols in place of the abbreviations ->, =>, forall and exists.

My current .emacs script is as follows:

;; Open .v files with Proof General's Coq mode

(load "~/.emacs.d/lisp/PG/generic/proof-site")

;; Load pretty-mode script

(load "~/.emacs.d/lisp/pretty-mode")

;; Coq symbols

(add-hook 'coq-mode-hook
      (lambda ()
        (mapc (lambda (pair) (push pair prettify-symbols-alist))
            '(("forall". x2200)
              ("->". x2190)
              ("exists". x2203)
              ("=>". x21D2)))))

following examples found here and here.

When I enter coq-mode and enable either or both of global-pretty-mode and global-prettify-symbols-mode, I see no change. I only manage to get a Greek lambda in lisp-mode and python-mode.

Any help would be much appreciated!


texts: After-advice for disabling evil-mode in ansi-term has no effect

texts:
I'm using evil-mode and trying to make sure that it gets disabled after invoking an ansi-term.

I've tried using before and after advice to advise the ansi-term function, as well as adding a hook to term-mode, but that doesn't seem to disable evil mode in the ansi-term buffer.

I ended up defining a separate interactive function that calls ansi-term with a fixed argument and then disables evil-mode for just the current buffer.

(defun ansi-term-disable-evil ()
  "interactively call ansi-term"
  (interactive)
  (ansi-term "/bin/tcsh") ; probably shouldn't be hardcoded
  (evil-local-mode -1))

This function has the desired effect (disabling evil-mode in the ansi-term buffer).

Using after advice, however, does not work and I'm trying to understand why.

Here is what I I tried in an attempt to disable evil-mode locally after executing ansi-term.

(defun ansi-term-post ()
  "configuration settings for ansi-term"
  (evil-local-mode -1))

(advice-add 'ansi-term :after 'ansi-term-post) ; I used an ordinary symbol here, not a function object with #'

However, this didn't actually disable evil-mode in the ansi-term buffer. I'm trying to understand why.


texts: How to configure new frame font using custom-set-faces?

texts:
I'd like to use a fractional font size throughout Emacs.  I have been able to set my default font size on launch using custom-set-faces:

(custom-set-faces
 '(default ((t (:inherit nil :stipple nil :background "#212121"
    :foreground "#e8e8d3" :inverse-video nil :box nil
    :strike-through nil :overline nil :underline nil :slant normal
    :weight normal :height 185 :width normal :foundry "nil" :family "Menlo")))))

The above configuration works fine on launch after Emacs finally settles on its default frame size.

However, when I create a new frame, this font is not utilized.  I understand that I can use default-frame-alist to configure the new frame font, but default-frame-alist uses entirely different configuration data which does not seem to support fractional sizes:

(setq default-frame-alist
        '((width . 142)
          (height . 54)
          (font . "-*-Menlo-normal-normal-normal-*-18.5-185-*-*-m-0-iso10646-1")))

The above configuration does not work as expected -- the fractional portion is ignored and I simply receive a frame with an 18 point font.


texts: How to disable Emacs asking if user wants to save abbrevs defined with :system property in a major mode

texts:
My Emacs version is 27.1
I am developing a major mode and I want to include some abbrevs to ship with it. I noticed that Emacs asks if user wants to save the abbrevs even if abbrevs have property :system t.
Here is the sample code:
(defun abbrev-test-generate-abbrevs ()

  (define-abbrev
    abbrev-test-mode-abbrev-table
    "test1"
    "test1\ntest1\ndone"
    nil
    :system t))

(define-derived-mode abbrev-test-mode prog-mode "TEST ABBR"
  ""

  (clear-abbrev-table abbrev-test-mode-abbrev-table)
  (abbrev-test-generate-abbrevs))

(provide 'abbrev-test-mode)

Listing abbrevs after M-x abbrev-test-mode correctly notes that "test1" is a system abbrev:
(abbrev-test-mode-abbrev-table)

"test1" (sys)       0 "test1
test1
done"

Yet Emacs asks if I want to save abbrevs when I exit.
The Elisp reference in Emacs, as well as here specify that abbrevs with :system property non-nil are not saved. Is that a bug or is the documentation wrong? Or do I misunderstand?
I do not want to pester the users with save prompts for abbrevs that are part of the mode, unless they define their own abbrevs. Is that possible? If not, is there a more bare-bones snippeting functionality that I can use to write my own snippeting functions?
Using yasnippet is overkill for what I want to do. I just need the simplest possible snippet expansion and abbrev functionality is perfect for me, except this saving prompts.


texts: Close latex compilation window when successful

texts: I like having TeX-show-compilation in LaTeX for large documents. However, if the compilation completed successfully, I would like the windows to be reverted or the compilation buffer to be killed. I have tried following the suggestions given in: hide *compilation* window without any luck.


texts:
What is the value of #$ when loading a file?

package.el generates files like:

;;; anzu-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path
    (directory-file-name (or (file-name-directory #$)
                             (car load-path))))

Context: I'm trying to profile files loaded by intercepting calls to load. https://github.com/jschaf/esup/issues/53


texts:
How does one run the arbitrary command to execute the tangled code? I use Emacs both on Windows and Linux, but currently I need to run the generated batch file in particular Windows environment.
Here is how the block looks like:

#+begin_src bat :exports both :tangle "run_tests.bat"
...
#+end_src

I have a batch file which sets the environment (d:\Programs\Microsoft Visual Studio 12.0\VC\vcvarsall.bat), but cannot run my tangled file inside this new environment. How to do this?

The code can be tangled using org-babel-tangle of course, but I cannot run the generated batch file from Emacs using org-ctrl-c-ctrl-c as it says:

org-babel-execute-src-block: No org-babel-execute function for bat!

Any help would be appreciated.


texts:
I am unable to set the contexts right in mu4e. I have a default account set with:

(setq mu4e-sent-folder   "/Account1/Sent Items"
      mu4e-drafts-folder "/Account1/Drafts"
      mu4e-trash-folder  "/Account1/Deleted Items"
      user-mail-address "me@domain.com"
      ;; ...
)

I set the other accounts from the manual on accounts:
(defvar my-mu4e-account-alist
  '(
    ("Account1"
     (mu4e-sent-folder "/Account1/Sent Items")
     (mu4e-drafts-folder "/Account1/Drafts")
     (mu4e-trash-folder "/Account1/Deleted Items")
     (user-mail-address "me@domain.com")
     ;; ...
     )
    ("Account2"
     (mu4e-sent-folder "/Account2/Sent Items")
     (mu4e-drafts-folder "/Account2/Drafts")
     (mu4e-trash-folder "/Account2/Deleted Items")
     (user-mail-address "me@domain2.com")
     ;; ...
     )
    ))

I also set contexts from the contexts part of the manual:
(setq mu4e-contexts
 `( ,(make-mu4e-context
     :name "Account1"
     :match-func (lambda (msg) (when msg
       (string-prefix-p "/Account1" (mu4e-message-field msg :maildir))))
     :vars '(
       (mu4e-trash-folder . "/Account1/Deleted Items")
       (mu4e-refile-folder . "/Account1/Deleted Items")
       ))
   ,(make-mu4e-context
     :name "Account2"
     :match-func (lambda (msg) (when msg
       (string-prefix-p "/Account2" (mu4e-message-field msg :maildir))))
     :vars '(
       (mu4e-trash-folder . "/Account2/Deleted Items")
       (mu4e-refile-folder . "/Account2/Deleted Items")
       ))
))

And I skip asking about a context:
(setq mu4e-compose-context-policy nil)

I go to the mu4e page with M-x mu4e and switch context to Account2, so I see [Account2] above the mini-buffer. When I start a new message with C-x m, it uses the email address from Account1 and is saved to /Account1/Drafts, even though [Account2] is still showing above the mini-buffer.
One workaround is this function from the multiple accounts part of the manual:
;; Ask the right question about contexts.
(defun my-mu4e-set-account ()
  "Set the account for composing a message.
   This function is taken from:
     https://www.djcbsoftware.nl/code/mu/mu4e/Multiple-accounts.html"
  (let* ((account
    (if mu4e-compose-parent-message
        (let ((maildir (mu4e-message-field mu4e-compose-parent-message :maildir)))
          (string-match "/\\(.*?\\)/" maildir)
          (match-string 1 maildir))
      (completing-read (format "Compose with account: (%s) "
                               (mapconcat #'(lambda (var) (car var))
                                          my-mu4e-account-alist "/"))
                       (mapcar #'(lambda (var) (car var)) my-mu4e-account-alist)
                       nil t nil nil (caar my-mu4e-account-alist))))
         (account-vars (cdr (assoc account my-mu4e-account-alist))))
    (if account-vars
        (mapc #'(lambda (var)
                  (set (car var) (cadr var)))
              account-vars)
      (error "No email account found"))))
(add-hook 'mu4e-compose-pre-hook 'my-mu4e-set-account)

This works and selects the right context (email address, SMTP server, folders, etc), however I am unable to draft emails programmatically because (mu4e-context-switch t "Account2") has no effect (see How to draft email programmatically?).
What is wrong with my mu4e setup that switching contexts with ; has no effect?
Update: After the comment on this Github issue, I confirm that I get the same results after setting (setq mail-user-agent 'mu4e-user-agent) and that I don't use user-email-address. I do use user-mail-address as in the code above.
I am using mu4e-mu-version 1.4.10, Emacs 26.3 (9.0), and macOS 10.14.6.


texts:
I'm using spacemacs and I've added the following user config:

(defun dotspacemacs/user-config ()
  "Configuration function for user code.
This function is called at the very end of Spacemacs initialization after
layers configuration.
This is the place where most of your configurations should be done. Unless it is
explicitly specified that a variable should be set before a package is loaded,
you should place your code here."
  (global-set-key (kbd "s-right") 'end-of-line)
  (spacemacs/set-leader-keys "fd" 'ac-php-find-symbol-at-point)   ;goto define
  )

However, s-right doesn't seem to do what I want. What I want is when I press CMD + arrow-right it should jump to the end of the line.


texts:
I am using go programming

I have structs like this:

type person struct {
   firstname string
   lastname string
   age int
   address string

}

I want it to be aligned like this

type person struct {
   firstname string
   lastname  string
   age       int
   address   string

}

and stuff like

const (
    constant1 int = 1
    c2 int = 2
    const3 int = 3
)

to

const (
    constant1   int = 1
    c2          int = 2
    const3      int = 3
)

I know align-regexp should help here, but i am unable to figure it out.


texts: How do I debug `Package cl is deprecated`?

texts:
While compiling an Elisp package from github, I get the

  Warning: Package cl is deprecated

How do I find out what triggers it?

The specific file that triggers this is tiny and has no CL code.

I think there should be a way to turn the warning into an error and get the stack trace.
Has anyone done this before?


texts: Font face (highlighting) of single-quoted strings stopped working after update

texts:
I'm using a custom mode that I believe is based on cc-mode, and it's been working great for years. Recently, I upgraded to Ubuntu 20.04, which brought Emacs to 26.3 (I forget what it was before, maybe 25.2.2), and now, my single-quoted strings are not being highlighted correctly anymore (while double-quoted strings are working fine):

How can I fix this?


texts: How to use projectile-replace only for specific wildcard such as Python?

texts:
From this answer, I am using projectile-replace to replace words within a folder. It works fine but it covers all the buffers.
I was able to accomplish it it using find-dired:
(defun my-find-files ()
  (interactive)
  (find-dired "~/project" "-name \\*.py))

=> How can I apply projectile-replace only for Python files?


texts: org-mode doesn't display image when LaTeX Image Attributes are included

texts:
I'm facing this problem that when I include some LaTeX specific attributes for my image, then the image doesn't display inside org-mode (although it is displayed fine in my exported LaTeX PDF).

For example, if I include an image like this, the image stop showing inside org-mode:

#+ATTR_LATEX: :width 7cm
[[img/img2.png]]

However if I remove that LaTeX attribute, then it is displaying fine inside org-mode.


texts: How to make evil keymaps inherit from other evil keymaps?

texts: I changed the i key binding in evil-normal-state-map to go up and k to go down (these are just two examples). But evil-operator-state-map and evil-visual-state-map do not change accordingly, but keep the old key bindings (i.e. hijk). Even making new keymap and assign key bindings, it still uses the old one.


texts:
Is there a way to do the following rebase in Magit?

git rebase --onto master next topic

Thank you


texts: How to make helm follow and show files as I type?

texts: My Emacs used to have the ability to display the help buffer of each function everytime I was scrolling through M-x function candidates. How to enable it again? Thanks!


texts: Postscript printing: Removing the information box at the top of buffer

texts:
When printing a buffer (for example with the Printing package), I understand Emacs coverts it into a Postscript file and then prints this file. But this Postscript file always contains a grey box at the top, displaying information about the buffer (name of the buffer, path, date, number of pages), which prefaces the actual buffer I want to print. After some research I haven't got any idea how to remove this box.

In other words, I would like the content of my buffer, and only that, to be sent to the printer.


texts: I wondered if it is possible to make emacs replace occurences of a/b with  $ {a \over b} $ , where a and b are integers or letters in the text.


texts: Can't use soap-client. Package cl is deprecated

texts:
Emacs 26.3
CentOS 7.0
Install packages soap-client 3.2.0 and cl-lib 0.6
https://github.com/alex-hhh/emacs-soap-client
https://elpa.gnu.org/packages/cl-lib.html
In my init.el I add
   (require 'soap-client)

But after restart Emacs I get error:
Warning (package): Unnecessary call to ‘package-initialize’ in init file
Package cl is deprecated


texts: Frame centric (tmux like) emacs workflow

texts:
I really like the tmux workflow where one could split a window into multiple planes and then create a second window which could be also split multiple times, so one could have a window where some monitoring services are running and another where he edits configuration files. In tmux parlance windows are in a way workspaces between which you could navigate and planes are arbitrary splits of these workspaces.

I would like to be able to imitate the tmux way in emacs i.e. make windows local to a certain entity (let's call it a workspace) and be able to  split an emacs frame into multiple windows in one workspace then open the second workspace and be able to split it arbitrarily again, so if I am editing a very big file and a smaller one I could occupy a workspace with windows containing relevant code of the big file  and then without destroying all the windows jump to edit the smaller one, and then back again, is this possible ?


texts:
I'm trying to get ansi colors from my bash process, but I can't get this to work.

(setq shell-process-name "shell-process-name")
(setq shell-process-buffer "*shell-process-buffer*")

(defun open-shell-process ()
  (let ((buf shell-process-buffer)
        (coding-system-for-read 'binary)
        (default-directory "~/"))
    (start-process shell-process-name
                   buf
                   "/bin/bash")
    (let ((proc (get-buffer-process buf)))
      (set-process-filter proc 'shell-process-filter)
      (accept-process-output proc 0.1))
    (with-current-buffer buf
      (erase-buffer))))

(defun shell-process-filter (proc output)
  (let ((buf (process-buffer proc)))
    (with-current-buffer buf
      (goto-char (point-max))
      (insert (ansi-color-apply output)))))

Do I need to change process-environment or what am I missing here ?


texts: Display all the months from M-x calendar

texts:
M-x calendar would display a three-month calendar and C-u M-x calendar could select the center of the three month.

How could display an arbitrary numbers of months, for instance view all the month in 2019 as bash command:

ncal -M 2019


texts: How can I change the title for the export of a heading in org mode?

texts:
I am creating a document by exporting a specific heading via C-c C-e C-s. I want to specify a title for that exported doc (which is not the text of the heading). I also want to be able to export a parent heading or the whole doc, and in that case I just want the heading to be what it would be without setting a title.

Can I do this somehow, perhaps by setting a particular property?


texts:
I am using the ample theme and I quite like it, but I can't see the mouser pointer when moving over emacs and emacs is activated; as the emacs background and the mouse pointer are black, I would like to have the mouse pointer in e.g. red.

How can I change the colour of the mouse pointer?

GNU Emacs 24.4.1 (x86_64-apple-darwin14.0.0, Carbon Version 157 AppKit 1343.14) of 2014-10-27 on Rainers-MBP-4

OS X Yosemite


texts: How to get the display dimensions of the display emacs is in?

texts:
I tried querying the display width using:
(display-pixel-width)

however this reports the pixel width of my external monitor instead of the laptop's display, where emacs is.
Is there a way to show the information of the display where emacs currently is?
Edit: for the time being I'm using frame-monitor-attributes as follows:
(nth 3 (assq 'geometry (frame-monitor-attributes)))

This reports the display width of the monitor emacs is in, instead of always showing the width of the external monitor.


texts: elisp - detect line change event to trigger function

texts:
I want to detect line change event (arrow-,arrow- or mouse click) to trigger my function call.

Below example handled arrow- arrow- but can not handle mouse click or C-n C-p line change event.

(defun myup(n)
  (interactive "p")
  (previous-line)
  (showme))

(defun mynext(n)
  (interactive "p")
  (next-line)
  (showme))

(defun showme()
  (let ((line (thing-at-point 'line t)))
    (when (string-match  "\\[\\([0-9a-f]+\\)\\]" line)
      (setq sha1 (match-string 1 line))
      (setq bufname "differ")
      (when (= (length (window-list)) 1)
        (split-window-vertically (floor (* 0.2 (window-height))))
        )
      (setq buffer (get-buffer-create bufname))
      (switch-to-buffer-other-window buffer)
      (erase-buffer)
      (insert sha1)
      (goto-char (point-min))
      (other-window 1))))

(define-key diff-mode-map  (kbd "<down>") 'mynext)
(define-key diff-mode-map  (kbd "<up>") 'myup)

What's right way to handle this case?


texts:
I know basics of Common Lisp. I've learned it using Emacs + SLIME, and I must say that without these two I wouldn't learn too much - using bare REPL is tough job. However, SLIME makes a great job at turning REPL into great environment for interactive programming.

This said, I'd like to learn Scheme with SICP book - it's always good to learn something new, and the book has good reviews. However, I wouldn't like to go back to bare REPL from Scheme - that's why I'd like to ask if there's some way to connect MIT Scheme with Emacs+SLIME, or something similar to turn it into something a bit more programmer-friendly.


texts: Show all Org mode entries that contain a link to the current entry

texts:
It's basically "What links here?".

Using Org mode links, I'd like to be able to get the list of headings which contain a link to a specific heading.

Example file:

* Target
  :PROPERTIES:
  :ID: 509039F8-5B43-4C9B-8FA3-F37E3A2EEC10
  :END:

* Heading containing link

  id:509039F8-5B43-4C9B-8FA3-F37E3A2EEC10

* Another heading containing the same link

  id:509039F8-5B43-4C9B-8FA3-F37E3A2EEC10

When the cursor is at Target, I'd like to get the list of all headings that link to it:

* Heading containing link
* Another heading containing the same link


texts:
I'm looking for something similar to Eldoc mode (hover over a function and the parameter list appears in the minibuffer), only I'd like to have a help buffer appear, as if I had just run describe-function.  Is there a minor mode that will do this?

Having the help buffer be in a separate frame would be ideal, but I can figure that out at a later point.  Funnily enough, I think I saw something like this for SLIME, but I haven't been able to find it again.


texts: TCL is adding different tab widths in the program

texts:
I am trying to rearrange the columns of below file

input.txt,

Contents of this file:

Name      Location      Purpose
---------------------------------------------
Andy      US            Business1
bob       UK            Business2

output_obtained

Name      Purpose       Location
---------------------------------------------
Andy      Business1     US
bob                     Business2     UK

Expected_output

Name      Purpose       Location
---------------------------------------------
Andy      Business1     US
bob       Business2     UK

TCL file:

set fh [open input.txt r]
set fp [open output.txt w]
while {[gets $fh line]>=0} {
if {[regexp "^-" $line]} {
puts $fp $lin
} else {
puts $fp "[lindex $line 0]\t[lindex $line 2]\t[lindex $line 1]"
}
}
close $fh
close $fp

I cannot understand why the tab is interpreted differently on the last row


texts: Buffer-local input history for read-from-minibuffer

texts:
I've been trying to create a command that, when run, calls another function (my-function) which reads from the minibuffer and does some processing on the input. I want the command history for this command (my-command) to be buffer-local, so that each buffer will have a separate input history.

The input history is supposed to be stored in variable my-hist. Here's a summarized version of my code:

;; -*- lexical-binding: t; -*-

(defun my-function (hist)
  (read-from-minibuffer "> " nil nil nil 'hist))

(defvar my-hist nil)
(make-variable-buffer-local 'my-hist)

(defun my-command ()
  (interactive)
  (add-to-history 'my-hist (my-function 'my-hist)))

I've found that after executing my-command from two different buffers, their input history is shared, for some reason. Using M-p and M-n I can go back and forwards through all the inputs I've entered from any of the two buffers. However, if I inspect my-hist using M-:, the input history appears to be correct for each buffer.

Could this be related to how read-from-minibuffer looks up the value pointed at by symbol 'hist?


texts:
I am using tabbar and some settings for smooth scrolling which seem to conflict with each other in a weird way. Here is a minimal init.el file:

(package-initialize)
(setq mouse-wheel-scroll-amount '(1 ((shift) . 10) ((control) . 30)))
(require 'tabbar)
(tabbar-mode t)
(setq mouse-wheel-progressive-speed nil)

With these settings, if I now try to scroll a moderate length (600 long lines) tex file in the AucTeX mode, it jumps back, i.e. if I scroll, say, up, and look at the percentage bar, it goes 70,69,68,67, and then jumps back to 70,69,68,67,... If I move the point somewhere else and start scrolling again then it scrolls ok for a while but then again starts cycling around. Disabling tabbar mode makes the issue disappear. Is there maybe a setting that could prevent tabbar from affecting this scrolling behavior in such an annoying way?

I'm on OS X 10.12.5, Emacs 25.2, and the issue appears the same way if I use mouse or touchpad.

UPD. thanks to @lawlist's comment, it suffices to open the tex file and just set header-line-format to a non-nil value. The updated minimal init.el file now is

(setq mouse-wheel-scroll-amount '(1 ((shift) . 10) ((control) . 30)))
(setq mouse-wheel-progressive-speed nil)


texts: Trace calls to a function with the parameters

texts:
I need to track the calls to org-tags-view to discover the params passed to it.
I tried an advice:

(defun his-tracing-function (orig-fun &rest args)
  (message "org-tags-view called with args %S" args)
  (let ((res (apply orig-fun args)))
    (message "org-tags-view returned %S" res)
    res))

(advice-add 'org-tags-view :around #'his-tracing-function)

But the return was display-buffer called with args (nil). How can I discover what params was passed for this function?


texts:
Windows 10, Emacs 26.1, Icicles,

In scratch buffer I search text "buffer" by command "I-Search"

2.Open test.txt and run command "replace-string"

Start helm-occur and set pattern hello

Then I want to get ALL commands that I run in minibuffer.

So I use command "icicle-insert-history-element"

Here result:

But where commands "I-Search" and "Replase-string" ?


texts:
I was just looking at the Ediff manual¹ for something, and it's one of those Emacs manuals that (a bit annoyingly) only list keybinds and not function names (so, if you have rebinding going on, you don't know what it's talking about without digging into source).
And the keys it suggests for the things I want to do aren't doing anything for me—I get X is undefined, and if I C-hkX, I get X is undefined—these keys Ediff says should be available aren’t otherwise bound to self-insert or anything else.
(I should note here this doesn’t mean that I have no Ediff bindings; the keys shown onscreen in the Ediff Control Panel window do all work. It’s just keys that the manual mentions I’m having trouble invoking.)
The weird things, though, are that

searching my configs, I don't have anything named .*ediff.* rebound, so I don't know why those default keys wouldn't work, and
since Ediff has its own control panel buffer with its own keymap that uses mostly unchorded commands, why is a key that the manual says should do something, like @ or *, unbound (not bound to self-insert)?

I can use the source (mostly ediff-util.el) to find what functions these keys are supposed to be bound to and then bind them or run them with M-x, but I’m not sure how to go about diagnosing why I don’t have these keys bound in the first place.
(In case it matters, I’m running Emacs in server mode with my emacsclient running in a TTY.)
To clarify why I haven’t accepted prior answers:

I’m not asking how to find a particular key of Ediff — neither any particular key, nor any key of Ediff in particular. I’m asking how (if it’s possible at all, and from the Elisp manual’s explanation of keymaps, it feels like it should be) to find what the default map of any given mode or package might set, so that if the manual or someone online tells me to do something by typing some keys, and that doesn’t work, to find out what they were telling me to do in terms of Elisp commands.
The crux of this is not that I want to know how to do certain functions of Ediff (or any other package), it’s that somehow my keymaps are obliterating default mappings entirely, and I don’t know how that’s happening. I’m looking for how to find the missing key mappings and how they became missing in the first place. I generally use use-package to create bindings and keychords, and I can’t see where any of them conflict.
I’m not even sure how I’d go about removing another keybinding without replacing it with one of my own if I wanted to (using use-package bindings and not explicitly removing bindings or mapping them explicitly to self-insert), which is what I’m experiencing with Ediff—if someone can explain that, it would be a huge clue.

¹ Though I link to the current HTML version of the Ediff manual for convenience, the one I’m reading is the Info pages shipped with Emacs 25.2.2.


texts: How do I get magit to run: git push origin HEAD:refs/for/master ? (gerrit)

texts:
Gerrit has a magical reference (refs/for/master) that when you push to submits your commit to the code review system. I haven't been able to figure out how to get magit to push to this. I'm not sure if this is a limitation or if it's my inability to figure out the interface. On the command line this command works:

git push origin HEAD:refs/for/master

Using magit if I try to push to a branch, I am forced to choose from a list (I am also using helm), but this option isn't available. If I manually type it in, magit instead runs:

git … push -v origin master\:refs/heads/HEAD\:refs/for/master

Which fails. If I tell it I want to push an explicit refspec it makes me choose from explicit list that only has "origin" in it, and this time I am unable to manually type in my own choice.


texts: Setting font facename for emacs and xterm under linux

texts: How can I set the font name and size for Arabic letters in both emacs and xterm? Thanks


texts: Capture org-agenda and show-some-entry-text into dynamic block

texts:
In summary I want to capture org-agenda into a dynamic block with some entry text.

At the end of the week I provide a report as to what I've been doing and a list of what I intend to work on in the coming week.  For listing what I have been doing I use a clocktable to show me time spent.  And for what's still to do, I use a custom agenda view which captures specific tags and sorts the list by priority.  For both of these tasks I have been manually copying items from the clocktable and agenda into my report.

So how might I create the org-agenda block in my report buffer automatically?


texts: How can someone set Emacs / Spacemacs to prefer OTF font over TTF font when both are available?

texts:
Recently the nixos fira-code package added both the otf and ttf fonts and Emacs/Spacemacs isn't quite happy with the ttf ones.

How could I tell spacemacs to prefer OTF over TTF when both are available for the same typeface / font?

TTF:

OTF(*):

(*) This only works because the system default font is Fira Code Retina and it just happens to be what I want. However it is not because of writing it there.


texts: Why does flycheck open a new buffer for error messages?

texts:
So I am using flycheck for my C++ projects with this setup:

;; Require flycheck to be present
(require 'flycheck)
;; Force flycheck to always use c++11 support. We use
;; the clang language backend so this is set to clang
(add-hook 'c++-mode-hook
          (lambda () (setq flycheck-clang-language-standard "c++14")))
;; Turn flycheck on everywhere
(global-flycheck-mode)
;; Use flycheck-pyflakes for python. Seems to work a little better.
(require 'flycheck-pyflakes)

And integrate it into irony like so:

(eval-after-load 'flycheck
  '(add-hook 'flycheck-mode-hook #'flycheck-irony-setup))

Now when my irony setup is off and several includes cannot be found, flycheck will open a new buffer after a short delay and that buffer is full of error messages. That buffer then steals the focus. This is annoying and I wonder how I can get rid of that behavior without cancelling my irony experiments.

First of all, who is responsible in such a case? Flycheck or irony? Second, how does one debug such an issue?

I am using prelude and all packages are installed from melpa if that matters.


texts: How can I temporarily disable Spacemacs key bindings to work with org mode?

texts:
I am trying to learn an orgmode tutorial in Spacemacs (terminal mode) and it seems tha the Spacemacs key bindings are getting in the way.

How can I revert the Spacemacs bindings temporarily for that session, or that buffer if possible?

The other problem I have is when I ssh into another user account to edit the file in standards emacs (also terminal mode) the Alt - Arrow keys don't work. They are replaced by character codes. such as 3A and 3C

UPDATE: It turns out my problem came from Alt,Shift and Ctrl cursor combinations not working in my terminal configuration. The fix for that is in https://unix.stackexchange.com/questions/375825/how-can-emacs-be-configured-to-accept-shift-and-alt-cursor-combinations-properly and it is also related to Shift+Up isn't recognized by Emacs in a terminal


texts: How to obtain the statistics of the frequency of characters in a buffer

texts:
Are there some Emacs' packages which can be used for analysing the frequency of the characters and the words used in the current buffer.

As a particular example it would be interesting to have a mechanism for sorting the frequency of the characters of a given buffer.
For example if the content of a buffer is This is a test. the sorted frequency will be as below.

t 3
s 3
i 2
a 1
e 1
h 1
. 1


texts: Tramp freezes Emacs with OpenSSH on Windows

texts:
I just installed Emacs on my Windows machine for remote file editing using Tramp. However, I noticed than whenever I try to connect to a remote server (C-x C-f /ssh:home:), Tramp just displays Opening connection for home using ssh... \ and completely hangs Emacs. I can't pull up the debug buffer with (setq tramp-verbose 10) since the entire application freezes.

I'm using Win32-OpenSSH and the ssh and scp executables are both in my PATH.

My ~/.ssh/config:

Host home
        HostName xx.xx.xx.xx
        IdentityFile ~/.ssh/home_rsa
        User nick
        Port xx


texts:
I really don't want emacs to show me which function the pointer is currently inside. (See the photo)

What is the name of that frame? How can I remove it or make show an empty line?

I am using Emacs 25 on Ubuntu 18.10.


texts: How to run a 'prog-mode-hook' after more specific hooks?

texts:
I'm running into an order of initialization issue with hooks.

prog-mode-hook enables fci-mode
rust-mode-hook sets the fci-rule-column to 99.
on initial display the fill column shows at 80 (it's original value), moving the cursor redraws at 99.

This is not really a question about fci-mode, the solution is to set fci-rule-column before starting fci-mode (after or at the end of the rust-mode-hook).

To avoid needing to add generic code into all my programming mode hooks:

Is there a way to run a generic prog-mode-hook after more specialized hooks run?


texts: How can I see all errors in a Go project with LSP mode?

texts:
When opening a Go project with LSP mode, spacemacs / flycheck only shows errors in the current package, not including tests files. For example, in the following project:
|- pkg1
|- pkg2
|- cmd

When I'm in the pkg1/file.go file all of the following functions won't display errors from pkg2, cmd nor test files in pkg1:

next-error, flycheck-next-error, flycheck-projectile-list-errors, flycheck-list-errors.

The only function which displays all error is: lsp-treemacs-errors-list, but it's not very friendly: there is no way to jump to the next error without going to the lsp-treemacs-errors-list buffer, scrolling, unfolding and entering the error.
My setup: emacs 26.3, spacemacs @develop (latest), go layer with LSP mode + flycheck layer. (LSP mode works perfectly).


texts: How to indent with the tab character with a visual length of 4 spaces in spacemacs?

texts:
I have used Vim for years now, Emacs for a couple of weeks and recently switched to Spacemacs. How do I set indentation settings either globally or the C/C++ mode? (A solution for either one is fine.) I've put the following in my dotspacemacs/user-config () function in my .spacemacs file.

  (setq-default indent-tabs-mode t)
  (setq-default tab-width 4)                ; tabs four spaces wide
  (defvaralias 'c-basic-offset 'tab-width)  ; Set the C/C++/Java.. mode to use this tab width

But neither is it using tabs (it's using spaces) nor is the tab-width 4 (it's 2). Is this supposed to work? If not, what's the way to set tab indentation and tab-width for either a specific mode or globally in Spacemacs? (The settings above worked for me in the init.el for vanilla Emacs.)


texts: Is there any way to postpone or update all expired deadlines (or scheduled tasks) at once?

texts:
Is there any way to postpone or update all expired deadlines (or scheduled tasks) at once in org-agenda mode?

I tend to schedule more than I can handle and need a way to quickly either (a) remove old deadlines or (b) postpone old deadlines. (It would be nice to have a similar tool for the "SCHEDULED" property as well.)


texts: unbind ALL C-x and C-c shortcuts in org-mode with CUA-mode

texts:
For a special purpose application of emacs with org-mode I want to dramatically simplify the shortcuts. I'm already quite satisfied with my config based on CUA mode.

The one thing that bothers me still is that I C-c and C-x initiates the original sequences when no selection is active. How can I disable this?


texts:
This is the result of
    M-:  (elfeed-search-selected :ignore-region)

#s(elfeed-entry
    ("www.cbc.com.com" . "https://www.cbc.com.com/defg/Polyglot-programming_%7E017e364530a5359046?source=rss")
    "Polyglot programming - Abc"
    "https://www.cbc.com.com/defg/Polyglot-programming_%7E017e364530a5359046?source=rss"
    1530592564.0
    #s(elfeed-ref "07038fa7a0c9db39b71600a20fc065b1ea9e9a2d")
        html
        nil
        (ror unread)
        "https://www.cbc.com.com/ab/feed/defg/rss?q"
        nil))

#s appears twice. What does it indicate?

Is (ror unread) an array?

Why does this have a dot? ("www.cbc.com.com" . "https...")


texts: Org - How set up a main task with sub duplicate tasks in a numerical splited task

texts:
Something like this:

* TODO Go for a walk [0/2]
** TODO Walk for 30 minutes
** TODO Walk for 30 minutes

Would become something like this:

* TODO Walk for 1 hour {0/2}

And then, the state cycle would be:

-> TODO {0/2} -> TODO {0/1} -> ... -> DONE {2/2} -> TODO {0/2} -> ...


texts:
I found this link About fractional verticle scrolling for emacs. However there was not any explanation about how to configure this for scrolling of normal files.
How do I configure a fractional scroll step? I am thinking of implementing a smooth scrolling configuration.


texts: orgmode - file link with line number export to html error

texts:
When I try to export below code to html, I got below error message:
No match for fuzzy expression:2

org Code:
* test
#+begin_src python :results output drawer :exports results
print("[[file+emacs:test.txt::2][txtfile]]")
#+end_src

#+RESULTS:
:results:
[[file+emacs:test.txt::2][txtfile]]
:end:

The file test.txt exist on current directory since if click the link, it can be opened successfully, but when export to html, error happen!


texts: Why is the order of : and - important in a regexp character class

texts:
Defining the following function

(defun windows-path-backwards ()
  (interactive)
  (skip-chars-backward "a-zA-Z0-9\\\\_-:"))

and running it while standing at | in the below text

C:\this\path|

moves it to

C:|\this\path

Redefining the function as

(defun windows-path-backwards ()
  (interactive)
  (skip-chars-backward "a-zA-Z0-9\\\\_:-"))

and repeating the same procedure moves the pointer from

C:\this\path|

to

|C:\this\path

Why is there difference between these two functions when the only change is the order of the : and - characters in the character class skip-chars-backward takes as an argument.


texts: How to write a command which uses the prefix argument AND some strings

texts:
I want to write a command which uses a prefix argument and reads some strings.

I know both parts individually:

(defun xtest(arg)
  (interactive "P")
  ...

reads the prefix arg.

(defun xtest(t1 t2)
  (interactive "stEins: \nstZwei: ")
  (message "%s %s %s" arg t1 t2))```

reads two strings. But when I put it together to use both:

(defun xtest(arg t1 t2)
  (interactive "PstEins: \nstZwei: ")
  ...

then I get on execution of the command the error "funcall-interactively: Wrong number of arguments".

How do I set up the function definition correctly?


texts: Loading a theme and fontifying in batch mode

texts:
Loading a theme in batch mode seems to not set face attributes:

$ emacs -Q --eval "(load-theme 'tango t)" \
           --eval "(prin1 (face-attribute 'font-lock-keyword-face :foreground)))"
"#346604"

$ emacs --batch -Q --eval "(load-theme 'tango t)" \
                   --eval "(prin1 (face-attribute 'font-lock-keyword-face :foreground)))"
unspecified

What should I do to make sure that load-theme works as expected in batch mode, and in particular that face attributes are the same as in interactive mode?


texts: How to enable ido-completing-read correctly

texts:
So there is ido-completing-read that seems perfect to assign to completing-read-function. There is no customization interface though.

How is the user supposed to enable ido-completing-read for all completing reads?


texts: Which regexp from compilation-error-regexp-alist is used by compilation-mode?

texts:
I spent a while debugging the regex in compilation-error-regexp-alist only to find that the regex itself is fine.  My current theory is that compilation-mode is just actually using a different regex instead.

The error message is: ERROR: /home/user/projects/lv/packages/client/src/log.ts[291, 11]: 'now' is declared but its value is never read.

And the regex is: ^[[:blank:]]*\\(?:\\(?:ERROR\\|\\(WARNING\\)\\):[[:blank:]]+\\)?\\((.*)[[:blank:]]+\\)?\\([^(
\n)]+\\)\\[\\([[:digit:]]+\\), \\([[:digit:]]+\\)\\]: .*$

How do I see (and change) which regex compilation-mode is actually using in a given buffer?


texts: How to use yasnippet's tab expansion in minibuffer?

texts: I use yasnippet to insert some symbols (e.g., ✔), and I would like to do that in minibuffer too.  When I press TAB in minibuffer, it said " is undefined".  How to define it to use yasnippet?  Is it safe to do that?


texts:
my question is pretty basic but I don't know how to create yasnippets properly. I have created some snippets for Java or html with yas-new-snippets, installed them under emacs.d/snippets/org-mode, but they only work when I invoke them from org-mode , not from Java-mode (or JDEE) or html-mode, which is not very useful...

Here is my config file:

(add-to-list 'load-path
         "~/.emacs.d/elpa/yasnippet-20160801.1142")
(require 'yasnippet)
(yas-global-mode 1)
(add-to-list 'yas-snippet-dirs "~/.emacs.d/snippets")

The variable yas-snippet-dirs yields:
("~/.emacs.d/snippets" "/Users/me/.emacs.d/snippets" yas-installed-snippets-dir) so I tried to put directly under .emacs.d/snippets/ but they are not recognized.

Any idea? Thanks!


texts: setq in init file not overriding the default for indent-tabs-mode

texts:
It works when using setq-default in place of setq or when customizing through C-h v. C-h v reports that it is set in 'C source code'.

I was thinking it might be affected by my c-default-style, but my setq appears after it:

(setq c-default-style
              '((c-mode . "stroustrup")
                (other . "stroustrup")))

...

(setq indent-tabs-mode nil)

I have made sure I am not using smart tabs or any other tab settings.

My understanding of setq:
1. Creates and sets the local variable if not present.
2. Sets local variable if present.
3. Does not affect default.

My understanding of setq-default:
1. If local variable is present only the default is affected.
2. If no local variable present default and local are set.

With this understanding in mind and assuming the local variable takes precedence, why would changing the default value have an effect, but not changing the local value?


texts: Turn off flyspell mode for Greek and Hebrew but not English

texts: I have flyspell activated for certain document types, e.g. txt and org. If I want to turn off flyspell for a specific document, I add # -*- eval: (flyspell-mode -1); -*- to the top of the file. This works only well for documents typed in English. I would like to instruct flyspell never to check spelling for Greek or Hebrew text. How can I do this?


texts: How to make an alist without repeating key/values?

texts:
When writing an alist where all the key/value pairs have keys that are variables, is there a convenient way to write this in Elisp without repetition?

eg:

`((foo . ,foo)
  (long-variable-name . ,long-variable-name)
  (yet-another-long-variable-name . ,yet-another-long-variable-name)
  (you-get-the-idea . ,you-get-the-idea))

So the same structure could be written as:

(alist-from-vars
  foo
  long-variable-name
  yet-another-long-variable-name
  you-get-the-idea)

... with an arbitrary number of arguments.


texts: Using auto-insert and yasnippet to insert variables into template

texts:
I've been reading this and this, trying to figure out how to have an org-mode in-buffer settings template such as this:

# # -*- mode: org -*-
# # -*- coding: utf-8 -*-
#+TITLE: $1
#+AUTHOR: `(user-full-name)`
#+DATE: `(format-time-string "%e %B %Y")`
...

actually evaluate the back-quoted expressions and the $ markup upon .org file creation. This is, BTW, my init code for auto-insert

(use-package autoinsert
  :ensure t
  :init
  ;; Don't want to be prompted before insertion:
  (setq auto-insert-query nil)

  (setq auto-insert-directory (locate-user-emacs-file "templates"))
  (add-hook 'find-file-hook 'auto-insert)
  (auto-insert-mode 1)

  :config
  (define-auto-insert "\\.org?$" "default-org.org"))

where default-org.org begins like the first code section. But again, when I call into existence a file with a .org none of the back-quoted expressions have been evaluated, the expressions are returned verbatim. What am I missing here?


texts: Help me to fix my tramp (ssh/scp) workflow

texts:
I'm relatively new to tramp and despite being certain that it offers an elegant solution to my needs, I wasn't able to find one thus far. Let me briefly describe my workflow:

I connect to a server via tramp via ssh:user@host:path/ and there I usually edit a given text file. Commonly I have to upload a new document to the same file from my local machine. To achieve this, I (and this is the part I want to fix) open a separate eshell buffer in emacs and copy the file via scp to user@host:path/ . I then (which - again - is very undesirable) use this eshell buffer to connect (via ssh) a third time to the server to change the permissions of this newly uploaded file.

Clearly, this workflow is ridiculously inefficient and in desperate need of improvement. Can someone help?

I'd also like to disclaim that I searched for relevant questions on this side and found

Tramp/Dired transfers files inline over ssh instead of using scp externaly,
Executing remote commands with TRAMP with a single SSH connection and
remote tramp eshell session changes to localhost.

However, I wasn't able to derive an answer of my question from them - probably due to the lacking knowledge on my part.


texts: is there a keybinding to save curor position for returning after viewing other section of same buffer?

texts:
when i am editing a large file, often need to view other sections of the same buffer only once. But after that I need to go back to the position I was editing at.
Is there a key for doing that?


texts: Output of shell command in source block is displayed as table

texts:
The output of the shell commands is displayed as table.
How can I have it displayed as "simple" lines of text ?


texts:
so the problem I am having is that my spaceline plugin will have little squares of miss color until I do powerline-reset. (Just like the github issue.) Problem is that I am having to do this every time I start up emacs. Is there a way to make it so I don't have to do this every time I start up emacs?

Here is the issue on github: https://github.com/TheBB/spaceline/issues/11

(use-package spaceline
 :ensure t
 :init
 (progn
  (require 'spaceline-config)
  (setq powerline-default-separator 'wave)
  (setq spaceline-workspace-numbers-unicode t)
  (setq spaceline-separator-dir-left '(left . left))
  (setq spaceline-separator-dir-right '(right . right))
  (setq powerline-height 20)
  (setq spaceline-highlight-face-func 'spaceline-highlight-face-evil-state)
  (spaceline-toggle-major-mode-on)
  (spaceline-toggle-minor-modes-off)
  (spaceline-toggle-battery-on)
  (spaceline-toggle-hud-off)
  (spaceline-spacemacs-theme)))


texts: C Source code browsing similar to eclipse

texts:
Currently I am using eclipse to browse cross compiled C source code. I don't have back end cross compiler to actually compile and build the code. But eclipse create source browse tree.
I want to have similar setup in Emacs so that I can browse source code even though it may build or not.


texts: X11 -- Why is the Emacs logo image missing on the Welcome screen?

texts:
I'm working on developing a new Emacs feature for all three Window systems supported by Emacs, and would like a complete working installation of Emacs built --with-x --with-x-toolkit=no.  The welcome screen is not displaying the Emacs logo image that I am used to seeing.  I'm running it on X11 / XTERM.

Q:  What package do I need from let's say macports or building from source that will enable images on the Welcome screen in Emacs for X?

Here is my configuration:

Where should the build process find the source code?    .
What compiler should emacs be built with?               gcc -std=gnu99 -g3 -O2
Should Emacs use the GNU version of malloc?             no
  (The GNU allocators don't work with this system configuration.)
Should Emacs use a relocating allocator for buffers?    no
Should Emacs use mmap(2) for buffer allocation?         no
What window system should Emacs use?                    x11
What toolkit should Emacs use?                          none
Where do we find X Windows header files?                Standard dirs
Where do we find X Windows libraries?                   Standard dirs
Does Emacs use -lXaw3d?                                 no
Does Emacs use -lXpm?                                   yes
Does Emacs use -ljpeg?                                  yes
Does Emacs use -ltiff?                                  yes
Does Emacs use a gif library?                           yes -lgif
Does Emacs use a png library?                           yes -lpng16
Does Emacs use -lrsvg-2?                                yes
Does Emacs use cairo?                                   no
Does Emacs use imagemagick?                             no
Does Emacs support sound?                               no
Does Emacs use -lgpm?                                   no
Does Emacs use -ldbus?                                  yes
Does Emacs use -lgconf?                                 no
Does Emacs use GSettings?                               yes
Does Emacs use a file notification library?             yes (kqueue)
Does Emacs use access control lists?                    yes
Does Emacs use -lselinux?                               no
Does Emacs use -lgnutls?                                no
Does Emacs use -lxml2?                                  yes
Does Emacs use -lfreetype?                              yes
Does Emacs use -lm17n-flt?                              no
Does Emacs use -lotf?                                   no
Does Emacs use -lxft?                                   yes
Does Emacs directly use zlib?                           yes
Does Emacs have dynamic modules support?                no
Does Emacs use toolkit scroll bars?                     no
Does Emacs support Xwidgets (requires gtk3)?            no


texts: How to enter view-only mode when browsing Emacs source code from help?

texts: When I browse Emacs help for functions via C-h f, I often want to peek into the Elisp/C implementation. I want to enter view-mode automatically when I access source code this way to avoid unnecessary modification. Is there a hook or function I can advise to accomplish this?


texts: need help with very complex find and replace

texts:
I have a very complex (at least to my mind) text replacement task. ideally this would be a function or macro I could run over every org header in a buffer.

I want to
1. move over any TODO state to a line beneath the header starting with tags:
2. then move over any org tags following that todo state into the tags line proceeded by a comma

the issue is that of course the org header changes in depth across the file and the header name changes of course.

this is for getting ready to use org export to markdown. since org markdown export cant convert org tags and states into markdown tags I want this step of pre proceesing. I would then export each changed heading to md and use the first line as meatadata.

the markdown app can the read these exported tags and thus keeping/"exporting" my org rating and todo state .

as an example this org section:

*** ✔ Kopitiam                                                        :3star:
pretty good malasyian food. Had a nice frothy tea, the nasi lamak and blue rice with pandan cream
all was ok but nothing outstanding

*** Brussels
**** ✔ Tonton Garby                                                   :3star:
very good sandwhices in brussels

would look like this after the find and replace

*** Kopitiam
tags: #✔ , #3star
pretty good malasyian food. Had a nice frothy tea, the nasi lamak and blue rice with pandan cream
all was ok but nothing outstanding

*** Brussels
**** Tonton Garby
tags: #✔ , #3star
very good sandwhices in brussels

is something like that even possible within emacs or do I need to some other tools like python?

EDIT:

someone helped me try a outside emacs solution using perl

#!/usr/bin/env perl

use strict;
use warnings;

sub fmt_tags {
    return unless defined $+{tags};
    map {q/#/ . $_} $+{tags} =~ /\w+/g
}

sub check_tag {
    defined $+{checked}? q{#} . $+{checked} : q{}
}

while (<>) {
        s/
            (?<stars>[*]{2,4})
            \s+
            (?<checked>✔)?
            \s+
            (?<title>.+?)
            \s+
            ((?<tags>:.+\n)?|\n)$
        /$+{stars} $+{title}\ntags: @{[join ', ', check_tag(), fmt_tags()]}\n/x;
    print;
}

this seems to work, yet docent really pick up the TOVISIT tags...


texts: Company-yasnippet doesn't see yasnippet template in lisp

texts:
Config:
(use-package yasnippet
  :ensure t
  :hook
  (prog-mode . yas-minor-mode)
  )

(use-package yasnippet-snippets
  :ensure t
  :after yas)

(use-package common-lisp-snippets
  :ensure t
  :after yas
  :hook lisp-mode-hook)

(use-package slime-company
  :ensure t
  :after (slime company)
  :hook
  (lisp-mode
         . (lambda ()
             (set (make-local-variable 'company-backends)
                  '((company-slime company-yasnippet company-semantic)))))
  (slime-editing-mode-hook
         . (lambda ()
             (set (make-local-variable 'company-backends)
                  '((company-slime company-yasnippet company-semantic)))))
  :config
  (setq slime-company-completion 'fuzzy
        slime-company-after-completion 'slime-company-just-one-space))

In a lisp file,
"defpackage"(imported by common-lisp-snippets) is show when using:
yas-insert-snippet

but company doesn't show for it.
How to config company-yasnippet to find it?


texts: Abort output in currently executing command in shell mode

texts:
Sometimes in shell I end up executing a command which results in too much output.

For example, consider a wrong grep on a huge text file which results in 10,000 matches. The grep command completes quickly, but Emacs updates the shell buffer slowly and it takes forever to complete.

At that point I would like for Emacs to abort the output and return to the shell prompt. Any suggestions on how this can be achieved?

Currently I kill the shell process (bash) and start it again in the same buffer, but it would be nice to not have to do that


texts: Kill and yank (append?) text from buffer to bottom of same buffer

texts:
I want to be able to kill selected text and yank it to the bottom of the buffer from which it was killed.

How do I do this efficiently, meaning not with C-k, moving point to end of buffer, C-y?


texts: There's a way to use emacs like MS Word, to make text permanently colored, stylized, etc...?

texts: I'm totally new to the wonderful world of Emacs. I started to use it some weeks ago and i'm find myself to use it more and more... I would like to use it not only as a code editor, but also as a word processor like MS Word, Apple Pages, etc, however, i cant find a practical way to color text, highlight text (like a physical highlighter not like a code editor), and so on. I use M-x highlight-syntax-at-point and M-x highlight-phrase but is temporary and anyway, highlights only, e.g. i cant simply make a word or a phrase green. I hope i was clear in my question. Thanks anyway!


texts: How to open files out of long directory trees using helm-find-files?

texts:
Helm features buffer navigation that is more powerful than ido but apparently has a bit of a learning curve. Say I want to open a file in

java/com/example/apple/banana/cat/dog/elephant/fig/grape/Hello.java

And my mini buffer currently reads

Find files or Url: ~/java/com

The helm buffer list will not let me <TAB> for completion like in ido. <RETURN> will open the buffer list, which is also not what I want. However to select the directory I must hit the right arrow key which requires leaving the home keys on my keyboard and is therefore very slow.

Per answer below C-j or C-z is the answer I'm looking for. However at that point it's still very hard to navigate, as Helm will default to ./ as the directory listed, i.e.:

Go to helm-find-files
Pick any directory
After you are taken to the next file list, the entry highlighted in "green" will be the_directory/.

This means if you type C-j again it will "take" you to exactly where you are. This contrasts with ido, where hitting <RETURN> a few times will auto-complete out using logic (I think just "last picked directory") to determine which directory should be default.

Therefore I must always type C-n twice or type the first letter of the directory. It certainly doesn't "fly" like ido-mode does, so this is still too unusable for me. Is there a hack for this as well?


texts: I would like to have a link that runs a Babel source-code block. Does Org-mode support running something from the library of babel in a link, or a source block via a file+blockname reference? A Hyperbole button would also be acceptable.


texts: How to open a file in other window in the middle of function run?

texts:
I use notmuch to read emails.
I've configured notmuch to call offlineimap via pre-new hook.
When I press G to refresh my notmuch buffer, I want emacs to open my offlineimap log file in another window so I can see the sync process in real time.
Here's is what I've done:
(use-package notmuch
  :bind
  (:map notmuch-hello-mode-map
   ("G" . (lambda ()
            (interactive)
            (find-file-other-window "~/Maildir/.notmuch/hooks/offlineimap.log")
            (notmuch-poll-and-refresh-this-buffer)))))

Problem with this is, emacs would only open the log file after sync is done.
How do I make emacs open the log file before notmuch and offlineimap action?


texts: How do you return from a function at an arbitrary point?

texts:
How do you return early from a function before it's ended? For example:

(defun my-func ()
 "for example."
 (unless something (return nil))
 ; continue as usual...
 (+ 42 1))


texts: How to define a configurable variable in Elisp to be used in other program like Ruby?

texts:
I want to define a configurable variable in Emacs, but make it can be used in Ruby code.

The situation is like here:

https://github.com/zenspider/enhanced-ruby-mode/pull/68

I copy the content to here:

here is the elisp code that want to define a emacs variable to config the ruby indent for access modifiers (private, public, protected).

(defcustom enh-ruby-outdent-access-modifiers nil
  "*Outdent public/protected/private modifiers if this is non-nil."
  :type 'boolean :group 'enh-ruby)
  (put 'enh-ruby-outdent-access-modifiers 'safe-local-variable 'booleanp)

And here is the ruby code.

when :period then
  add :ident, tok
else
  + indent :s if %w(private protected public).include? tok
  if @ermbuffer.extra_keywords.include? tok then
    add :kw, tok
  else


texts:
Two PCs, same version of manjaro on both, same emacs version, same spacemacs version/branch, same config file.
Problems with python mode and company:
On my second PC, autocomplete doesn't work correctly, sometimes it's just crushed with "max recursion deep" error. Also company is disabled by default, but on second PC it's enabled. Here also a lot of small differences and errors, which make my second emacs just unusable.
Don't know why it happens and how to fix.
My .spacemacs file: https://pastebin.pl/view/e3de7419
I tried spacemacs version 0.2, 0.3, master, develop.
Emacs 27.1
Manjaro Release: 20.2.1
Python libs (jedi, flake8) installed.


texts: Grep pipe support and how to filter grep results

texts:
I try to filter the output of M-x grep with grep --color=always -nH -e "text_to_find" ~/path/to/files/*.org | grep -v "text_to_ignore" but it doesn't seem to be working. The 'to be ignored' part is still not filtered away.

Is it true that grep in Emacs do not support piping? If so, how do we filter grep results?


texts: Build a list of headers in current buffer

texts:
I am trying to create a list of headers in the current org-mode buffer. Here is my code:

(setq m ())
  (save-excursion
    (goto-char (point-min))
    (while (re-search-forward org-heading-regexp nil t)
      (add-to-list 'm '(nth 4 (org-heading-components)))))

This works fine if I take out the while statement. But for some reason, I can't get this to work past the first iteration.

Any ideas what I'm doing wrong?


texts: how to modify the active region highlighting color

texts:
Gray text highlighting no longer works on my Debian/stretch system. While this is particularly annoying in Emacs, it's not a specific Emacs problem; gray background is also gone from other applications, including the web browser. Therefore I asked for help at  Unix SO.

I do however have an Emacs-specific question: Are there ways of active-region highlighting other than gray background? I would like to try them out in order to narrow down the gray-background-is-gone bug.


texts: I want to create a org-mode agenda dashboard that has multiple headers, each with content from a different query. How can I make this happen with a single command? Am I forced to have them in separate buffers?


texts:
Say you have a function calls like the following
var1 = 'some var'

logEvent({
 eventParams: {
   var1
 }
})

I want to find logEvent function calls where eventParams have var1 (opposed to var2)
The problem is that the function call is not one-liner as logEvent({eventParams: {var1} })
Currently I'm using helm to find logEvent and save the result. and manually visit all the files to see if the function call indeed uses var1
Is there an efficient way of doing this other than visiting all the files one by one?


texts: Variable font height according to Org header

texts:
This seems like it's probably not possible, but I'm extremely new to Emacs and thought I'd ask.
I have a number of faces set in Org mode.
;; Highlight Line Colors
(add-hook 'org-mode-hook (lambda ()
(set-face-attribute 'org-level-1 nil                   :family "Mordens" :font "Mordens" :height 520 :foreground "#FDF0ED")
(set-face-attribute 'org-level-2 nil                   :family "Iosevka Nerd Font" :font "Iosevka Nerd Font" :height 220 :foreground "#25B2BC")
(set-face-attribute 'org-level-3 nil                   :family "Iosevka Nerd Font" :font "Iosevka Nerd Font" :height 160)
(set-face-attribute 'org-level-4 nil                   :family "Iosevka Nerd Font" :font "Iosevka Nerd Font" :height 160 :italic nil)
(set-face-attribute 'org-document-title nil            :family "Iosevka Nerd Font" :font "Iosevka Nerd Font" :height 160 :italic 1 :foreground "#2E303E")
(set-face-attribute 'org-document-info nil             :family "Iosevka Nerd Font" :font "Iosevka Nerd Font" :height 160 :italic 1 :foreground "#2E303E")
(set-face-attribute 'org-document-info-keyword nil     :family "Iosevka Nerd Font" :font "Iosevka Nerd Font" :height 160 :italic 1 :foreground "#2E303E")
(set-face-attribute 'org-headline-done nil             :family "Iosevka Nerd Font" :font "Iosevka Nerd Font" :height 160 :italic 1 :foreground "#6C6F93" :strike-through "#F43E5C" )
(set-face-attribute 'org-done nil                      :family "Iosevka Nerd Font" :font "Iosevka Nerd Font" :height 160 :italic 1 :foreground "#6C6F93" :strike-through nil )
(set-face-attribute 'org-todo nil                      :family "Iosevka Nerd Font" :font "Iosevka Nerd Font" :height 160 :italic 1 :foreground "#E95379")
(set-face-attribute 'org-checkbox-statistics-todo nil  :family "Iosevka Nerd Font" :font "Iosevka Nerd Font" :height 160 :foreground "#09F7A0")
(set-face-attribute '+org-todo-project nil             :family "Iosevka Nerd Font" :font "Iosevka Nerd Font" :height 1.0 :foreground "#B877DB")
(set-face-attribute 'org-link nil                      :family "Iosevka Nerd Font" :font "Iosevka Nerd Font" :height 160 :italic 1 :underline "#FDF0ED" :foreground "#09F7A0")
(set-face-attribute 'line-number-current-line nil      :foreground "#09F7A0")))

What I would like to do is set +org-todo-project's height to the height of the header where it occurs.
Note: +org-todo-project sets the face for the keyword PROJ.
For example:
* PROJ This is a Project ;Header 1 Height 520
** PROJ This is another Project ; Header 2 Height 220

I've tried to search around, but again Emacs is a big placem so if it's possible I don't know what I am looking for. I thought trying a dolist to see if it would inherit the height but I'm pretty sure it would just inherit the last height before it, if at all.


texts: Completion modes are too intrusive. Is there an abstract API to fine tune usage per mode?

texts:
So I'm looking for coding technique / code organization to make completion system pluggable for particular my mode, choice shouldn't affect other modes or preferences.
At the moment I use completing-read and it benefits from ivy. But I don't want to enable ivy globally.
What way can I give user of mode to choose preferred completion system for particular mode? Replacing completing-read globally is a disaster (be below).
RATIONALE I use ido for file completion. It has C-f (ido-magic-forward-char - fallback to non-Ido find-file).
I enabled ivy + counsel and file completion becomes disastrous, like C-x C-f is still from ido but with fallback to ivy where C-M-j (ivy-immediate-done) is not bound - so I can't create new file if some parts of it in existing file names...


texts: How to add a value after a given value in parts of a list, returning a new list?

texts:
I have the following structure:
'((a (1 2 3 4))
  (b (1 2))
  (c (1 3 4 5))

I want to return a new list that's similar, but that has a 7 inserted after each 2:
'((a (1 2 7 3 4))
  (b (1 2 7))
  (c (1 3 4 5))

How can I do this?


texts: Is updating Emacs and installing Emacs the same thing?

texts:
I installed Emacs 26.1 from dnf package manager on Fedora 29.
I would like to install the latest stable Emacs, which is version 26.2.
Emacs 26.2 will be on Fedora 31 in 6 months.

Is updating Emacs the same thing as installing Emacs?
If so, I will be following the instructions on https://www.gnu.org/software/emacs/manual/html_node/efaq/Installing-Emacs.html

Latest Emacs release number is published on https://www.gnu.org/software/emacs/index.html#Releases

Emacs dnf release numbers are published on https://apps.fedoraproject.org/packages/emacs


texts: avoiding underlined spaces between two lines

texts:
It must be very simple to get rid of but I could not find something addressing the problem : I would like to avoid underlined spaces between two lines. The following screenshot illustrates the problem in an org itemize:

I use the classic default-fill-column of 80.

The describe-char value of the space character (in place of the red cursor) gives the following:

 position: 500 of 1353 (37%), column: 0
        character: SPC (displayed as SPC) (codepoint 32, #o40, #x20)
preferred charset: ascii (ASCII (ISO646 IRV))
code point in charset: 0x20
           script: latin
           syntax:          which means: whitespace
         category: .:Base, a:ASCII, l:Latin
         to input: type "C-x 8 RET HEX-CODEPOINT" or "C-x 8 RET NAME"
      buffer code: #x20
        file code: #x20 (encoded by coding system utf-8-unix)
          display: terminal code #x20

Character code properties: customize what to show
  name: SPACE
  general-category: Zs (Separator, Space)
  decomposition: (32) (' ')

There are text properties here:
  face                 org-link
  font-lock-multiline  t
  fontified            t
  help-echo            [Show]
  keymap               [Show]
  mouse-face           highlight

EDIT (by Tobias):
Org-text for reproduction:

- Energy and Numerical Weather Predictin; aussi ce papier sur [[http://web.mit.edu/lorenzcenter/about/LorenzPubs/The_Statistical_Prediction_of_Solutions_1962.pdf][statistic
  prediction of sol of dynamics equations]]

Local Variables:
fill-column: 80
org-hide-emphasis-markers: t
eval: (progn (setq org-descriptive-links nil) (org-toggle-link-display))
End:


texts:
I'm trying to setup some keybinds using functions from the python-x package. While it works for the simple call (global-set-key (kbd "C-c C-j") 'python-shell-send-line), when I try to chain multiple functions using the lambda trick I get <C-return> is undefined despite having no error at startup. Here is the command I put in the user-config in .spacemacs :

(global-set-key (kbd "C-RET") (lambda () (interactive) (python-shell-send-line) (next-line)))

python-x works with python mode but the simple keybind is available everywhere while the chained keybinds are all undefined. Where does it go wrong ?


texts: Unable to bind emphasize key in org-mode

texts:
I am trying to create new keybindings for quickly italicizing and bold-facing the text in org-mode. By default, org-emphasize function is provided by org-mode for this. I'm leveraging that for my case.

For example, this is the keybinding for bold-facing the text:

(define-key org-mode-map (kbd "s-b") (
                      lambda ()
                      (interactive)
                      (org-emphasize '*)
                      ))

However, when I run the keybinding, it throws the error:

org-emphasize: Wrong type argument: characterp, *

What am I doing wrong?


texts: Set tabs instead of spaces when programming

texts:
I have been using Emacs for a while and it has been one of my favorite editors of all time, even more so than Vim. However, I've had a problem in regards to setting tabs and spaces.
Whenever I try to program in C or C++, whenever it auto-indents, it uses spaces instead of tabs. However, I would prefer it if they were hard tabs that appeared visually as 4 spaces.
Right now in my ~/.emacs.d/init.el, I have this:
(setq tab-width 4)
(setq c-default-style "linux")
(setq-default c-basic-offset 4
          tab-width 4
          indent-tabs-mode t)

I know that there isn't anything else conflicting in the init.el that could lead to it being overridden. So far nothing that I've tried online as of yet has been able to fix it, including searching the EmacsWiki, Stack Overflow, and Emacs Stack Exchange.
I'm using GNU Emacs 26.3 on Ubuntu GNU/Linux 20.04.


texts: Change org-mode table style just for LaTeX export

texts:
I am trying to customize the style of my org-mode tables when exported to Latex. I need to change their font face, their font size, the background color of the header and the background color of every other rows.

I see lots of discussions on how to do these things in pure LaTeX, using (or not) additional packages like pgfplotstable. But I would like to keep my document as 'org-mode' style as possible (for readability and because I also export in HTML).

There are ways to specify basic options via attribute, but it won't take me far enough: http://orgmode.org/manual/LaTeX-specific-attributes.html#LaTeX-specific-attributes

Is there a way to specify in an org-mode document that tables should use a particular format/structure (maybe in an external .sty) when exporting to LaTeX without messing the basic org-mode style table for other exports?

Thanks


texts: Flycheck elisp "There should be two spaces after period"

texts:
Is there any way to disable just this one warning?
Two spaces seems like overkill but maybe that is the lisp standard?


texts: Inherit SCHEDULED and priority properties

texts:
What is the reasoning behind the design of not inheriting the SCHEDULED and priority properties?

Any notable use cases to support this behavior?

On the contrary, actually inheriting SCHEDULED (or DEADLINE for that matter) and priority properties makes perfect sense to me.

For instance, if an entry is SCHEDULED and thus is appearing in the week agenda, adding a sub-item to it will automatically bring that item to agenda replacing the parent. This will prevent the parent from falling out of attention. In the current design you may loose a DEADLINE task forever by adding a sub-task to it without scheduling it.


texts: How to debug an Emacs that stops taking input and needs to be restarted every few hours, but doesn't throw any errors

texts:
I've been having a problem lately where every few hours of use, for some reason I don't understand, Emacs stops responding to input without throwing an error. C-g and Esc-Esc-Esc do nothing, so I'm forced to kill Emacs and restart it. Presumably, this has something to do with a change I recently made to my .emacs, but I've made a lot of changes, and I don't see any good way to debug it. Recursively bisecting could entail spending weeks or months with a semi-functional editor, since the problem takes hours to show up and I don't know how to reliably reproduce it. Emacs isn't throwing an error, so debug on error doesn't help.
Is there some way I can start Emacs such that I can manually debug it on the fly, or so that it will give me a log of what Emacs was doing and I can look at the end to see what was going on when it stopped responding?


texts: Make :tangle don't add a newline at the end of the file

texts:
The context
I'm storing all my custom defined yasnippet snippets in an Org file (see below)
$ cat ~/.emacs.d/snippets/snippets.org
#+PROPERTY: header-args:yasnippet :mkdirp yes

#+begin_src yasnippet :tangle ~/.emacs.d/snippets/org-mode/a
# key: a
# --

a foo bar
#+end_src

#+begin_src yasnippet :tangle ~/.emacs.d/snippets/org-mode/b
# key: b
# --

b foo bar
#+end_src

The problem
When tangling any code block present in the Org file shown above (i.e. snippet definition) a newline is inserted at the end of the last line which is causing yasnippet insert a newline whenever a snippet is triggered. I don't want a newline to be inserted whenever an snippet is triggered since newlines are unnecessarily added to my files and I manually have to delete them.
The behavior of yasnippet of adding newlines after an snippet expansion is mentioned in the FAQ file located in the yasnippet master branch repository

If there is a newline at the end of a snippet definition file, YASnippet will add a newline when expanding that snippet.

Additional context
It is worth mentioning that this problem is not present when creating a new snippet with yas-new-snippet since the variable require-final-newline is set to nil in the opened buffer.
The behavior present in the buffers which are opened after yas-new-snippet has been executed is set by yasnippet itself.
$ grep -R 'require-final-newline' ~/repos/yasnippet
...
~/repos/yasnippet/yasnippet.el:        (set (make-local-variable 'require-final-newline) nil)
~/repos/yasnippet/yasnippet.el:      (set (make-local-variable 'require-final-newline) nil)
...

The question

Is there a way to change the behavior of tangling so that a newline is not inserted at the end of the file?
What other workarounds could I try to overcome this issue? I was thinking in executing a function that iterates over all files in my custom snippets directory and delete the last character if and only if it is a newline.


texts:
I am using find-file-at-point and it stubbornly selects incorrect file name string in NXML mode:

String where I have cursor on the file name:

<include>my-file.ext</include>

and when evaluating: (ffap-string-at-point) it selects ">my-file.ext</include".

Is there some simple way to tell ffap that '<' and '>' are NOT part of the file name?

Thanks, this is driving me crazy.


texts: Any ways to make a GUI application fullscreen in EXWM?

texts:
I'm used to i3wm, as well as a couple other WM, but i noticed that, as far as i know, there isn't any function or keybinding existing in EXWM (by default) to make a GUI application fullscreen (which i3wm and other support).

Example: For instance, using i3wm, one can use the Super+f key combination (Super being the Windows keys on most keyboards) to force a GUI application/windows fullscreen.

Just curious if this is already a thing or not.


texts: Why does my Flycheck syntax checker not activate automatically?

texts:
I wrote a Flycheck frontend for LDC. It installs into Emacs fine, and I remember to require it, but for some reason, it doesn't automatically enable itself when I open a file in d-mode. What did I miss?

Edit: As per request, here are the relevant parts of my init file:

;;D
(autoload 'd-mode "d-mode" "Major mode for editing D code." t)
(add-to-list 'auto-mode-alist '("\\.d[i]?\\'" . d-mode))

;;Flycheck
(require 'flycheck-ldc)
(add-hook 'after-init-hook #'global-flycheck-mode)
(setq-default flycheck-disabled-checkers '(c/c++-clang))

Edit 2: As per request, here is the result of C-c ! v in a d-mode buffer:

Syntax checkers for buffer logic.d in d-mode:

  d-dmd
    - predicate:  nil
    - executable: Not found

Flycheck Mode is enabled.

The following syntax checkers are not registered:

  - d-ldc

 Try adding these syntax checkers to `flycheck-checkers'.


texts:
I'm new to org-mode and really need to figure out how to get completion working for stuff like :tags and #+ options. Apparently org uses pcomplete as the completion backend. Indeed M-x pcomplete (helm) does offer a buffer with long list of completions for #+ (which disappears if you try to expand the buffer). You then have to click on one of the options, which feels pretty kind of clumsy.

Is there a feature complete and mature alternative to pcomplete? I'm used to completions just popping up as I type, and would ideally like to get the same functionality in Org. Alternately, am I using pcomplete wrong?

Update

Here's the full code:

(defun my-org-mode-hook ()
  (add-hook 'completion-at-point-functions 'pcomplete-completions-at-point nil t))
(add-hook 'org-mode-hook #'my-org-mode-hook)

It works!


texts:
Using ac-slime I am getting the following errors:

Error running timer ‘ac-update-greedy’: (wrong-type-argument number-or-marker-p \.\.\.) [3 times]
Error running timer ‘ac-show-menu’: (wrong-type-argument number-or-marker-p \.\.\.)

I re-installed all auto-complete components from Melpa because this was mentioned as solution in similar cases, without a change.

I filed an Issue but the original author of ac-slime is not using auto-complete any more. I tried to find something in the source which could cause this but my elisp knowledge is just too limited. As far as I can see, there was no change in auto-complete for years, so I have no idea why this happens and how it could be solved.

Is anyone using ac-slime or should I switch to company?


texts:
When I try to close the neotree window (SPC w d with spacemacs) it just says

  Only one window other than neotree left. Won't close.

It's true that I only have one window other than neotree but what if I want to make it fullscreen ?