texts:
I'm trying to setup C++ IDE on spacemacs.

Below are the layers configured .

    dotspacemacs-configuration-layers
    '(
        helm
        (auto-completion :variables
                        auto-completion-return-key-behavior 'complete
                        auto-completion-tab-key-behavior 'cycle
                        auto-completion-complete-with-key-sequence nil
                        auto-completion-complete-with-key-sequence-delay 0.1
                        auto-completion-private-snippets-directory nil
                        auto-completion-enable-snippets-in-popup nil
                        )
        (lsp :variables
            lsp-ui-doc-enable t
            lsp-ui-sideline-enable nil)

        emacs-lisp
        c-c++
        (cmake :variables cmake-enable-cmake-ide-support nil)
        go
        java
        treemacs
        syntax-checking
    )

Below are the additional packages -

dotspacemacs-additional-packages '(bazel-mode lsp-haskell ccls lsp-ui company-lsp dap-mode)

My c++ configuration layer settings are -

    (setq-default dotspacemacs-configuration-layers
                '((c-c++ :variables
                        c-c++-backend 'lsp-ccls
                        c-c++-adopt-subprojects t
                        c-c++-lsp-enable-semantic-highlight 'rainbow
                        c-c++-default-mode-for-headers 'c++-mode
                        c++-enable-organize-includes-on-save t
                        c-c++-lsp-cache-dir ".cache"
                        c-c++-lsp-extra-init-params '(:completion (:detailedLabel t) :index (:comments 2))
                        c-c++-lsp-sem-highlight-method 'font-lock
                        c-c++-lsp-sem-highlight-rainbow nil
                        )))

    (setq ccls-executable "/usr/bin/ccls")
    (add-hook 'prog-mode-hook #'lsp)

After adding the below settings I'm getting below error -

Settings

    (setq ccls-executable "/usr/bin/ccls")
    (add-hook 'prog-mode-hook #'lsp)

Error -

  Error running timer ‘lsp--on-idle’: (error "The connected server(s) does not support method textDocument/documentLink
  To find out what capabilities support your server use ‘M-x lsp-describe-session’ and expand the capabilities section.")

I don't get this error for other programming languages like go, java etc
I only get this for C++.

What is wrong with my configuration? How can I fix this error?

Note:

My OS details -

    raj@localhost:~> lsb_release -a
    LSB Version:    core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_64:core-4.0-x86_64:desktop-4.0-amd64:desktop-4.0-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.2-amd64:graphics-3.2-noarch:graphics-4.0-amd64:graphics-4.0-noarch
    Distributor ID: openSUSE
    Description:    openSUSE Leap 15.1
    Release:        15.1
    Codename:       n/a


texts: How to set emmet mode in spacemacs startup?

texts: I would like to set emmet-mode on startup for spacemacs. So far I've added this  line in my user-configuration layer (setq emmet-mode 0) which does technically turn on emmet-mode each time spacemacs starts, but I don't get the functionality. I have to disable and enable it again manually after which it works fine. How can I make it such that emmet-mode gets enabled by default in spacemacs startup?


texts:
I've been using emacs for a long time but still have little understanding of elisp; I basically copy code I find on websites into my .emacs until it seems to do what I want.

I only recently discovered global-visual-line-mode (I had been using auto-fill), and now see based on this other answer and this one at stackoverflow that I also want adaptive-wrap-prefix-mode. It works great when I turn it on manually, but when I blindly add the code provided in the former answer to my .emacs, I get

File error: Cannot open load file, no such file or directory, adaptive-wrap

while blindly adding the code from the latter answer loads fine, but does not actually succeed in turning on adaptive-wrap-mode. I've played with variations and I'm sure the solution is simple, but I just don't see it. How do I just get it to turn on both global-visual-line-mode and adaptive-wrap-prefix-mode by default?

I would be happy if I could get them both running just for my markdown files.

Thanks in advance!


texts:
Is it possible to have org-mode export ignore entries that are in a completed state (e.g., DONE, WONTFIX).

Note that I do not want to create a sparse tree and then export what's visible, that will not necessarily give the same result.


texts: Prettify symbols without screwing up alignment

texts:
Is there a way to prettify symbols without running into alignment issues? E.g. replacing not with ¬is visually pleasing, but screws up code alignment, b/c not is 3 chars while ¬ is one char.

Since prettifying symbols only changes the way text is displayed, not how it's actually stored, it doesn't make sense for operations like text alignment to use the prettified instead of underlying representations.


texts: use-package and package-initialize problem with emacs27

texts:
I'm having quite a bit of trouble getting use-package to automatically install packages in emacs27

I deleted a package using package-delete and restarted emacs. On emacs26, use-package would automatically install the package by connecting to MELPA. But on emacs27, I'm getting the below error:

Error (use-package): Failed to install anzu: package.el is not yet initialized!
Error (use-package): Cannot load anzu
Warning (initialization): An error occurred while loading ‘/Users/csraghunandan/.emacs.d/init.el’:

error: package.el is not yet initialized!

Here is my emacs configuration
Anybody know how I can fix this issue? Is there anything I need to add to my early-init.el file?


texts: Can I pass an arbitrary symbol/keyword as a non-nil argument?

texts:
If a function takes a parameter whose only significance is in whether it's nil or non-nil, is there any reason not to pass it a well-named symbol to clarify what's going on in the calling code?

For example, add-to-list takes an optional APPEND argument, which if non-nil adds the element to the end of the list rather than the beginning. I could write,

(add-to-list my-list "x" t)

but I think it would be clearer if I wrote

(add-to-list my-list "x" 'append)

or

(add-to-list my-list "x" :append)

I like that last one best, but is that just not done? I could actually see it being confusing since it makes it look like a keyword argument and it's not really.


texts: Move item from org archive back into org agenda file?

texts:
Q: how does one move a project out of the org archive and back into its original spot in the agenda file?

org-mode has facilities to archive projects.  Every once in a while, however, I need to retrieve something from the archive and put it back in the agenda file in which it was originally located.

I do this infrequently enough that it's not a big problem to move the entry from archive to agenda file manually, but I'm wondering if there's an automated way to do so.


texts: Tell a dash (-), an en-dash (–) and an emdash (—) apart

texts: A dash (-), an en-dash (–) and an emdash (—) are different but difficult to tell apart. This causes problems e.g. when writing programs. Is there some way to tell  them apart easier  in emacs? Thanks.


texts:
This is closely related to a previous question I asked here:
SMIE Basic Identation and Block Example

However, it is sufficiently different (and already big enough) that I might as
well ask it as a separate question. Those answers may still be useful for others
anyways.

Anyways, given the (corrected) SMIE grammar and rules from the previous
question:

(defvar smie-sample-grammar
  (smie-prec2->grammar
   (smie-bnf->prec2
    `((insts (insts ";" insts) (inst))
      (inst ("AttributeBegin" inst "AttributeEnd")))
    '((assoc ";"))))
  "Sample BNF grammar for `smie'.")

(defun smie-sample-rules (kind token)
  "Perform indentation of KIND on TOKEN using the `smie' engine."
  (princ (list kind token))
  (pcase (list kind token)
    (`(:elem basic) smie-sample-indent-offset)
    (`(:elem arg) 0)
    (`(:after "AttributeEnd") (smie-rule-parent))))

Our toy major-mode from the previous question now works. However, if we extend
it slightly, e.g., by adding arguments to each instruction that can trail
multiple lines, they are indented as expected in almost all cases:

test a
     b
     c;
test a;
test a
     b;
AttributeBegin
    test c
         d;
    AttributeBegin
        test c
             d;
    AttributeEnd
    test c
    d;  # <- Not lining up as expected.
    test c
         d;
AttributeEnd

Only the one instruction marked above is unexpectedly indented (and others that
trail directly after an "AttributeEnd" statement). I tried to use smie-edebug
to debug the indentation of that particular line, but for some reason SMIE
doesn't even refer to the rule-set in that case.

Interestingly, adding a semi-colon after "AttributeEnd" and before the next
statement causes the indentation the line up-correctly.

Is there any particular reason that statement should behave that way and is there
something that can be added to the configuration for this to behave as intended?

I've updated the
gist if
anyone wants to take a look at the code.


texts: Where does the output of the `\showthe` command go to under AUCTeX?

texts:
Consider the following LaTeX document.

\documentclass{article}
\begin{document}
\showthe\parindent
\end{document}

According to p. 215 of Donald Knuth's The TeXbook, 20th revised printing (Addison-Wesley 1991)

  TeX's primitive command '\showthe' will display on your terminal exactly what '\the' would produce in an expanded definition; the expansion is preceded by '>' and followed by a period. For example, '\showthe\parindent' will display
    > 20.0pt.
  if the plain TeX paragraph indentation is being used.

Where is the output of the \showthe primitive directed to by AUCTeX?


texts: Exploring org-mode outlines without Emacs

texts:
I'm looking for a way to share org-mode outlines such that

it is accessible to non-Emacs users;
preserves as much of org-mode's expand/collapse functionality as possible.

I know that one can export *.org files to, e.g., HTML, but I find that viewing such exports in a web browser is far less useful than viewing the original org-mode outline with Emacs.  With the export one gets "everything all at once", thereby losing the ability to selectively "zoom in and out of nodes", so to speak.

What I miss most are the following:

the ability to expand and collapse headings;
visibility cycling;
org-narrow-to-subtree/widen (aka C-x n s/C-x n w)


texts:
Without physically inserting videos that reside in ./Videos directory and instead use MPV player or another Unix video player and make it show embedded in the same document like html web page.

Emacs should read videos from the directory location instead of working as a native player which is impossible to achieve.

I'd like to see rich multimedia content. If not possible to play the video in the same window then it should at least show the image and after clicking it should open in another window the media content.

If it can't be done I'd be upset.


texts:
Sadly I am stuck using Emacs version 21.4 in a work environment.  Despite this I would very much like to be able to use rgrep.

Either the version of Emacs 21.4 I have has been stripped down, or rgrep doesn't ship with rgrep.  I have transferred the grep.el from a 24.5 system.  When I try to byte-compile grep.el and it's require dependencies I get the following error in macroexp.el:

Invalid read syntax ((". in wrong context"))

I can't find any syntax errors in macroexp.el ( and would be very surprised to find any) so I'm wondering if this is a version (in)compatibility issue which I can overcome with some simple edits?


texts: Simplest Pattern for matching Identifiers in complex Regular Expressions?

texts:
I frequently need a regular expression, that approximately matches identifiers in a given environment. Ignoring the "must not start with a number" requirement, this would mean e.g.

[[:alnum:]_]+      e.g. Python, C, ...

When used in complicated expressions, this is rather verbose. So I was wondering if there is any shorter way to express "character that may be part of an identifier or keyword".

Things that didn't work:

\w or \sw  . . . . Matches only word characters.
\s_  . . . . . . . Matches symbol constituents,
                   EXCEPT for word characters.
\(?:\w\|\s_\)  . . Does the job, but very verbosely.
                   Delegates knowledge of the languages rules
                   to the syntax table.
\_<.*?\_>  . . . . Works for simple cases, but breaks down
                   when trying to be specific; e.g. \_<.*?z\_>
                   will match the whole line
                      foo bar baz
                   rather than just "baz".


texts: How can I move/kill multiple chunks of text to the same place/marker, one after another?

texts:
The task: I have a large-ish file, from which I need to pick certain chunks of text and move them into a certain place so they go one after another, in the order in which I pick them. More specifically, it's an Org-mode file, and the chunks are headings (possibly with subtrees). The target file may be the same, or it might not.
Question: is there a package/mode or something, that would let me specify the target place and then add chunks of text there while I roam around and point out the pieces to cut?
My attempts at finding such a thing turned up nothing so far, however the search terms are rather generic so the results are messy. I've thrown together code that inserts multiple items from the kill ring—I kill the chunks then insert them; but this doesn't seem quite clean, especially if I ever manage to save the file with the cuts made and have Emacs or the machine crash before inserting the text. Plus, the workflow doesn't feel right.
Double kudos if the solution handles Org-mode headings: e.g. adjusts the inserted ones to the level of the ones in the target place. Triple kudos if I can bind it in Evil right away, i.e. it works with text objects.


texts: how to hook tern and web mode on certain files

texts:
I would like for tern to work only on React related files and Tern to only activate when working on React files with Web Mode turned on. Currently, I have tern generally set up with Web Mode, but the issue is that when I edit, let's say, a php file, Tern activates even though it does not need to. So, I would like for Tern to work in the context of Web Mode when I edit a React file only and NOT when I edit other Web Mode related files. Is this possible? Below is my setup, please assume Company is set up as well.
web mode setup
(use-package web-mode
    :defer 2
    :after (add-node-modules-path)
    :ensure t
    :mode ("\\.html?\\'"
           "/themes/.*\\.php?\\'"
           "/\\(components\\|containers\\|src\\)/.*\\.js[x]?\\'"
           "\\.\\(handlebars\\|hbs\\)\\'")
    :config (progn
              (setq
               web-mode-markup-indent-offset 2
               web-mode-css-indent-offset 2
               web-mode-code-indent-offset 2
               web-mode-enable-auto-closing t
               web-mode-enable-auto-opening t
               web-mode-enable-auto-pairing t
               web-mode-enable-auto-indentation t
               web-mode-enable-auto-quoting t
               web-mode-enable-current-column-highlight t
               web-mode-enable-current-element-highlight t
               web-mode-content-types-alist
               '(("jsx" . "/\\(components\\|containers\\|src\\)/.*\\.js[x]?\\'")))))

tern setup
(use-package tern
    :ensure t
    :ensure-system-package (tern . "npm i -g tern")
    :config
    (add-hook 'js2-mode-hook 'tern-mode)
    (add-hook 'web-mode-hook 'tern-mode))

(use-package company-tern
    :requires tern
    :ensure t
    :config
    (add-to-list 'company-backends 'company-tern))


texts: What is this mode and how can I quit it?

texts:
Through some key combinations somehow I am trapped in this mode:

Orange highlight appears on the left hand side and a orange cursor is activated. It does not look like it is selecting anything.

I tried CTRL-g but I cannot get out of this mode.

My questions:

1) What is this mode? It is not obvious in the status bar

2) How can I get out of this?


texts: org-archive-subtree: Invalid ‘org-archive-location’ Mark set

texts:
I get this when I try to archive a subtree. My config reads

(setq org-archive-location "~/mega/org/archive.org")

which does exist. So what am I doing wrong here?


texts: Magit - Undo last commit - History Manipulation

texts:
This StackOverflow question has the best solutions/approaches to undo last commits.

I started using Magit a couple a weeks ago and after looking through all its documentation I still don't have a definitive/best way to undo a mistakenly committed change.

For example:
For undo and redo the last commit we can use:

$ git commit -m "Something terribly misguided"
$ git reset HEAD~
<< edit files as necessary >>
$ git add ...
$ git commit -c ORIG_HEAD # To keep the same commit message

What should be the best workflow to reproduce this procedure using Magit?


texts: Exclude Cancelled items from Org Mode Agenda

texts:
is there a straightforward way to exclude an item starting with

* CANCELLED

from the agenda?

it seems like there is probably an easy way to do this in the docs by setting a variable in init.el but I haven't found it.

thanks


texts: automatically move to n-th character on line after each C-n or C-p

texts:
this feature would go nicely with emmet mode.
With emmet-mode, I can expand li*3 to

effortlessly.
But after i enter something in between first tags. i have to scroll to the right position on moving to next line which is inconvinient.

This lock i'm looking for would do awesome job.


texts: How do I turn off Spacemacs’s tildes on empty lines?

texts:
I just installed Spacemacs, mainly for its nifty defaults. One default I'm not so pleased about is that it puts tildes on empty lines in the file.

I've tried putting (setq vi-tilde-fringe nil) and (setq indicate-empty-lines nil) inside the dotspacemacs/user-config function, which seem to have no effect.

How can I get rid of all these messy tildes once and for all?


texts: Quickly Adding a Value to a Numeric Property (in Org-Mode)

texts:
Suppose we have

*** Sample Task
:PROPERTIES:
:Tally:    42
:END:

Is there a way to quickly add a number to :Tally: without having to compute the sum manually and changing the property by hand?

EDIT: I tried making an interactive region selecting function which replaces the first instance of :Tally: with the added value:

(defun tally-add (start end num)
  (interactive "r\nn Number:")
  (query-replace-regexp ":Tally:\ *\([0-9]+\)" "\,(format ":Tally: %d" (+ num \#1))" start end))

However, when running on a region I get "%d Symbol's value as a variable is void".


texts:
I'd like to use the internal shr "package" of emacs to display local images. The thing is that I can display online images but not local ones, that's quite strange isn't it!

Reproduce:
Put in a random buffer this file:

<meta charset="UTF-8">

    <meta http-equiv="content-type" content="text/html; charset=utf-8">

Extern file:

Intern file:

And call M-x shr-render-buffer. The online image is displayed, not the local one...

-- EDIT --
After the proposition of the comment, I upload the full html I'm using, as well as a screenshot. I'm also using GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.30).

<meta charset="UTF-8">

    <meta http-equiv="content-type" content="text/html; charset=utf-8">

Extern file:

Intern file:

-- EDIT 2 --
I have no idea why, but I tried to restart emacs and try again (same code with file:///tmp/... for sure because it was saved in a file), and now it works perfectly... I've no idea what happened, I need to investigate. Thank you!


texts: split-string: splitting on backslash character

texts:
I intend to apply the split-string function to the following string

"\ghjky\dfsgi\45fdj\854f"

using the character "\" as a separator in order to get the list ("ghjky" "dfsgi" "45fdj" "854f").

I could use the following function

(split-string "\ghjky\dfsgi\45fdj\854f" "\" t)
;; return: forward-sexp: Scan error: "Unbalanced parentheses"

but it does not work, as the separator is not recognized

Then I try

(split-string "\ghjky\dfsgi\45fdj\854f" "\\" t)
;; return: split-string: Invalid regexp: "Trailing backslash"

but it still doesn't work

(split-string "\ghjky\dfsgi\45fdj\854f" "\\\\" t)
;; ("Ghjky^?fsgi%fdj854f")

Other attempts:

(defun split-now (astr)
    (interactive "sEnter a string: ")
    (split-string astr "\\\\" t))

(split-now "th\jki\fgt\y")
;; return: ("thjki^Lgty")

What is the correct procedure?


texts: Cursor's color differs from what specified in the frame parameters

texts:
This question is related to this one: resize-temp-buffer doesn't work in my code when 2 windows are diplayed into the frame
If I open emacs from scratch and I evaluate:
(frame-parameter nil 'cursor-color)

I get: "#4c4c4c" that is a shade of gray (https://www.color-hex.com/color/4c4c4c). But my cursor is diplayed "white":

What's controlling the cursor color?
If I use current-frame-configuration and set-frame-configuration like in the related question, the cursor color is turned into grey.
I'm using GUI emacs on Ubuntu-mate 20.04, Emacs version 26.3.
I also have:
(custom-set-variables '(frame-background-mode (quote dark)))

in my .emacs, and I suspect that this cause the issue.


texts: Doc-view not working despite gs being in my path

texts:
I have trouble getting the doc-view-mode displaying pdfs. Here's the error message generated :

No PNG support is available, or some conversion utility for pdf files is missing.

From what I've gathered, I must make sure that gs is in emacs path variable. Again, all of this looks good, the path given by

$which gs

is also found in (getenv "PATH").

So I'm not too sure where the bug comes from, any idea?

Running OS X 10.10.3, Emacs 24.4, ghostscript 9.15


texts: Emacs equivalent of the following vim operation

texts:
In the answer to a question on Quora, Gilles Castel wrote an answer highlighting the power of vim.
The Question was:

  How would you write a C program to print 1 to 100 without loop, recursion, or goto?

Here is the link to his Answer

How would one go about implementing the same in Emacs?


texts:
I have a general emacs.org file that I load at init time with org-babel. It's made for desktop use, and I load a bunch of IDE features, face customizations, powerline and so on. However, I also sometimes use emacs on a headless server, where such configurations don't make sense but still take time loading (especially since the server is much less powerful than my desktop). But I would still like to keep other blocks (e.g. ivy, undo-tree etc). I could just take my emacs.org and delete unnecessary blocks when putting it on my server, but now I have two different files to manage, which is a pain.

Is there a way to tell org-babel "only load these code blocks"? For example by filtering tags of headers?


texts: Archive all marked entries with evil-mode

texts:
I recently switched to evil mode and cannot figure out how to archive all marked entries at once.
The way I did it earlier, when I was in a list seeing the candidate entries for archiving I pressed * to mark them all (this works) and then B $ to archive them in bulk. But now B is a motion command and means bo back a word. Is there an evil-mode equivalent of B $? I know that dA stands for $ but I cannot figure out how to do this for all marked entries.


texts:
Using a simple keyboard macro, I copied the Font Awesome Cheat Sheet into an org table. However, I experience some weird inconsistencies when it comes to the formatting - see the picture below:

Any ideas how that happens and how to fix it?


texts: How to use global prefix command key in define mode-map keybinding?

texts:
I have a global prefix command key define like following:

(unless (boundp 'help-document-map)
  (define-prefix-command 'help-document-map))
;; (define-key my-programming-prefix-k (kbd "h") 'help-document-map)
(global-set-key (kbd "C-h d") 'help-document-map)

And then I want to use it in following mode-map defining keys.

(eval-after-load "helm-cscope"
  '(progn
     (define-key helm-cscope-mode-map (kbd "M-t") 'helm-cscope-find-symbol)
     (define-key helm-cscope-mode-map (kbd "M-r") 'helm-cscope-find-global-definition)
     (define-key helm-cscope-mode-map (kbd "M-g M-c") 'helm-cscope-find-called-function)
     (define-key helm-cscope-mode-map (kbd "M-g M-p") 'helm-cscope-find-calling-this-funtcion)
     (define-key helm-cscope-mode-map (kbd "M-s") 'helm-cscope-select)))

So how do I define this keybinding?


texts: Fontlock markup disappers when visual line is active

texts:
I have the following setting in my .emacs.d folder.
(defface org-commentary
  '((t :foreground "tan1"))
  "Face for commentary text in org mode")

(defface org-commentary-delimiter
  '((t :foreground "tan4"))
  "Face for commentary text delimiter in org mode")

(defun org-add-my-extra-markup ()
  (add-to-list 'org-font-lock-extra-keywords
               `(,(rx (group "{{")
                      (group (+? anything))
                      (group "}}"))
                 (1 '(face org-commentary-delimiter)) ;; use '(face default invisible t) to make invisible
                 (2 '(face org-commentary))
                 (3 '(face org-commentary-delimiter)))))

(add-hook 'org-font-lock-set-keywords-hook #'org-add-my-extra-markup)

As can be seen in the sample org document below, syntax highlighting is
unstable for the Chinese text - color disappers when the visual line is
selected.
* Sample Text

** Lorem Ipsum

Nullam eu ante vel est convallis dignissim.  Fusce suscipit, wisi nec facilisis facilisis, est dui fermentum leo, quis tempor ligula erat quis odio.  Nunc porta vulputate tellus.  Nunc rutrum turpis sed pede.  {{Sed bibendum.  Aliquam posuere.  Nunc aliquet, augue nec adipiscing interdum, lacus tellus malesuada massa, quis varius mi purus non odio.  Pellentesque condimentum, magna ut suscipit hendrerit, ipsum augue ornare nulla, non luctus diam neque sit amet urna.}}  Curabitur vulputate vestibulum lorem.  Fusce sagittis, libero non molestie mollis, magna orci ultrices dolor, at vulputate neque nulla lacinia eros.  Sed id ligula quis est convallis tempor.  Curabitur lacinia pulvinar nibh.  Nam a sapien.

** Chinese

大學之道，在明明德，在親民，在止於至善。知止而後有定，定而後能靜，靜而後能安，安而後能慮，慮而後能得。物有本末，事有終始，知所先後，則近道矣。{{「明明德」，謂顯明其至德也。止，猶自處也。得，謂得事之宜也。○大，舊音泰，劉直帶反。近，附近之近。}}古之欲明明德於天下者，先治其國。欲治其國者，先齊其家。欲齊其家者，先脩其身。

Notice how the highlight disappears on the second visual line when that line is active.

This seems to be resulting from the latest emacs upgrade, from 26.3 to 27.1.
Can this be fixed without downgrading back to 26.3?


texts: What is the difference between ' and #' in front of a symbol?

texts:
I'm a little new to Emacs.
When looking at some of the configurations, I found there are two types command in "add-hook".

(add-hook 'LaTeX-mode-hook #'LaTeX-math-mode)

and

(add-hook 'LaTeX-mode-hook 'LaTeX-math-mode)

This has confused me for a long time and I don't know how to search "#'" in google...

Thanks.


texts:
I thought I could just use minibuffer-local-map but it isn't working.

With emacs -Q I eval:

(define-key minibuffer-local-map (kbd "TAB") nil)

Then open up M-: and hit C-h c TAB and it says TAB runs the command completion-at-point. What gives?

What I really want to do is map tab in the minibuffer to helm-lisp-completion-at-point. It also would be helpful if I could map it only for eval-expression but that's not required.


texts: How do I keep the cursor from going to the beginning of the line when there's no text on said line?

texts:
I want the cursor to stay in the same column whilst moving up and down on tabbed lines.

But instead the cursor goes to the beginning of the line if there's no text on that line.

How do I get rid of this cursor behavior?


texts: How can I rotate and then save an image with Emacs 27.1?

texts:
It's nice that 27.1 has in-built image rotation.  No dependency on ImageMagick for that.  However, it seems to only allow rotation for viewing (r/l) while I don't see any way of saving that rotated image.  Upon rotation I don't see the buffer marked dirty.
Am I missing something or is it simply unsupported?
More general solutions of saving a buffer's contents as-is would be nice too.  I'm uninformed here.


texts: Does Dired have something like "New Folder with Selection" of macOS Finder?

texts:
I want to create new folder then move file that is marked to that folder in emacs dired mode.

In macOS Finder, you can use the new folder with selection.

Is there a feature like this in emacs or emacs dired mode?

I'm using emacs 25.1.


texts: How to properly define hydras inside use-package?

texts:
For example, I use undo-tree and have the following in my config file:

(use-package undo-tree
  :ensure t
  :diminish (undo-tree-mode . "")
  :config
  (global-undo-tree-mode 1))

Now I want to use the hydra taken from the hydra wiki:

(defhydra hydra-undo-tree (:hint nil)
"
  _p_: undo  _n_: redo _s_: save _l_: load   "
  ("p"   undo-tree-undo)
  ("n"   undo-tree-redo)
  ("s"   undo-tree-save-history)
  ("l"   undo-tree-load-history)
  ("u"   undo-tree-visualize "visualize" :color blue)
  ("q"   nil "quit" :color blue))

(global-set-key (kbd "C-x u") 'hydra-undo-tree/undo-tree-undo)`

What would be the proper way to define the hydra inside use-package and set the keybinding using :bind?


texts:
I write from time to time: tales, short novels, etc.  Everything in Spanish (I'm not very fluent in English).  And I use Emacs since long time ago for everything I write (not only Literature related texts, but for programming, task management, etc.).

I would like to set up a synonyms service to be used from inside Emacs. And I needed for Spanish. I know there are some very good ones for English, but I couldn't find anything for Spanish.  Is there anyone that knows one of this services, and how to set them up with one of the already known Emacs packages?

An alternative would be to try to find such a service with a REST API, and try to set up some functions to request synonyms for the word at point to this service using the REST interface. I'm an experienced programmer, but not with Emacs Lisp, and I don't know if this is two much for me.  Any hints on libraries of ways to do this, if an already existing solution is not available?


texts: Starting emacs with eshell and file from command line argument

texts:
I am trying to start emacs with both eshell and the specified file, but displaying the buffer with the file.

When I add the following line to emacs

(add-hook 'emacs-startup-hook (lambda () (eshell)))

then eshell also loads on startup with the file, but eshell is shown instead of the file.

I tried to change the initial-buffer-choice variable so that the file is shown instead, but am not sure what function to give to return the file specified in command line.
Can anyone please give me some ideas?


texts: Magit git commit isn't working on spacemacs

texts:
After installing Magit in spacemacs. I used Helm to create a git repository. I added some files to stage then tried to commit. Let me know if I'm doing something wrong or it's just an issue.
I get:
transient--emergency-exit: Wrong type argument: transient-suffix, [eieio-class-tag--transient-switch 1 nil nil nil nil nil nil nil nil ...]

I've also put this question:
github
gitter
reddit
Ubuntu 18.04.3 LTS
The rest was:

Emacs: 25.2.2
Spacemacs: 0.300.0
Spacemacs branch: develop (rev. 76ce0ac)

Reinstalled Emacs same version and spacemacs stable Spacemacs v.0.200.13 and I have the same issue.
Full trace:
    Debugger entered--Lisp error: (wrong-type-argument transient-suffix [eieio-class-tag--transient-switch 1 nil nil nil nil nil nil nil nil "-a" transient:magit-commit:--all t " %k %d (%v)" "Stage all modified and deleted files" nil nil nil nil nil nil nil nil nil "--all" "-a" nil unbound nil nil nil nil nil nil nil nil] object)

signal(wrong-type-argument (transient-suffix [eieio-class-tag--transient-switch 1 nil nil nil nil nil nil nil nil "-a" transient:magit-commit:--all t " %k %d (%v)" "Stage all modified and deleted files" nil nil nil nil nil nil nil nil nil "--all" "-a" nil unbound nil nil nil nil nil nil nil nil] object))

transient--emergency-exit((wrong-type-argument transient-suffix [eieio-class-tag--transient-switch 1 nil nil nil nil nil nil nil nil "-a" transient:magit-commit:--all t " %k %d (%v)" "Stage all modified and deleted files" nil nil nil nil nil nil nil nil nil "--all" "-a" nil unbound nil nil nil nil nil nil nil nil] object))

transient-setup(magit-commit)

magit-commit()

funcall-interactively(magit-commit)

call-interactively(magit-commit nil nil)

command-execute(magit-commit)


texts: Can't hide leading stars on selected row in org mode

texts:
Emacs 26.3

or this

As you can see it shows leading stars on selected row.
I want to hide them. I try this:
'(org-hide-leading-stars t)

But it does not help: stars are not hidden.


texts:
More often than not, when I open a dired buffer, I press

( to run dired-hide-details-mode
s to rundired-sort-toggle-or-edit

What's a good way to have these done automatically every time I open a dired buffer?


texts: Overlapping table of figure (and tables) label when running auctex from a non master file

texts:
The problem is: When I run C-c C-a (TeX-command-run-all) from the master file it goes well and produce the following output,

but then, when I edit other .tex file (abstract.tex for instance) and run again C-C C-a, it asks for setting the master file and everything goes smoothly except it renders the following result for the list of figures (and tables as well):

Even if I undo the changes made, I cannot obtain the correct rendering again.

It seems to be a problem with auctex handling multiple files.

My question is: What does auctex do differently when running from a non-master file and if there is a solution for this overlapping label problem.


texts:
windows 10, emacs 26.1

I open 4 frames.
How I can quick switch between them?

I need smt like this:

C-1  -> switch to frame#1

C-2  -> switch to frame#2

and so on.

I use ace-window but it not very compfortable because:

1. Create frame#1
 2. split it to 2 windows
 3. create frame#2
 4. split it to 3 windows
 5. create frame#3
 6. On screen visible only one frame (e.g. frame#2)

And now try to quick switch between frames. It very hard.
Ace-windows show me 6 numbers (1,2,3,3,4,5,6). And how I select quick desire frames?
It's hard.


texts: I have a large set of my own tags that I've added to org-tag-alist that I use liberally to tag headings throughout my org files. I would like to search throughout my org directory (recursively) on a tag. Oddly, such an obvious thing doesn't seem to be possible with normal tag search described here. Do I simply need to use grep or something at the system level?


texts: org-mode report with start and end time for each day of the week

texts:
I'm starting to use (a total newbie, actually) org-mode clocking commands to track time spent during the job day.

I need to fill some reports on daily start and end time of my work day.  This is just: I sat to code at 9am and left at 1pm.  For each week's day.

I've been reading through the docs and I can just find reports based on the task items and don't see how to accomplish my report.

Where can I start to look at or what docs would you recommend?

Thanks.


texts: Yank a column of text copied from the clipboard

texts:
I often seem to want to copy paste multiple columns, for example, I paste one column

line one
line two
line three

Now I'd like to be able to yank another column behind it. Assuming my kill buffer has the following:

added to one
added to two
added to three

Which command would I need to invoke to get the following:

line one added to one
line two added to two
line three added to three

Update

Using the rectangles functionality of Emacs helps quite a bit, but is still suboptimal. For instance, if using Emacs in graphical mode and you are yanking from external programs, i.e. using the Copy-paste functionality from your OS, the kill-buffer has no rectangular meta info, so rectangular yank does not work.
Another issue is if you are having a columns with varying internal width:

short line                        *
a much larger line which goes on
short line again

And you want to rectangular yank, you'll have to place your pointer at the marked spot (*). Although this is trivial with three lines, it can be quite cumbersome to make sure you are placing the pointer at the most outer edge of the first column.


texts: How does package-autoremove decide which packages to remove?

texts:
I am frequently prompted when updating my current packages to run package-autoremove which claims to remove outdated or unnecessary packages. However it always seems to remove (along with those outdated packages) two packages which I do use (namely aurora-theme, my current theme of choice and dired+).

I'm afraid I'm something of a novice when it comes to Emacs-Lisp and I was just wondering if there was a way I could stop package autoremove deleting these packages so I didn't need to keep reinstalling them.


texts: How to make Emacs "forget" code evaluated in scratch buffer?

texts:
I have a function named my-func in my init.el.  I copy this function to the scratch buffer, make some changes to it and evaluate it with C - j. I then delete the code in the scratch buffer and then call my-func, but it executes the scratch version, not the init.el version.

How can I make Emacs forget code evaluated in the scratch buffer ?


texts: Why isn't (TeX-current-macro) a member of '(chapter section)?

texts:
Consider the variable TeX-current-macro raised in the recent question detect if inside a LaTeX footnote and get its bounds? also in https://emacs.stackexchange.com/a/7634/2690.
I would like to determine if I am inside the macros chapter or section in a latex file, I can write define a function which shows yes if it is the case, otherwise no.
Of course I can use the following which does the job.

 (defun foo-test () (interactive)
    (if (or (equal (TeX-current-macro) "chapter")
(equal (TeX-current-macro) "section"))
(message "yes") (message "no"))
    )

But it is long. Like in my previous question What is the easiest way to check if a character belongs to a particular set of characters?, I am wondering if there is a better way to do it.
Inspired by the answer https://emacs.stackexchange.com/a/7880/2609, I tried the below code, but unfortunately it doesn't work.
I also tried with memq instead of member but it doesn't work either.

 (defun foo-test () (interactive)
    (if (member (TeX-current-macro) '(chapter section))
(message "yes") (message "no"))
    )

Any solution about checking if the value of a  variable belong to a list of elements is welcomed.


texts:
I wish to play chess with chess.el on a FICS server using M-x chess-ics but using that logs me as a guest player. How can I login with my registered user/password?

EDIT

I've come with a way to login. At the beginning of chess-ics.el comes a list of servers, I can edit it and add my username (or handle) in front of "freechess.org" 5000 as a new arg for connection. Then M-x chess-isc will ask me my password and that's it. (I have to use set seek 1 when already logged in to get the extra seek buffer, and set availinfo 0 to stop  the annoying noise on  the freechess buffer).

Anyway, now my issue is this, I don't like editing the chess-ics.el file to tell that I want to log in as my username. How can I tell M-x chess-ics that I want to use my username for connection? I've tried C-u M-x chess-ics but it seems the chess-ics.el script doesn't support that.

I am guessing I need to make some custom command or something (sorry for the newbie language here) so that I can call not  the default (chess-ics) but the (chess-ics my-username) which in turns calls what I want. Am I right? So I need to defun something and overwrite the default M-x chess-ics to call my new function. Is  that it? What would be the correct syntax  to do this. I'm really pretty new on hacking emacs lisp :(


texts: Seeking an editing mode to ensure appropriate percolation of changes in function signatures

texts:
Function calls come in chains. f1 calls f2; f2 calls f3; etc.

When the signature of one function along the chain changes during refactoring, the change often percolates up and down the chain.

With stock Emacs one can simply use C-x 3 (split-window-right), but that means frequently bringing down the split (C-x 1, C-x 0), and continuously hunting down for the path/to/file along the chain of files.

A user interface that would make it possible to swipe to left/right along the chain would be nice. Can you suggest a mode that would facilitate this kind of interaction?

On a Mac, Desktops somewhat help, as in the picture below. Though this still requires a lot of synchronization between (Mac) Desktops, (Emacs) frames, and (Emacs) windows.

Ideally, C-x 3 would be within a special mode that is augmented with, say, push-window-vertically-on-right, followed by shift-windows-vertically-left/right. Does anything resembling this already exist?


texts: How to expand truncated information displayed in the echo area?

texts:
I am reading the Elisp Reference Manual. I have noticed that some informations are truncated (ellipsis: suspension points) while they are displayed in the echo area. How to view (know) their full value?

For instance, look at the example given to introduce the function buffer-local-variables, Variables, Buffer-Local Variables, Creating Buffer-Local.

(make-local-variable 'foobar)
(makunbound 'foobar)
(make-local-variable 'bind-me)
(setq bind-me 69)
(setq lcl (buffer-local-variables))
    ;; First, built-in variables local in all buffers:
⇒ ((mark-active . nil)
    (buffer-undo-list . nil)
    (mode-name . "Fundamental")
    ...
    ;; Next, non-built-in buffer-local variables.
    ;; This one is buffer-local and void:
    foobar
    ;; This one is buffer-local and nonvoid:
    (bind-me . 69))

The function buffer-local-variables returns a list describing the local variables defined in the current buffer. Unfortunately, the echo area does not display all the variables.

((buffer-display-time 23545 18944 425229 321000) (buffer-display-count . 2)\
 (buffer -invisiblity-spec . t) (buffer-file-truename) (point-before-scroll)\
 (buffer-auto-save-file-format . t) (buffer-file-format) (enable-multibyte\
  -characters . t) (mark-active . t) (bidi-paragraph-direction . left-to-right)\
 (local-abbrev-table . [## 0 0 0 0 0 0 0 0 0 0 0 ...])\
 (mode-name . "Lisp Interaction") ...)

The local variables foobar and bind-me are not displayed in the echo area although they are members of the list.

(assoc 'bind-me lcl)
⇒ (bind-me . 69)

How can I view the full `package-alist` value (without the truncation characters "...")?
What is the meaning of the ellipsis at the end of some output?


texts: Set environment variables for spawned subprocesses

texts:
I would like to set the environment variables for a spawned subprocess only.
They are controlled by process-environment. The documentation says:

  binding that variable with let is also reasonable practice.

In this example I try to unset HOME with:

(defun f()
  (let ((old-home (getenv  "HOME")))
    (let* ((process-environment process-environment)
       (process-environment (setenv-internal process-environment  "HOME" nil nil)))
      (start-process "proc" nil "notepad"))
    (string= old-home (getenv  "HOME"))))

(f)

(f) returns nil and process-environment is permanently changed (outside the let*).

Another thing, that happens when debugging, is that concurrent processes using HOME (for example Emacs autosave hooks) might fail crashing the debug session.

An alterative would be to use two setenvs before and after start-process. It still would not solve the conflict with concurrent processes (and does not explain how to use process-environment inside a let).


texts: how can I change the inferior Python process

texts:
I would like to be able to start Python 3 and ipython from Emacs in an inferior mode buffer. Currently start interpreter C-c C-p starts 2.7.
I know there must be a way to change to start another python environment.


texts: Emacs 24.3: warning "Unable to activate package"

texts:
Upon startup of my emacs 24.3, I'm getting the errors:

Warning (emacs): Unable to activate package `with-editor'.
Required package `emacs-24.4' is unavailable

I have a dim recollection that when I first started this job, I sometimes used another machine that had 24.4, and with-editor may have been some package used by the coworker (since left) who had a more advanced emacs version in their home directory and who had suggested I copy some of their configuration.

However, if I grep my .emacs, .emacs.d recursively, or my .emacsinit, I don't see with-editor.

Running emacs -Q doesn't have the error.

What is causing it, and to the extent stackoverflow lets me ask, what techniques could I be using to troubleshoot this myself?


texts:
Windows 10 (64 bit), Emacs 26.1, dired+-20170818.1411

I want (in dired mode) to open all folders in ONE buffer when press Enter.
So in my init.el

(diredp-toggle-find-file-reuse-dir 1)

But it not help


texts: Shell doesn't accept commands after ssh login or R or Python

texts:
This used to work just until recently, no idea what happened maybe an updated version of something is causing the problem.

In the shell buffer in Emacs, shell seems to stop working after SSH or launching R or Python. Say, if I launch R in shell buffer, R loads and when I enter any command and press Enter the cursor just moves to a new line, no command is sent. But the shell responds to C-c C-c and cancels the command and returns the prompt. I've tried issuing comint-send-input manually with M-x but that didn't work either. I've also tried this with "bare" Emacs, launching it with the -Q option, same.

For SSH, the problem occurs for bash but not for zsh.

I've just used zsh to launch R and I get "^G" inserted at the end of the command after pressing Enter. I think that is the problem. No idea how that occurs, if hadn't tried zsh with R never would have seen it as it doesn't print on screen with bash.

GNU Emacs 26.3 on Ubuntu 19.04


texts: mmm-mode strange behavior with perl-shell-script

texts:
Background: I've been working with a program that is about half Bash
and half perl.  I thought I'd give mmm-mode a try since it sounded
like just the mode for me.  I don't know lisp well enough to be
useful.

I used "elpa" to install mmm-mode.  It didn't install the
documentation anyplace my emacs could find it.  There was no
mmm.info file anywhere on the system (though there was a texinfo file).  So I downloaded the
mmm-mode-master.zip and installed it.  So far, so good.

I added the following to my ~/.emacs file.

(require 'mmm-auto)

(setq mmm-global-mode 'maybe)

(mmm-add-mode-ext-class 'perl-mode nil 'perl-shell-script)

(mmm-add-group 'perl-shell-script
 '((perl-shell-script-here
    :submode shell-script-mode
    :face mmm-default-submode-face
    :front "#begin-shell-script-mode\n"
    :back "#end-shell-script-mode\n"
    :save-matches 1)))

I based this on this post: Multiple major modes in one buffer (e.g., python-mode & LaTeX-mode) I think the :save-matches is unused in my case, but it shouldn't be an error.

The problem: The <tab> key doesn't work within the "shell-script"
portion of the file.

I "believe" that mmm-mode is working correctly.  The highlighting
changes.  The mode line changes.  It seems to contain the correct
information: (Perl[Shell-script] MMM).

I checked the  key binding (C-h k): TAB (translated from <tab>) runs the command indent-for-tab-command.

But all it really does is insert a '\t'.

I can't tell if the trouble is mmm-mode, shell-script-mode, or
perl-mode (I'm not using cperl-mode at this point).

Any ideas?

-E

Sample file:

#!/usr/bin/perl

while(<>) {
    print;
}
printf(<<"BASHSHELL",
#begin-shell-script-mode

while getopts "ca" options; do
    case "\${options}" in
    c )
        echo "Cleaning up."
        cleanup
        exit 0
        ;;
    a )
        echo "Setting auto clean up for %s."
        AUTOCLEANUP=1
        ;;
    * )
        echo "Usage: \$0 [-c]"
        exit 1
        ;;
    esac
done
#end-shell-script-mode
BASHSHELL
       "FOO");


texts: Adding "date completed" timestamp in org-mode

texts: In org-mode, I would like to add a timestamp to a TODO marking the date completed. What is the best way to do this?


texts: How to use counsel-git-grep without using back slash

texts:
I am using counsel-git-grep to grep for a string in the current Git repository.
Lets assume I am searching string " [ok] ". In order to obtain correct results I have to provide input as " \[ok\] " ; where \ should be added before some characters like [, ], ", etc.
Is there any way achieve the grep results without using \?


texts: how to enable pdflatex --shell-escape switch in org-export dispatcher interface

texts:
I would like to add a switch when invoking the org-export dispatcher interface for latex-pdf exports. I'm trying to render an SVG image but the *Org PDF LaTeX Output* buffer errors out because of a missing commandline switch --shell-escape during pdflatex compilation. The result is a PDF that does not render my SVG image. So, how can I add this switch to my pdflatex compilation when exporting from Org Mode?

Package svg Warning: You didn't enable `shell escape' (or `write18')
(svg)                so it wasn't possible to launch the Inkscape export
(svg)                for `svg-sequence1.svg' on input line 107.

! Package svg Error: File `svg-sequence1_svg-tex.pdf' is missing.

See the svg package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.107 ...udesvg[width=.9\linewidth]{svg-sequence1}

! Package svg Error: File `svg-sequence1_svg-tex.pdf_tex' is missing.

See the svg package documentation for explanation.
Type  H <return>  for immediate help.


texts:
Is it possible to add priority to items of a list using orgmode?

Something like:

- [#A] first
- [#A] also imporstant
- [#B] important but a bit less

If possible, What about lists with check boxes?


texts: emacs-snapshot: Could not find simple.el or simple.elc

texts:
I tried to install emacs-snapshot through their PPA on a fresh Ubuntu 14.04 LTS:

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

But when i try to start it, it gives me this error:

emacs-snapshot
Warning: Could not find simple.el or simple.elc
Cannot open load file: No such file or directory, warnings

I have also tried running it as sudo, and the same thing happens.
I do not have an .emacs.d/ folder, so it should just run as vanilla.

Do anyone have any idea how i can make it work?


texts: Batch rename files to numeric sequence in dired?

texts:
I have the following files in a directory:

CIMG4879.JPG
CIMG4880.JPG
CIMG4881.JPG
...

I want to rename them all with a numeric sequence such that:

01.jpg
02.jpg
03.jpg
...

In bash, I could convert *.JPG %02d.jpg, since they're all image files.

How do I do a batch rename in dired?  Assume I have a lot a files, so doing it one by one would be tedious and error-prone.


texts: When emacsclient open with eval using use-package it opens waiting M-x

texts:
I am trying to create a bash alias to open emacs with a calendar from terminal. To do so I am using calfw with use-package like so:
(use-package calfw
  :ensure ;TODO:
  :config
  (require 'calfw)
  (require 'calfw-org)
  (setq cfw:org-overwrite-default-keybinding t)
  (require 'calfw-ical)
  :bind ("C-c q" . 'cfw:open-org-calendar))

When I try to do
em --eval "(execute-extended-command (cfw:open-org-calendar))"

it opens with the calendar open, but it waits for a M-x command

Not sure what I am doing wrong.
Thx!


texts:
I want to delete a large attachment from a mu4e message. This thread is similar, except that the required altermime tool does not seem available on macOS (not on Homebrew and no results from an online search).
How can I delete an attachment from a mu4e message?


texts: Org mode converting spaces to tabs when evaluating source?

texts:
I am testing out the Babel feature in org-mode, with this small block.

#+BEGIN_SRC sh :results verbatim :exports both
banner -w 35 e
#+END_SRC

#+RESULTS:
:              #####
:            #########
:          ####  #   ###
:          #     #     ##
:         ##     #      #
:          #     #     ##
:          #     #   ###
:            #   #####

(The banner command writes an ASCII art heading. So in this example I'm just printing out an e, sideways. The leading whitespace characters are all spaces.)

I try to export this to TeX, and in the TeX file I see that some of the leading spaces have been replaced with tabs; namely any group of 8 spaces gets replaced with a tab. Therefore the lines don't show up properly when the TeX is exported to PDF. I had a look at the source code of org and I found that it might be org-trim causing this. There's also the option org-src-preserve-indentation, but that doesn't seem to act on the output of the source code, only the source itself. Can I stop org from converting the whitespaces to tabs?

EDIT: Just tried sed 's/<tab-character>/        /g' on the TeX file to replace each tab with 8 spaces, and the problem is fixed immediately. So org must be changing them somewhere, I just need to know where...

EDIT #2: Apparently there is some normalizing going on that might be the issue. Listing here for reference.


texts: How to make imenu jump/preview new location when switching up/down like swiper or like fzf in vim?

texts: How can I make imenu (with ivy wrapper) act like swiper, that mean auto switch to location when I use arrow key( or ivy-previous/next-line function) and if I exit it will come back to current location?


texts: How to use prefix C-SPC instead of prefix C-h, for `which-key-mode-map`?

texts:
I'd like to change the C-h prefix to C-SPC and so I added the following to my init.el, but it has no effect.

(define-key which-key-mode-map (kbd "<C-SPC>") 'which-key-C-h-dispatch)

Help understanding how to make this change would be appreciated. Thanks.


texts: Uncheck checkboxes on completing recurring task

texts:
I would like any checked checkboxes under a TODO heading to be unchecked when I mark it as DONE, if the heading is a habit and/or reoccurring. The usecase is to have a list of checkboxes under a heading to keep track of what minor issues has been completed, and then to have it cleared for next time.
I imagine the style property would be useful, but it's the general behavior I am looking for, exactly how it is achieved matter less.


texts:
By using toggle-input-method, I can disable input method when that is active.

But sometimes I just want to disable it regardless the input method status.
I couldn't find the function for it. How can I do it?


texts: What are all the ways of launching a shell from inside emacs and what are their various properties?

texts:
I know of at least four possibilities:

eshell
term
ansi-term
shell

What's the complete list of tools built-in to emacs to launch a shell, and what benefits and drawbacks do they offer?


texts:
We have a number of clauses (condition body) which we want to give to cond, like so:

(cond (condition1 body1)
      (condition2 body2)
      (condition3 body3))

But imagine that the clauses were first generated via mapcar, which gave the following list:

((condition1 body1)
 (condition2 body2)
 (condition3 body3))

Let's say that the above list is the content of variable clauses.
Now, we would like to pass it to cond, but if we do the following:

`(cond ,clauses)

it results in:

(cond ((condition1 body1)
       (condition2 body2)
       (condition3 body3)))

which does not work, instead of:

(cond (condition1 body1)
      (condition2 body2)
      (condition3 body3))

Is there a way around this problem ?


texts: How to chain after-change-hook functions?

texts:
I am trying to convert markdown to html and then use impatient-mode to display it live on browser on the fly.

Impatient mode uses after-change-hook to detect changes in html. I am using after-change-hook to detect changes in markdown buffer.

  Buffer changes made while executing the after-change-functions
  don't call any before-change or after-change functions.
  That's because inhibit-modification-hooks is temporarily set non-nil.

As documentation says it won't work.

I can use timer to update every second but I am looking for a better solution.


texts: How to query-replace with exact match with the exact given word in case-sensetive manner?

texts:
I have HELLOWORLD string inside my file.

My setup:
(defun my-find-orgfiles ()
  (interactive)
  (setq toggle-case-fold-search 0)  ; Turn Off Smart Case Sensitivity
  (find-name-dired "~/folder" "*py"))

(global-set-key (kbd "M-m") 'my-find-orgfiles)

(add-hook 'python-mode-hook
          (lambda ()
            (setq flycheck-python-pylint-executable "~/venv/bin/pylint")
            (setq flycheck-pylintrc "~/.pylintrc")))
(setq case-fold-search nil)

Than, t to toggle marked/unmarked files (thus marking them all, since none were marked). Then I use Q to use query-replace on the marked files. And enter helloword to replace with hello.

On the minibuffer I face with following:
Query replacing helloworld with HELLO: (? for help)
Than replaces HELLOWORLD into HELLO.

Here if replacement occurs I want it to replace into hello rather than HELLO, since I enter lower case hello

Since  lower case helloword does not exist in the file, it shouldn't attempt to replace anything.

Note: Adding  (setq case-fold-search nil) did not help.


texts: How to search with a regexp before point?

texts:
I would like to know a function that searches a pattern located before point.

re-search-backward is mentioned in the Elisp manual but I do not understand its purpose. Indeed, I do not understand the explanation given in the manual nor some of the cases found.

  re-search-backward regexp &optional limit noerror count

  This function searches backward in the current buffer for a string of text that is matched by the regular expression regexp, leaving point at the beginning of the first text found.

  This function is analogous to re-search-forward, but they are not simple mirror images. re-search-forward finds the match whose beginning is as close as possible to the starting point. re-search-forward finds the match whose beginning is as close as possible to the starting point. If re-search-backward were a perfect mirror image, it would find the match whose end is as close as possible. However, in fact it finds the match whose beginning is as close as possible (and yet ends before the starting point). The reason for this is that matching a regular expression at a given spot always works from beginning to end, and starts at a specified beginning position.

I did a search but found only unsatisfactory answers.

emacs greedy search-backward-regexp
Why is the order of : and - important in a regexp character class

These threads suggest that there is no standard solution. The use of skip-chars-backward seems to me particularly unsuitable because it is used for the internal workings of Emacs (see syntax.c).

Suppose the current buffer contains only a string of text composed of alphabetic characters (e.g. abc), anywhere before the point. In this case, (re-search-backward "[[:alpha:]]+") moves the point between the last two characters (between b and c) when the position is expected to be at the beginning of the text (before a).


texts: How do I use the primary, not clipboard buffer?

texts: Aka the equivalent of xclip -o -selection primary, not xclip -o -selection clipboard. primary is selection, clipboard is Ctrl-C usually.


texts: How to get Emacs to display file in browser instead of emacs itself

texts:
Consider the following link I have in my org-mode file

  [[file:./helloworld.py][LinkToFile]]

Emacs always opens source code files inside emacs. Web-links on the other hand are always opened in the browser. How can I get such source code files to be displayed in the browser instead?


texts: How do I set up indentation to 2 spaces in web-mode

texts:
I just installed web-mode. It works, but the indentation
seems to be set to 4 spaces by default. How does one
properly set it to 2 spaces?


texts: How to separate histories for different Helm prompts

texts:
When operating as separate Doctor Fates, Inza wears the helmet and
  Kent's original costume while...

– Google on helm separate history

When I press M-p in the Helm prompt for helm-git-grep I get a file path I entered previously in helm-find-files:

What I would really like to see is the pattern I searched with previously in helm-git-grep.

How to make Helm have separate mini-buffer histories for different kinds of Helm (helm-M-x, helm-mini, helm-git-grep and helm-find-files)?


texts: org-mode table "width cookie" no longer working in 27.1?

texts:
The Linux distribution I use (Fedora 32) recently upgraded the included Emacs version from 26.3 to 27.1.  With this new version, it appears that the "width cookie" for the org-mode tables are no longer working.
For example, if I have the following:
| Test Column A | Test Column B |
|---------------+---------------|
| <30>          | <5>           |
|---------------+---------------|
| Data          | Data          |
| Data          | Data          |
| ...           | ...           |

While the tags are highlighted (a.k.a. recognized), they will neither expand column "A" nor shrink column "B".  In Emacs 26.3 it was working as expected.
The additional tags <l> and <r> (either with or without a number) keep on aligning the text as before.
As a side-note: Numbers are not right-aligned unless <r> is specified for the entire column.  That was also auto-detected before.
Is this a change in behavior for which I missed to change an option or is this a bug?
The answer to this question seems to be a crude workaround rather than a solution and would not be what I was looking for.  It used to be automatic on cell change after using TAB.


texts:
I really appreciate the undo in region command in standard emacs, where you can just mark a region and only changes made in that region are undone.

This doesn't seem to work in the default spacemacs configuration.

Is there a way to activate this?


texts: Modifying the size of an asymptote image in latex export

texts:
I have been using Asymptote to make pictures that can be included in Latex documents. I recently discovered that Org mode plays well with Asymptote

https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-asymptote.html#orgbded9e5

I was able to successfully compile a Latex document with embedded Asymptote code as follows.

#+TITLE: Test Document
#+AUTHOR: A. U. Thor
#+latex_class_options: [10pt]
#+LATEX_HEADER: \usepackage[margin=0.5in]{geometry}
#+LATEX_HEADER: \usepackage{parskip}
#+LATEX_HEADER: \usepackage{graphicx}
#+LATEX_HEADER: \usepackage{asymptote}
#+OPTIONS:      toc:nil

#+BEGIN_SRC asymptote :file test.pdf
include graph;
size(1inch);
filldraw(circle((0,0),1),yellow,black);
fill(circle((-.3,.4),.1),black);
fill(circle((.3,.4),.1),black);
draw(arc((0,0),.5,-140,-40));
#+END_SRC

This generates the document as in the screenshot below.

How can I adjust the instructions in the header of the code-chunk above, to be able to manipulate the size and placement (left/right/center) of the image? Right now the image is just too big.

Note: If it helps, the generated \LaTeX source file, exported from the Org file looks like this

% Created 2019-04-13 Sat 15:26
% Intended LaTeX compiler: pdflatex
\documentclass[10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{graphicx}
\usepackage{grffile}
\usepackage{longtable}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{amssymb}
\usepackage{capt-of}
\usepackage{hyperref}
\usepackage{minted}
\usepackage[margin=0.5in]{geometry}
\usepackage{parskip}
\usepackage{graphicx}
\usepackage{asymptote}
\author{A. U. Thor}
\date{\today}
\title{Test Document}
\hypersetup{
 pdfauthor={A. U. Thor},
 pdftitle={Test Document},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 26.1 (Org mode 9.1.9)},
 pdflang={English}}
\begin{document}

\maketitle
\begin{center}
\includegraphics[width=.9\linewidth]{test.pdf}
\end{center}
\end{document}


texts: indent text up to the start of the first word of the previous line

texts: When entering text I sometimes want the indented. Is there a way to avoid having to type blank characters up to the point where the first word on the previous line starts?


texts: Under Windows, Emacs cannot handle encodings correctly for subprocesses, can it?

texts:
I have two simple text files on my D: drive, as shown below.

D:\我.txt

  I

D:\你.txt

  You

After I execute M-x diff and type the correct filenames (Yes, I can
input Chinese and filename autocomplete works fine for Chinese), the output
give the following.

diff -u "d:/我.txt" "d:/你.txt"
diff: "d:/æˆ‘.txt": No such file or directory
diff: "d:/ä½ .txt": No such file or directory

Diff finished (diff error).  Wed Jan  4 02:13:20 2017

I have MSYS2 installed with diff residing on D:\msys32\usr\bin\diff.exe.

I run Emacs 25.1.1 on Windows 7 (en-US), so the
w32-unicode-filenames is set to t, which means the native Windows
Unicode APIs is used when passing file names to the OS.  This is good,
Unicode file names display correctly in dired-mode, and autocomplete
for Unicode file names also works seamlessly.  So I suspect that
Unicode file names only cause problem when creating subprocesses with
Unicode arguments.

To verify that, I execute M-x shell and do the following.

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

$ cd
cd
d:\

$ type 我.txt
type 我.txt
The system cannot find the file specified.

$ type 你.txt
type 你.txt
The system cannot find the file specified.
Error occurred while processing: \344\275.
The system cannot find the file specified.
Error occurred while processing: .txt.

$ where cat
where cat
D:\msys32\usr\bin\cat.exe

$ cat 我.txt
cat 我.txt
cat: ''$'\303\246\313\206\342\200\230''.txt': No such file or directory

$ cat 你.txt
cat 你.txt
cat: ''$'\303\244\302\275\302\240''.txt': No such file or directory

Autocomplete for Unicode file name also ceases to work in shell-mode.

And I also try similar commands in eshell-mode invoked by M-x eshell.

Welcome to the Emacs shell

d:/ $ which which
eshell/which is a compiled Lisp function in ‘esh-cmd.el’
d:/ $ which cat
eshell/cat is a compiled Lisp function in ‘em-unix.el’
d:/ $ cat 我.txt
I
d:/ $ cat 你.txt
You
d:/ $ which ls
eshell/ls is a compiled Lisp function in ‘em-ls.el’
d:/ $ ls 我.txt
我.txt
d:/ $ ls 你.txt
你.txt
d:/ $ which ls.exe
d:/msys32/usr/bin/ls.exe
d:/ $ ls.exe 我.txt
/usr/bin/ls: cannot access ''$'\303\246\313\206\342\200\230''.txt': No such file or directory
d:/ $ ls.exe 你.txt
/usr/bin/ls: cannot access ''$'\303\244\302\275\302\240''.txt': No such file or directory

It almost confirms to me the issue is about the subprocess encoding.
Calling internal Elisp functions with Unicode arguments works fine but
calling external executables with Unicode arguments doesn't work.  I
also experiment with various encoding for subprocess. I set them in my
init file like this.

(setq default-process-coding-system '(raw-text-dos . raw-text-unix))

But to no avail, none of my attempts work.


texts:
I'm trying to use org-ref to reference to equation numbers.
It works with PDF export but never works in HTML export.
In the web page it only shows a clickable (???) link with no destination.

I tried in various ways, using \label{·}, #+label: ·, <<·>>, #+name: ·, but I never get numbering in the HTML when using \eqref{·} or eqref:·.

I get an ineffective numbering using [[·]], as the number is always 1;
although the link in the HTML points to the correct ID, clicking doesn't lead anywhere.

Is there any way to make it work as expected?


texts: Tramp hangs even without prompting passcode

texts:
I'm trying to run tramp in Emacs 24.3 in Ubuntu 14.04. The tramp hangs even without prompting for passcode (RSA Token). I'm able to connect to the remote host from terminal and also from M-x shell in Emacs. I set (setq tramp-verbose 10) in my .emacs file and the data present in *debug tramp/ssh host* is shown below

;; GNU Emacs: 24.3.1 Tramp: 2.2.6-24.3 -*- mode: outline; -*-
08:16:56.703770 tramp-maybe-open-connection (3) # Opening connection for ssh using scp...
08:16:56.704715 tramp-get-connection-property (7) # process-name nil
08:16:56.705305 tramp-get-connection-property (7) # process-buffer nil
08:16:56.707019 tramp-set-connection-property (7) # vector [scp nil ssh rbala@titan.ccs.ornl.gov nil]
08:16:56.707540 tramp-maybe-open-connection (6) # /bin/sh -i
08:16:56.707809 tramp-get-connection-property (7) # check-remote-echo nil
08:16:56.708036 tramp-get-connection-property (7) # check-remote-echo nil
08:16:56.708297 tramp-accept-process-output (10) # *tramp/scp ssh* run
08:16:56.708606 tramp-accept-process-output (10) #
#$
08:16:56.708825 tramp-get-connection-property (7) # check-remote-echo nil
08:16:56.709043 tramp-get-connection-property (7) # check-remote-echo nil
08:16:56.709276 tramp-wait-for-regexp (6) #
#$
08:16:56.709512 tramp-get-file-property (8) #  gateway nil
08:16:56.709795 tramp-set-connection-property (7) # temp-file /tmp/tramp.3232TWr
08:16:56.710451 tramp-maybe-open-connection (3) # Sending command `exec ssh   -e none ssh'
08:16:56.710721 tramp-get-connection-property (7) # process-name nil
08:16:56.710958 tramp-get-connection-property (7) # remote-echo nil
08:16:56.711172 tramp-send-command (6) # exec ssh   -e none ssh
08:16:56.711419 tramp-get-connection-property (7) # process-name nil
08:16:56.711657 tramp-get-connection-property (7) # chunksize nil
08:16:56.711886 tramp-set-connection-property (7) # last-cmd-time (22335 56 711814 288000)
08:16:56.712110 tramp-send-string (10) # exec ssh   -e none ssh
08:16:56.712320 tramp-get-connection-property (7) # process-buffer nil
08:16:56.712667 tramp-set-connection-property (7) # first-password-request t
08:16:56.713063 tramp-process-actions (3) # Waiting for prompts from remote shell
08:16:56.713389 tramp-accept-process-output (10) # *tramp/scp ssh* run
08:16:57.714433 tramp-accept-process-output (10) #
08:16:57.714759 tramp-process-one-action (5) # Looking for regexp "\(.*ogin\( .*\)?: *\)\'" from remote shell
08:16:57.715121 tramp-get-connection-property (7) # check-remote-echo nil
08:16:57.715497 tramp-get-connection-property (7) # check-remote-echo nil

I'm able to use tramp to connect to remote hosts where ssh-keys are created. However for this particular host, I cannot use ssh-keys and I need to provide a passcode everytime I need to login
My .emacs contains the following values

(require 'tramp)
;;(setq tramp-default-method "ssh")
(setq tramp-shell-prompt-pattern "^[^$>\n]*[#$%>] *\\(\[[0-9;]*[a-zA-Z] *\\)*")
(setq tramp-verbose 10)

UPDATE:
Upgrading to Emacs 24.5 solved this issue.


texts: Why is Org adding a label in custom Babel environment?

texts:
I can't tell in what update exactly did this happen but since not so long ago Org adds a label{orgsrcblock#} to custom listings environments. Unfortunately, I can't find a way to tell listings to ignore this line, and it gets printed together with the source code.  Here's an example:

#+BEGIN_SRC emacs-lisp :exports none
  (setq org-latex-pdf-process
          '("latexmk -pdflatex='pdflatex -shell-escape -interaction nonstopmode' -pdf -f %f")
          org-latex-listings t
          org-src-fontify-natively t
          org-latex-custom-lang-environments '((maxima "maxima"))
          org-babel-latex-htlatex "htlatex")
  (defmacro by-backend (&rest body)
      `(cl-case (when (boundp 'backend) (org-export-backend-name backend))
         ,@body))
#+END_SRC

#+BEGIN_LATEX
\definecolor{codebg}{rgb}{0.96,0.99,0.8}
\lstnewenvironment{maxima}{%
  \lstset{%
    backgroundcolor=\color{codebg},
    aboveskip=20pt,
    captionpos=b,
    showstringspaces=false,
    frame=single,
    framerule=0pt,
    basicstyle=\ttfamily\scriptsize,
    columns=fixed}}{}
}
#+END_LATEX

then somewhere later:

*Solution:*
#+NAME: prob3
#+HEADER: :exports both
#+BEGIN_SRC maxima :results output raw
  n: 4;
  tex(sum(binomial(n, i) * 3^i * (-2)^(n - i), i, 0, n));
#+END_SRC

results in LaTeX code:

\textbf{Solution:}
\begin{maxima}
n: 4;
tex(sum(binomial(n, i) * 3^i * (-2)^(n - i), i, 0, n));
\label{orgsrcblock1}

\end{maxima}

and is displayed as:

The relevant part of Org code which generates this is:

org-latex-src-block in ox-latex.el

;; Case 2.  Custom environment.
   (custom-env
(let ((caption-str (org-latex--caption/label-string src-block info)))
  (format "\\begin{%s}\n%s\\end{%s}\n"
      custom-env
      (concat (and caption-above-p caption-str)
          (org-export-format-code-default src-block info)
          (and (not caption-above-p) caption-str))
      custom-env)))


texts: Re-enable flychecksyntax checker after reported too many errors

texts:
I recently ran into this error from flycheck:
Warning (flycheck): Syntax checker csharp-omnisharp-codecheck reported too many errors (482) and is disabled.

I saw this: Warning (flycheck): Syntax checker javascript-eslint reported too many errors (494) and is disable - which is great, but it doesn't answer the question "what do I do now?"
I got to this point by removing a closing brace, and of course everything broke. I replaced the brace, but now the syntax checker is disabled, and it doesn't show any errors.
So, how do I turn it back on?


texts: Where are these variables defined? - bytecomp Warnings

texts:
Lately I'm getting warnings when compiling the .emacs

Warning (bytecomp): reference to free variable ‘url-http-extra-headers’
Warning (bytecomp): reference to free variable ‘oauth--token-data’
Warning (bytecomp): reference to free variable ‘url-callback-function’
Warning (bytecomp): reference to free variable ‘url-callback-arguments’

I don't know were this variables are defined, and thus cannot constraint the errors.

Q1: Does anyone know were the problem is?

Q2: How to solve the problem?


texts:
Emacs provides a nice manual viewer which could be used for obtaining documentation for C syscalls (at point with Man-default-man-entry. However, it always starts searching manuals from section 0. How can I configure man viewer so that it will start from section 2, then 3, and then 0?

man 1 perror doesn't make much sense


texts: Calc won't fit any curve to any data, complains “Model expression is too complex”

texts:
Even if I copy the example from here: http://www.gnu.org/software/emacs/manual/html_node/calc/Linear-Fits.html#Linear-Fits this one:

[ [ 1, 2, 3, 4,  5  ]
  [ 5, 7, 9, 11, 13 ] ]

to be more specific, and then press a F 1 RET, all I get is the error message "Model expression is too complex: a + b * x". Do I have to do something special to make it work? Calc can plot data, so that's not an issue.

Running emacs -Q gives the same result.

Emacs Version: GNU Emacs 24.3.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.8.2) of 2013-08-14 on buildvm-15.phx2.fedoraproject.org


texts:
This in org mode. How do I get from

1 to 2
2 to 3

in as few keystrokes as possible? And, if possible, in reverse. I was hoping selecting Food's subtree and M-^ would do the job but what it does instead is delete subsequent lines.

1

* Food
    This is the body,
    which says something about the topic of food.

** Delicious Food
    This is the body of the second-level header.

** Distasteful Food
    This could have
    a body too, with
    several lines.

*** Dormitory Food

* Shelter
    Another first-level topic with its header line.

2

* Food
This is the body,
which says something about the topic of food.

** Delicious Food
This is the body of the second-level header.

** Distasteful Food
This could have
a body too, with
several lines.

*** Dormitory Food

* Shelter
Another first-level topic with its header line.

3

* Food
  This is the body,
  which says something about the topic of food.

** Delicious Food
   This is the body of the second-level header.

** Distasteful Food
   This could have
   a body too, with
   several lines.

*** Dormitory Food

* Shelter
  Another first-level topic with its header line.


texts: Asynchronous helm source without process restart

texts:
I use an asynchronous helm source (a process) to query a database and want to use helm search to restrict the matches.
Currently I start helm with something like that:

 (helm :sources (helm-build-async-source "query"
               :candidates-process
               #'cc-query
               :candidate-transformer
               #'helm-cc--candidates-formatter
               :action
               '(("find file" . helm-cc--action-find-files)
                 ("save results in buffer" . helm-cc--action-save-buffer)
                 ("compare" . helm-cc--action-ediff-files)))
    :buffer "*helm async source*"))

And cc-query is not much more than a start-process.

That works so far, however, the query is very very slow and is restarted with each pattern change. Can I avoid this restart?

Note: I use the asynchronous source, because I do not want to wait for the query to be finished.


texts:
The other day I wanted to put the contents of a source code block into a header argument of another block. I couldn't find any ready to use function to do that though, so I came up with this:

(defun extract-src-content (name)
  (save-excursion
    (org-babel-goto-named-src-block name)
    (car (nthcdr 21 (cadr (org-element-at-point))))))

But that doesn't seem to be right. First my elisp experience is not that vast so I don't know how to extract the value for the :value key out of (cadr (org-element-at-point)) so I just took the 21th element which can't be right and will probably break at the next org update. Second I still think there should be an org-function available to extract the contents of a named source code block, since it has to have a way to do that for export or editing.

Someone has an answer to either question?

What's the right way to extract the value after :value out of (cadr (org-element-at-point))?
Is there a ready to use org-function (or even org-syntax) to accomplish the same thing?

Bonus question

I tried to ask this on the #org-mode irc channel, but even though there are a lot of joined users it seems to be dead. Why is it still linked on http://orgmode.org/community.html then?


texts: M-x eval-buffer my init.el file every time I start emacs

texts:
I am a total emacs newbie. I was following the Master Emacs in one year guide by Chen Bin. Following it, I cloned Steve Purcell's .emacs.d repo.

Now the guide works just fine when I do M-x eval-buffer for my "~/.emacs.d/init.el" file. However, as soon as I restart Emacs, the changes are gone. I have to eval-buffer every time I start emacs.
I also checked some websites which explains me to have either .emacs file or init.el file and not both. But every time I delete my .emacs file, Emacs generates it automatically when I restart it.

What am I doing wrong?


texts:
After reading the documentation, here's what I've tried:

(condition-case err
    (signal 'my-error 'my-data)
  (my-error (message "data: %S" err)))

Evaluating this form still throws the signal, though – how can I truly catch it?


texts: Change overlaid text of an outline header?

texts:
Q: how do I add a new outline header regexp but change the overlaid text?

I often write presentations with Beamer in LaTeX.  As such, there are a lot of frame (ie, "slide") environments:

\begin{frame}
  \frametitle{My frame}
  % ...
  % ...
\end{frame}

To make navigation easier, I've added the frame environment to TeX-outline-extra so that Emacs will treat frames as headers and allow me to hide and show them:

(add-to-list 'TeX-outline-extra '("\\\\begin{frame}" 5)) % at paragraph level

Now, when the headers are closed, I have the following:

\begin{frame}...
\begin{frame}...
\begin{frame}...
\begin{frame}...

That's a big help, but I'd like to have a visual cue about what each frame contains (such as the frametitle).  How could I get the following:

\begin{frame} (My frame)...
\begin{frame} (Another frame)...
\begin{frame} (A different frame)...
\begin{frame} (Yet another frame)...


texts: Human readable directory tree with org-attach

texts:
By default, org-attach.el names project folders, using a UUID scheme, which is paired with headlines in org-mode, via the :PROPERTIES: drawer.

I would love to find a way to make this directory structure human readable, so that it can be accessed outside of org-mode (e.g., folder names are matched to headline names). So this outline structure:

* This headline
  ** This sub-headline 1
  ** This sub-headline 2
* This second headline

matches to the directory structure:

- This headline
  - This sub-headline 1
  - This sub-headline 2
- This second headline

Obviously, this presents an issue, should either of these get renamed. But maybe there is another way to get this done with UUIDs? Some possibilities:

Match a UUID in the :PROPERTIES: drawer to a UUID in the folder's metadata (Spotlight comments on the Mac come to mind)
Create a second folder structure via sim-links, that updates when org-attach-sync is called.

Any thoughts, ideas?

Thanks!


texts: How to embed Ibus preedit text into Emacs?

texts:
I'd like to ask is it possible to totally embed Ibus preedit text into the Emacs windows?
In my Ibus Preferences, I did tick the option "Embed preedit text in application window", however, the preedit text still appears in a separate popup dialog like this.

Does anyone know how to fix this problem?
Thank you very much!


texts: Magit doesn't recognise git repo through ssh connection

texts:
I'm using ssh to connect to a remote server. On the server there is a git repo called MRFLSSVM. However, when I execute magit-status on:

/ssh:qmServer:/home/Chang/qmCodeLab/MRFLSSVM/

Magit asks me to Create repository in /ssh:qmServer:/home/Chang/qmCodeLab/MRFLSSVM/?.

Any idea how to let magit recognize that repo? (I've already installed git 2.10.0 on /usr/local/git and configured my system (CentOS) to use it by update-alternatives)

-----------Edit------------------------------

Error (magit): Magit requires Git >= 1.9.4, you are using 1.8.3.

If this comes as a surprise to you, because you do actually have
a newer version installed, then that probably means that the
older version happens to appear earlier on the `$PATH'.  If you
always start Emacs from a shell, then that can be fixed in the
shell's init file.  If you start Emacs by clicking on an icon,
or using some sort of application launcher, then you probably
have to adjust the environment as seen by graphical interface.
For X11 something like ~/.xinitrc should work.

If you use Tramp to work inside remote Git repositories, then you
have to make sure a suitable Git is used on the remote machines
too.

Error (magit): Magit requires Git >= 1.9.4, but on /ssh:qmServer: the version is 1.8.3.

If multiple Git versions are installed on the host then the
problem might be that TRAMP uses the wrong executable.

First check the value of `magit-git-executable'.  Its value is
used when running git locally as well as when running it on a
remote host.  The default value is "git", except on Windows
where an absolute path is used for performance reasons.

If the value already is just "git" but TRAMP never-the-less
doesn't use the correct executable, then consult the info node
`(tramp)Remote programs'.

This problem seems to be tramp is not using the correct git on remote server. I've tried to change magit-git-executable to usr/local/git/bin/git which is the path both of my local and remotes installed git. But this still doesn't work.

Any ideas to solve this? Thanks!


texts: What are the differences between autopair and smartparens?

texts:
Both autopair and smartparens provide functionality for inserting matching pairs of delimiters automatically.

How do they differ from each other in practice (if at all)? What are some use cases that are covered by one of these packages but not by the other?


texts: Save all open files in current folder and subfolders

texts:
Some of my projects are organised in way that the there isn't one make file at the top route of the project (git/svn/...) folder but I have several small Makefiles in subfolders of the project. Normally I use Projectile to save only files related to my current project and call the main Makefile but this doesn't work if the Makefiles are more distributed in the project.

I would like to have a function that saves all open/unsaved files from the current folder and it's subfolder and then run the Makefile in the current folder.

(defun max/save-compile-current-folder ()
    (interactive)
    (max/save-current-and-subfolder-files ...)
    (compile t))

I currently don't know how to write the function max/save-current-and-subfolder-files. I would appreciate any hints how to write this function or links to libraries that already implement it.


texts: in ag search compilation mode, next error is replacing the current buffer, rather than showing the error in a new window

texts:
I'm searching my project with ag.el, and it shows the search results in a compilation mode window. When I select a result in the compilation mode window it replaces the buffer in that window with buffer containing the search result. So I can no longer see the index of search results.
How would I configure it to show the search result in a second window, and keep the window of search results open beside it?


texts: Greek (Unicode) in Org mode export to PDF

texts:
I am working on a project that deals with polytonic Greek, and wish to write everything in Org mode, and export to a PDF with one of the compilers (like XeLaTeX).

I have spent hours today reading posts and StackExchange threads about Unicode and Org mode, but feel no closer to solving my problem than when I first started. For example, I have a table like the following in my Org file:

| Greek letter | IPA                      | English match |
|--------------+--------------------------+---------------|
| Α α          | [a], [aː]                | A             |
| Β β          | [b]                      | B             |
| Γ γ          | [g], [ŋ] (before velars) | G             |
| Δ δ          | [d]                      | D             |
| Ε ε          | [e]                      | E             |
| Ζ ζ          | [zd]                     | Z             |
| Η η          | [ɛː]                     |               |
| Θ θ          | [θ]                      |               |
| Ι ι          | [i], [iː]                | I             |
| Κ κ          | [k]                      | K             |
| Λ λ          | [l]                      | L             |
| Μ μ          | [m]                      | M             |
| Ν ν          | [n]                      | N             |
| Ξ ξ          | [ks]                     | X             |
| Ο ο          | [o]                      | O             |
| Π π          | [p]                      | P             |
| Ρ ρ          | [r]                      | R             |
| Σ σ          | [s]                      | S             |
| Τ τ          | [t]                      | T             |
| Υ υ          | [y], [yː]                | U             |
| Φ φ          | [f]                      | F             |
| Χ χ          | [kʰ]                     |               |
| Ψ ψ          | [ps]                     |               |
| Ω ω          | [ɔː]                     |               |

And these lines in my .spacemacs file (evidently XeLaTeX supports Unicode better than PDFLaTeX?):

;; Use XeLaTeX
(setq org-latex-pdf-process
      '("xelatex -interaction nonstopmode -output-directory %o %f"
        "xelatex -interaction nonstopmode -output-directory %o %f")) ;; for multiple passes

I have been unable to get any of the Greek characters in the table to show up in the PDF when I use C-C C-e l p. I am not getting any build errors: the intermediate .tex file is produced and looks absolutely fine. It's just that when the PDF is produced, it doesn't have any of the Unicode characters I want. I am at a complete loss as to what I need to do, what packages I need to install, and so forth.

I'd like to get a handle on how to include Unicode symbols in general as I'll probably need to use IPA symbols and Hebrew letters as well in this project. But I'd be happy to get even just basic Greek letters working at this point.

Help?


texts: Auto complete directory according to included file?

texts:
I have a feature request, but I do not know whether there is any package about this. So, could you please give me some hints for me.

Example:

Suppose we have the directories like this: /foo/bar1/file1, /foo/bar2/file2, and /foo/bar/file3.

What I want is when I type /foo/*/file1 that will be autocompleted to the appropriate directory, according to the directory the file is in. For example, /foo/bar1/file1.

(The * I show in pattern /foo/*/file1 is just some symbol to show I am using this feature, which may not needed.)


texts: how can a command be bound to Ctrl-' or Ctrl- in the terminal

texts:
I want to bind a command to C-', C-` and C-0 through C-9 keys. It's not working in the terminal

Is there a way to do so?


texts: Hide inline images and show links in org-mode

texts:
On using an image link as,

[[./hello.png]]

in org-mode, emacs doesn't toggle the inline image display. org-toggle-inline-images works well on start-up. I run a presentation using M-x epresent-run epresent and come back to edit mode from the presentation mode by pressing q. Then the image display stops toggling.

What I get after quitting epresent-mode:

What I want:

This behavior is seen after I get into presentation mode using epresent and come back to edit mode by pressing q.


texts:
I use one unique diary.org file for my Org Agenda.

My file is structured as :tree-type week, hence is every entry like:

* 2019
** 2019-W21
*** 2019-05-26
**** entry

I would like to add category to any entry captured to this file, which I could do by editing my org-capture template.

However, categories don't show up in Org Agenda unless they're marking a file or a top-level item.

Do you know how to make categories work for non-top headers?


texts: Persistent TODO filtering and editing at the same time?

texts:
I would like to focus on only TODO-type headlines and also be able to edit or add headings at the same time.
My Ideas how to achieve this would be

a sparse tree, that refreshes itself. The default behaviour is that ohter neigbouring headlines are revealed if I toggle a heading or add a new one.
a minor mode that constantly hides all DONE tasks (which maybe already exist?)
add/edit TODO at a certain location via agenda, which does the persistent filtering already.

I am shure there are 100 more ways to do this in emacs. If you happen to know one, please do share it.
If you know how to implement one of the above ideas, please do share, too.


texts: Why is EWW unable to place images into tables

texts:
Web pages are rendered with the simple html renderer shr in the Emacs webbrowser EWW. Pitingly, images in tables are displayed below the tables.

The source code of shr contains the following comment about that:

    ;; Finally, insert all the images after the table.  The Emacs buffer
    ;; model isn't strong enough to allow us to put the images actually
    ;; into the tables.  It inserts also non-td/th objects.

Is that actually true? Shr already uses window-text-pixel-size for calculating the width of columns.

Furthermore, one can adjust column positions fine grained with the help of the :align-to space width specifiction.

The following code shows that window-text-pixel-size and :align-to work well with images:

(with-current-buffer (get-buffer-create "*test*")
  (unless (and
           (intern-soft "img")
           (boundp 'img)
           (stringp img))
    (setq-local
     img
     (with-current-buffer
         (url-retrieve-synchronously
          "https://cdn.sstatic.net/Sites/emacs/img/logo.svg?v=ceb7969787d0")
       (buffer-string))))
  (delete-region (point-min) (point-max))
  (insert
   "initial string"
   (propertize " " 'display '(space :align-to (10 . cm)))
   "second column"
   "\nImg: ")
  (insert-image (create-image
                 img
                 nil
                 t))
  (insert
   " text behind "
   (propertize " " 'display '(space :align-to (10 . cm)))
   "2nd column")
  (let ((wnd (display-buffer (current-buffer))))
    (cons
     (car
      (window-text-pixel-size
       wnd
       (goto-char (point-min))
       (progn
         (search-forward "second column")
         (match-beginning 0))))
     (car
      (window-text-pixel-size
       wnd
       (progn
         (forward-line)
         (point))
       (progn
         (search-forward "2nd column")
         (match-beginning 0)))))))

The code returns (377 . 377) meaning that x-window-text-pixel-width perfectly calculates the width of the rows belonging to the first column.

A screenshot of the produced buffer:

It shows that the rows of the second column are perfectly aligned.

Question: What is the actual limitation that is addressed in the above quotation?

Emacs-Version: GNU Emacs 26.3 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2019-09-16


texts: Emacs wont let me bind a key, tells me, "Key sequence C-z c starts with non-prefix key C-z"

texts:
I tried to set this:

(use-package avy
  :defer t
  :bind
  (("C-z c" . avy-goto-char-timer)
   ("C-z l" . avy-goto-line)
   ("C-C j" . avy-resume))
  :custom
  (avy-timeout-seconds 0.3)
  (avy-style 'pre)
  :custom-face
  (avy-lead-face ((t (:background "#51afef" :foreground "#870000" :weight bold)))));

But emacs tells me: Key sequence C-z c starts with non-prefix key C-z.

When I press C-z C-h I'm told that the following are bound:

C-z C-b
C-z b
C-z o
C-z p
C-z q
C-z r
C-z s
C-z t


texts:
My finger tends to linger on the Ctrl key and I happen to hit C-RET quite often. I also use cua-mode which binds this to cua-clear-rectangle-mark. I don't want C-RET bound to anything while in this mode.

I can't seem to unbind it though. I've tried:

(global-unset-key (kbd "C-RET"))
(global-unset-key (kbd "<C-return>"))
(global-unset-key [(control return)])
(define-key global-map (kbd "C-RET") 'ignore)
(define-key global-map (kbd "<C-return>") 'ignore)
(define-key global-map [(control return)] 'ignore)

I also tried the following in my .inputrc with no success:

"\C-RET": "\n"

There also doesn't seem to be a cua-mode-map:

;; Doesn't work
(define-key cua-mode-map "C-RET" nil)


texts:
I'm cofiguring emacs with org. Principally I wrote in emacs using .org file so i want a standard header file where i define al my "use package" file in particular:

\usepackage{geometry}
\usepackage{fontspec}
\usepackage[applemac]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[main=british,italian]{babel}
\usepackage{chemfig}
\usepackage{mol2chemfig}

so here I see that i can create a header.tex file containing the upper code, so in the template i can simply recall #+LaTex_header: \input{path/header.tex}.
So I want to define it in my configuration.org document, and when i star emacs i want that, in addition of inint.el file, i want that it produce also a header.tex that i can use.
How can I do?


texts: Creating a contact group from a local file to use with mu4e

texts:
I have a file ~/foo/contacts.csv whose first two columns look like

Student ID,Student Name
firstID@foo.org,"Lennon, John"
secondID@foo.org,"McCartney, Paul"
thirdID@foo.org,"Harrison, George"
fourthID@foo.org,"Starr, Ringo"

In actuality, the file has dozens of lines and several other columns. This file is updated every day (people are added and others are deleted).

I'd like to be able to e-mail every person on this list using mu4e. Ideally this would be done so that each recipient cannot see the identities of the other receipts.

Does mu4e have the capability to read my csv file so I can easily email the entire list under the pseudoname My Class?


texts: Embedding `org-id`s into their headers when exporting to HTML

texts:
I have need to export org-mode files to html for a wiki like system. I am making use of org-protocol so that I can act on links in html files with emacsclient, usually to open an org buffer at point based on its org-id (I am using uuids).
I would like to streamline this process so that these links are automatically embedded into its respective header, such that I can simply click on a header while viewing the html file. I have had some success using kitchen's guide here in converting existing org-mode links to the org-protocol syntax on export, but not in extracting the :ID: property of a header and creating a link in the header.


texts: Emacs gets really slow when trying to compute battery status within mode-line-format

texts:
While configuring powerline, I use my own format for the mode-line. I now want to apply a different face to the battery load string, depending on the battery status (dis/charging). However, when I compute the charging status within my mode-line-format construct, Emacs gets really slow and I can't mark region with shift + arrow anymore.
You can see the mode-line definition in my configuration that I keep on Bitbucket: init-mode-line.el:102.
The idea behind it was to have a boolean describing the battery status, and use it in the manner of active, that I already use.
Here is the output of profile-report:


texts: Elisp to get the language mode for the current ein cell?

texts:
When I'm using ein to run a python jupyter notebook, the major-mode variable is just "ein:notebook-multilang-mode" which makes it ambiguous what the current language is. I have elisp that only activates when major-mode is python-mode so it doesn't currently work for Python inside ein notebooks. Just checking for "ein:notebook-multilang-mode" doesn't seem right because that could also be Julia or some other language.

What should I be checking instead?


texts: Refile and selectively leave a link behind

texts:
The solution here leaves a link to the refiled heading behind.
Can that be made selectively on the fly? So, for some refiles, a link is left behind; for some others, it is not. And one can decide which way at the time of refile?