texts:
When reading about ido, we are instructed to add this to .emacs:

(ido-everywhere t)

The doc says that it Toggle use of Ido for all buffer/file reading.

What does it mean? Everything seems to work whether ido-everywhere is set or not.


texts: add-text-properties throws args out of range

texts:
I have a reasonably large buffer, whose first five characters i like to make as comment (this is a simplified problem of a larger issue, so bear with me).

Buffer contents:

;;some comment text, whose property needs to be changed.
(add-text-properties 0 7
                     '(comment t face highlight))

When i do eval-buffer, it throws error as, Args out of range: 0, 7.

Since the buffer has more than five characters, why does add-text-properties throw out of range error?


texts: Escape Swiper even when match is required

texts:
Swiper automatically moves to the next location that matches your current input. You can press RET to return to the main buffer when the search is successful.

When you type in a word that does not exist, Swiper remains at the last location where a match was found. Then, when you press RET, Swiper says "match required" and does not return to the buffer. It seems that the only options are to cancel (C-g, which returns to the position before calling Swiper) or to modify the input in the minibuffer.

Is it possible to by-pass the "matching requirement" and to return to the buffer at the location selected by Swiper, even when there is no more matching? Swiper behavior is very annoying and slow (because of the cancelling of the search or the changing of the input search), when you just mistyped or went too restrictive in the search.


texts: Commented lines shoot off to column 32 in octave-mode

texts:
I am using the octave major mode for editing my MATLAB code, since it is more convenient than the unsupported MATLAB packages for emacs on the internet.

One downside is whenever I try to auto-indent commented lines, the comment character is carried over to column 32, which makes indenting large blocks of code a bit of a problem.

I should note that I did

(setq comment-start "%")

in order to use the percent sign as the default comment character. Nevertheless, I have the same problem when using #. When I use comment-region, it actually inserts ## at the beginning of the lines, and the lines with ## do not shoot off like the ones with #.

The same question has been asked couple of times as I have found on Google, like this one. But none of them helped me.

I would like to solve this problem so that lines starting with % or # are auto-indented in a correct manner without shooting off to column 32. I am using GNU Emacs 24.5.1.


texts: Moving the mode line and minibuffer to the top

texts:
Is there any way I can move the mode line and the minibuffer from the bottom to the top of the screen?

The minibuffer is covered by the previous question How to display the content of minibuffer in the middle of the emacs frame?, so this question is primarily about the mode line.

I have just dropped my laptop and cracked the screen, so can't see much along the bottom row.


texts: My org-mode has different size text at different level

texts:
Actually what happened was this.

I was looking for a good theme for my emacs. In the process I have changed many themes. I don't know which theme caused this but now my org-mode has different size text at each level.

I don't like this. They look very uneven. Can you please tell me how to undo this?


texts: byte-compiling in presence of pcase patterns

texts:
TIL that trying to compile anything with pcase matching in it may lead to an explosion of code generated during expansion. Even the most innocent looking patterns may generate hundreds of branches and thousands of lines of code. TBH I would never have noticed had it not been for a small macro I wrote yesterday. The exact code is unimportant but the gist of it is that it had a pcase with 4 clauses doing some matching on lists and what not. That macro was the last in the project I've been working on, so naturally I attempted to byte-compile. Upon reaching the macro the compiler would just sit there. Out of curiosity I let it - only to be disappointed with Error: Bytecode overflow some 10min later. O..K..

M-x pp-macroexpand-all-last-sexp ... 160K lines of expanded code later I was enlightened. If you ever looked at what pcase list pattern expands into, you wouldn't be surprised. There isn't any magic there, the rewriting rule is straightforward. Problem is it doesn't scale if you perform full macro-expansion, and IIUC that is what byte-compile does. Let's use a tiny contrived example just to get the feel for "scale":

(pcase e
  (`(,a ,(or (or `(0) `[0]) 42)) a))

Full expansion of this is 70 lines of pretty-printed code but you can imagine how a bunch of nested patterns and several clauses create all possible permutations and baloon into thousands. My first thought was that it's the (or .. ..) pattern that's not cleverly handled and replacing it with explicit clauses may help fight branching:

(pcase e
  (`(,a (0)) a)
  (`(,a [0]) a)
  (`(,a 42) a))

Well, macroexpand-all and you get the exact same 70 loc, so, yeah, they're precisely equivalent. I bet pcase actually re-writes one into the other.

It isn't a problem at runtime i.e. if you just eval and run the interpreter, because in 99.9% of cases the match fails at the head, so all those branches never get generated by the expander when you just interpret and match. That's why I never noticed any issues say with performance.

I guess I have several questions after this long-winded diatribe:

How do you byte-compile code that uses pcase?
Maybe you don't compile, but then how do you get reasonable performance?
Maybe you just don't use pcase ever? Is this why so much Elisp is poisoned with caddaar and friends? I really want my pattern matching.
Is there anything obvious I've overlooked?

Didn't get any relevant hits searching emacs-devel archives.


texts: Using minibuffer while the cursor is on a org-ref citation link

texts: When I run (y-or-n-p "Prompt") while the cursor is on an org-ref citation link, the prompt appears for a second and then disappears again to continue displaying the information about the article corresponding to the link. How do I avoid this? That is, how can I temporarily disable the showing of information about the article in the minibuffer?


texts: comint-mode problem with C++ style comments (and quotes)?

texts:
This is a rephrase of my SO question https://stackoverflow.com/questions/44147993, which didn't receive much attention in SO.

Basically, I suspect that I enountered a problem with nodejs-repl.el (which is based on comint-mode) when C++ style comments are mixed with quotations.

For example, when evaluated using nodejs-repl-send-region, the following line:

var says = function ( ) {  return this.saying || ''; };

gives an error :

var says = function ( ) {  return this.saying   ''; };
SyntaxError: repl: Unexpected token, expected ; (1:48)
> 1 | var says = function ( ) {  return this.saying   ''; };

|| seems to have been dropped. There is no error if I replace || with +.

Another example:

var url = "http://www.ora.com:80/goodparts?q#fragment";

gives:

> var url = "http:/*www.ora.com:80/goodparts?q#fragment"; */
SyntaxError: repl: Unexpected token (1:56)
> 1 | var url = "http:/*www.ora.com:80/goodparts?q#fragment"; */

Here, http:// seems to be misinterpreted as http:/*, beginning a comment, despite the fact that // is in a quote.

In both cases, the error only occurs when the problem lines are sent from the buffer to the REPL using nodejs-repl-send-region. No error is returned if the line is evaluated directly in the REPL.

Can anyone please help explain how to fix my Emacs environment (maybe nodejs-repl.el or the underlying comint-mode)?

I have tested this under Emacs 24.5 (Ubuntu 16.04) with a minimal .emacs.d/init.el file below (as suggested by the nodejs-repl.el homepage):

$ cat .emacs.d/init.el
(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode))

(require 'comint)
(add-to-list 'comint-preoutput-filter-functions
         (lambda (output)
           (let ((case-fold-search nil))
         (replace-regexp-in-string "\033\\[[0-9]+[A-Z]" "" output))))

(setq babel-repl-cli-arguments '("--presets"  "es2015" ))

;; Interactive commands
(eval-after-load 'js2-mode '(progn
  (define-key js2-mode-map (kbd "C-c C-b") 'babel-repl-send-buffer)
  (define-key js2-mode-map (kbd "C-c C-z") 'babel-repl)
  (define-key js2-mode-map (kbd "C-c C-r") 'babel-repl-send-current-region)

Other than the init.el, I have installed babel-repl using ELPA and its folder looks like:

elpa/babel-repl-20160504.1501/

-- EDIT --

@db48x Further info about my system:

emacs -Q works fine with a normal welcome screen. So does emacs --debug-init and emacs --debug-init -Q. emacs --version says GNU Emacs 24.5.1.

If tested with the following .js file:

$ cat test2.js
var says = function ( ) {  return this.saying || ''; };

the outcome is:

$ emacs --script test2.js
Loading 00debian-vars...
Loading /etc/emacs/site-start.d/50autoconf.el (source)...
Loading /etc/emacs/site-start.d/50cmake-data.el (source)...
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
Loading /etc/emacs/site-start.d/50mmm-mode.el (source)...
Loading /etc/emacs/site-start.d/50proofgeneral.el (source)...
Loading /usr/share/emacs24/site-lisp/proofgeneral/generic/proof-site.elc...
Loading /etc/emacs/site-start.d/50psvn.el (source)...
Loading /etc/emacs/site-start.d/50python-docutils.el (source)...
Symbol's value as variable is void: var


texts: Close clocked-in org task and clock-in next leaf task

texts:
When I am moving through a TODO list, I often want to complete the current task and clock into the next leaf node. In other words, I am performing a depth-first traversal of the task list.

Before

* TODO foo
** TODO foo-bar
   CLOCK: [...]
* TODO baz
** TODO baz-qux
** TODO baz-norf

Once I complete foo-bar, I want to be in the following state.

After

* DONE foo
  CLOSED: [...]
** DONE foo-bar
   CLOSED: [...]
   CLOCK: [...]--[...]
* TODO baz
** TODO baz-qux
   CLOCK: [...]
** TODO baz-norf

foo-bar has been marked complete. Since all of foo's dependencies have been marked complete, it too becomes marked complete. Since baz-qux is the next leaf task, it becomes the clocked-in task. Since foo-bar and foo are complete, I also want them to be collapsed. For clarity I've omitted that from the above code block.

After (including collapse)

* DONE foo...
* TODO baz
** TODO baz-qux
   CLOCK: [...]
** TODO baz-norf

How can I accomplish this pattern with a single command?


texts: Font-lock Yasnippet template from within Org-Babel block

texts:
I want to manage my library of snippets from a single org-mode document and tangle these to their respective snippet files, as needed. Now functionally, this works out-of-the box, with the one exception: org-babel does not know how to font-lock a snippet and I cannot find an ob-snippet.el file anywhere on the web.

Now Yasnippet does has a snippet major mode that it uses to font-locks snippets, when viewed from their own buffer. How can I get org-babel to use this to fontify snippets from within a babel code block?

To better illustrate, here is a screenshot of my article snippet from within org-mode

and here it is, nice and fontified under the snippet major mode:

Any ideas?


texts: I configured git so that it uses emacsclient when editing commit messages. The only problem is that these messages are edited in fundamental-mode. Which hook should I use to have these commit messages buffer in markdown-mode?


texts: Change colours for character differences for diff-mode

texts:
I've changed my diff-mode colours according to this article, but the character-based differences are shown in the original(?) and very bright colours, making them quite unreadable.

How do I change the colours that show the char-by-char differences on the removed/added lines?


texts: Orgmode tables: Insert row within column

texts:
I would like to know, how to add a new line in a column without changing the other columns. Alternatively, how to move up a cell in a column without changing the other columns.

Here is an example (before):

| Example | Example |
|---------+---------|
|       1 | A       |
|       2 | B       |
|       3 |         |

After unknown insert of a new line above A:

| Example | Example |
|---------+---------|
|       1 |         |
|       2 | A       |
|       3 | B       |

Lets now move up cell A in second column without changing the other columns:

| Example | Example |
|---------+---------|
|       1 | A       |
|       2 |         |
|       3 | B       |

I read the documentation, but did not find a direct answer.


texts:
I had a custom key that I used extensively in Emacs for custom editing actions: C-z. I decided to use evil mode (I came from vim originally so nothing too new) but I don't know how to rebind evil's C-z to my C-z.

Should I just wrap the global-set-key calls that use C-z in a function that just takes a char with interactive? If I do that then I don't get the F1 k C-z j g functionality that shows me what C-z j g is bound to, which I use often (varying binds per mode).

Could I force the evil mode normal map C-z to use the global map C-z?


texts: Function that returns the name of a Greek vowel

texts:
I'm trying to write a function that will return the name of a
Greek vowel: alpha or epsilon etc.  I was hoping this could be done
by extracting it from the second group in the following regexp
(in a function that determines whether a character is a Greek vowel),
but I don't know how, if at all, that is possible.

(defun greek-vowel-p (l)
  (eql (string-match "GREEK \\(SMALL\\|CAPITAL\\) LETTER \
\\(ALPHA\\|EPSILON\\|ETA\\|IOTA\\|OMICRON\\|UPSILON\\|OMEGA\\|RHO\\)"
                     (get-char-code-property l 'name))
       0))


texts: Unable to Set Javascript Indent on Spacemacs

texts:
I have a vanilla Spacemacs setup, and in my .spacemacs file, the dotspacemacs/user-config definition I have added (setq js2-basic-offset 2) which should be sufficient to set the indent length as 2. I have also placed this before in my user-init with no luck as well.

I can verify this in my window using SPC h d v which it shows to be 2.

Yet, in my .js files it continues to indent 4 spaces. My spacemacs shows "Javascript" for the major mode in the modeline bar.

Any ideas on what I am doing wrong/how I can debug this?


texts: Why can't I bind tab to multiple spaces?

texts: I'm trying to bind tab to either a tab or multiple spaces in Latex/ESS-noweb mode but I can't get it to work. I tried (local-set-key (kbd "<tab>") 'self-insert-command) which didn't work, and then (local-set-key (kbd "<tab>") (lambda() (insert "   "))) which also didn't work.


texts:
Say we have a CSV in a buffer:

foo,bar,hello
1,234,95
8923,901,145

Are there any native Emacs or Markdown-mode built-ins in Emacs that can be used to convert it to a Markdown table? It looks like the syntax is quite different:

| Tables        | Are           | Cool  |
| ------------- |:-------------:| -----:|
| col 3 is      | right-aligned | $1600 |
| col 2 is      | centered      |   $12 |
| zebra stripes | are neat      |    $1 |


texts: Emacs wrongly indent else expression in Python code

texts:
Say, I got a simple Python code snippet:

def demo(i):
    if(i):
        print "True"
    else:
        print "False"

I make indent-region for the whole buffer after save using before-save-hook in my init.el, so after C-x C-s in this buffer, it whole buffer will be automatically indented, this works for C and elisp source code perfectly, but in Python code, that code snippet will become:

def demo(i):
    if(i):
        print "True"
else:
    print "False"

If I put point in else line, and type TAB, this line will be indented as it should be as the first code example.
If I mark the region of demo function or the whole buffer then type TAB or C-M-\ which is indent-region, the else line  will become the incorrect indention style.
If I C-x C-s to save this buffer which will also execute the indent-region for the whole buffer as I said early, the else line will become the incorrect indention style as the later code example.

According to the https://stackoverflow.com/questions/19611681/emacs-python-indentation-for-single-line-if-else which was posted a year ago, the problem is not solved yet, so I post it here again to hope someone see it and give some solution.

BTW:

GNU Emacs 24.4.1
built-in python.el
Fedora 21 32-bit


texts: how can I control table column widths when exporting to html?

texts:
I would like to specify the width of each column in tables that are exported from an org mode file to html.

In terms of html I can think of two possible solutions,

(i) add class attributes to each column in the table, e.g.,

ID
Name
Job
Email

in the html.  And class selectors in the css:

.row-ID {
   width: 10%;
}
.row-name {
   width: 40%;
}
.row-job {
   width: 30%;
}
.row-email {
  width: 20%;
}

(ii) use the col tag, e.g., <col width="100px" />.

I would prefer (i).

I have not been able to generate the html for either of these solutions from my org file.


texts: How to match this string with elisp regexp?

texts:
I'm writing an extension to open a custom link type in Org-mode with Kiwix URL. (Kiwix is an offline Wikipedia program). Here is my kiwix.el source code.

I created a wiki: link type for Org-mode.

Here is the link formats:

[[wiki:(library):query]]
[[wiki:query]]

links:

wiki:(zh):%E7%A6%85%E5%AE%97
wiki:(en):linux
wiki:linux

And here is the elisp regexp:

"\\(wiki\\):\\((\\(.*\\)):\\)?\\(.*\\)"

Here is my current function to handle the link:

(defun org-wiki-link-open (link)
  "Open LINK in external wiki program."
  (cond ((string-match "\\(wiki\\):\\((\\(.*\\)):\\)?\\(.*\\)"  link) ; [[wiki:(library):query]]
         (let* ((type (match-string 1 link))
                ;; convert between libraries full name and abbrev.
                (library (cdr (assoc
                               (match-string 3 link)
                               kiwix-librarie-abbrev-list)))
                (query (match-string 4 link))
                (url (concat kiwix-server-url library "/A/" (url-encode-url (capitalize query)) ".html")))
           (browse-url url)))
        ((string-match "\\(wiki\\):\\(.*\\)"  link) ; [[wiki:query]]
         (let* ((type (match-string 1 link))
                (query (match-string 4 link))
                (url (concat kiwix-server-url kiwix-default-library "/A/" (url-encode-url (capitalize query)) ".html")))
           (browse-url url)))))

(defun org-wiki-link-export (link description format)
  "Export the wiki LINK with DESCRIPTION for FORMAT from Org files."
  (let* ((type (when (string-match "\\(.+\\):(\\(.+\\)?):\\(.*\\)" link)
                 (match-string 1 link)))
         (library (when (string-match "\\(.+\\):(\\(.+\\)?):\\(.*\\)" link)
                    (match-string 2 link)))
         ;; query need to be convert to URL encoding: "禅宗" https://zh.wikipedia.org/wiki/%E7%A6%85%E5%AE%97
         (query (url-encode-url
                 (or description
                     (when (string-match "\\(.+\\):(\\(.+\\)?):\\(.*\\)" link)
                       (match-string 3 link)))))
         ;; "http://en.wikipedia.org/wiki/Linux"
         ;;         --
         ;;          ^- library: en, zh
         (path (concat "http://" library ".wikipedia.org/wiki/" query))
         (desc query))
    (when (stringp path)
      (cond
       ((eq format 'html) (format "%s" path desc))
       ((eq format 'latex) (format "\\href{%s}{%s}" path desc))
       (t path)))))

(org-add-link-type "wiki" 'org-wiki-link-open 'org-wiki-link-export)

But this regexp is wrong, can't open those example links correctly.

[[wiki:(en):Linux][Linux (wiki)]]
[[wiki:Linux][Linux]]
[[wiki:(zh):%E7%A6%85%E5%AE%97][禅宗]]

So I hope someone can help me to improve this regexp pattern and my function code.


texts: How do I configure class options for latex export in my .emacs?

texts:
By default org mode seems to configure 8x11 as the paper type when I export to latex.  I always print to A4, so I would like all of my exports to specify a4 as the paper type -- e.g.:

\documentclass[a4paper]{article}

I currently solve the problem by putting the following line in my file whenever I want to export, but that's pretty redundant:

#+LaTeX_CLASS_OPTIONS: [a4paper]

How can I tell emacs to do this whenever I run latex export?


texts: Export pretty symbols in org source blocks?

texts:
I make substantial use of prettify-symbols in my programming buffers. A snippet of some of my python symbols:

(add-hook 'python-mode-hook
        (lambda ()
          (mapc (lambda (pair) (push pair prettify-symbols-alist))
                '(("for" .      ?∀)
                  ("in" .       ?∊)
                  ("not in" .   ?∉)
                  ("return" .  ?⟼)))))

This works fine for all cases except (html) exporting.

Pretty symbols from source code, or even directly from org-mode text, will not transfer over after exporting.


texts:
Long time ago I added:

(setq package-archives '(("elpa" . "http://tromey.com/elpa/")

In http://tromey.com/elpa/elpa.rss latest package is from 2010-08-15 22:11.

Is that right that modern package repositories are:

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

UPDATE Seems that Tom Tromey is initial author of package.el http://tromey.com/blog/?page_id=333


texts:
How do I debug remote python/twisted code from within Emacs?

The closest I got with an internet search was Geben, if I understand correctly, but it has not been maintained for a few years now.


texts: Autocomplete files/paths while typing in any mode or fundamental mode, like bash does at prompt

texts:
After opening up an empty file named

~/work/aback

using emacsclient -nw ... .

I type in

~/huTAB

in the body of the file.
how can I get autocompletion candidates shown? In this case,
any files/folders starting with the name hu


texts:
The preview-latex package behaves in the following manner: it shows you an image of a formula / section header / etc. When the cursor gets "into" the image it is automatically replaced by the latex code. Once you're done, the user is supposed to hit C-c C-p C-p to update the preview.

What I would like: instead of a manual process (hitting C-c C-p C-p), I would prefer that whenever I finish editing a formula, the images should be updated automatically.

Is that possible?

Warning: I'm a novice emacs user.

FWIW, I'm using Aquamacs 3.2 GNU Emacs 24.4.51.2 , but I'm pretty sure this applies to standard emacs as well.


texts: Using tab for both cycling and completion in org mode

texts:
I use company for completion and I have company-indent-or-complete-common bound to tab for certain modes. In org mode, tab is bound to org-cycle, which either cycles visibility or calls the global binding for tab depending on context. I would like to have org-cycle call company-indent-or-complete-common instead of the global binding for tab, but I don't know how to do this. Is there a simple way to trick org-cycle into having this behavior?

Edit: I managed to find a solution on my own (for some reason @tjg's answer doesn't work for me). At first I was using

(defun org-cycle-advice (old-fn &rest r)
  (let ((old-tab (global-key-binding (kbd "TAB"))))
    (global-set-key (kbd "TAB") 'company-indent-or-complete-common)
    (apply old-fn r)
    (global-set-key (kbd "TAB") old-tab)))

(advice-add 'org-cycle :around 'org-cycle-advice)

but that didn't generalize to outshine-cycle well, so now I am using

(defun company-outline-cycle-indent-or-complete-common ()
  (interactive)
  (if (not (outline-on-heading-p))
      (if (string= major-mode "org-mode")
          (org-cycle)
        (if (bound-and-true-p outshine-mode)
        (outshine-cycle)))))


texts:
I recently upgraded my Mac to Catalina 10.15.6.
I also upgraded emacs to 27.1.  When I try to start it, I get an error:

I tried downloading the dmg directly from emacsformacosx.com and installing via brew cask install emacs, which appeared to get it from the same place.
brew install emacs installed 26.3 and would only open it in the terminal, not as a separate app.  I know that there used to be a --with-cocoa option, but I could not figure out how to get that to work.
What do I need to do to install emacs on Catalina, such that it works in a separate window rather than in a terminal?


texts: Search for tasks without any active timestamp

texts:
Running spacemacs 0.200.13 on emacs 25.2.2 on Kubuntu 18.04.

Just as the title suggests, I want to search for all agenda items without an active timestamp --- either plain active timestamp or a scheduled or deadline timestamp.

How do I do that?

A solution is given here for selecting tasks without a scheduled or deadline timestamp. But that does not work for me. Emacs just goes in some kind of a loop. Agenda is not generated even after 45 secs. Moreover, it does not cover tasks with just a plain active timestamp.


texts: How can i activate emacs-binding in doom emacs?

texts:
I am using doom emacs. But I want traditional emacs key binding. I've heard several people that emacs key binding becomes way of life and if somebody takes my key binding away, I cant express myself.
Please give me way to use emacs binding in doom.
Also
after adding emacs binding, please tell me how can i add it to home like showing all binding instead of evil ones.


texts: Getting SES mode to act somewhat like a regular spreadsheet

texts: So I have been working in an office that deals a ton with spreadsheets (mostly non-numeric data). With some things SES mode is a perfect alternative to the standard Excel sheet. I have found one thing that is a huge limitation so far though. I have tried, but cannot find a way to copy formulas smartly in Emacs SES. For example, if the formula in cell C1 is (+ A1 B1), I would like to be able to copy the formula from C1 into C2 and have the formula be (+A2 B2) instead of (+ A1 B1). Also, a way to fill in series in columns would be great.


texts: org mode link with just the non-directory part of the file name

texts:
Is there a method to link files without specifying their absolute file name nor their relative file name; just the non-directory part of their file name? I remember stumbling into one when browsing the other day that was defined as a custom link type that maintains some sort of data structure that users can append to and that it is used to resolve links but the name escapes me.

so for example, to refer to a file located ../../blob.txt, all I have to do is [[LINKTYPE:blob.txt]] and this works across files. I would expect I need to add the absolute file name to some list/data structure or some other resolving mechanism.


texts: From one-line list to one element per line in python-mode


texts: How do I modify a frame once it's created?

texts:
I want to manipulate a frame after it's created. I thought that I could do this with an 'after-make-frame-functions hook as a callback but it seems to return too early.

This is the sample code that demonstrates the issue:

(defvar test-frame nil)

(defun finish-frame-setup( frame )
  (message "test frame is %s" (frame-live-p test-frame)))

(defun test-frame-callback()
  (interactive)
  (add-hook 'after-make-frame-functions 'finish-frame-setup t nil)
  (setq test-frame (make-frame)))

and

M-x eval-buffer
M-x test-frame-callback

results in

test frame is nil

I'd appreciate any assistance.
Emacs 24.4 on win32


texts: Orgmode: Extra vertical space between level 1 and previous line

texts:
new to emacs, so if I'm mistaken with vocabulary, please excuse me.

I'm using orgmode, and I wish to modify the way it displays, specifically I wish to have some extra vertical distance before a level 1 task and the line before.

I found the M-x customize-groups RET orgmode-faces RET menu, and there are some options to customize org level 1 face, however not what I'm looking for.

Can someone please point me in the right direction? I think I'm just not fluent in emacs speech to formulate the question correctly...


texts:
I use org UTF8 character substitution all the time, for example to go from \beta to β (enabled with the org-pretty-entities variable).

However some standard symbols are missing and I'd like to add them manually. For example, I'd like to map \| to ‖. How can I do that?

Reference: Org Symbols Table


texts: Prevent emacs mode from defining keybindings

texts:
I am trying to extend evil-like conventions to comint mode so I can use vim-like keybindings from the shell. I also rebound C-c to #'evil-normal-state since that is what I use in vim (it isn't strictly equivalent to C-[ but I haven't run into the weird edge cases where that actually matters yet).

I am using the evil-define-key macro to define comint-mode-specific bindings in normal state that begin with SPC f and so far that works great.

However, all the mode-specifc keybindings beginning with C-c are still there despite the fact that C-c is bound to #'evil-normal-state in every state. I don't want to globally rebind C-c since that would interfere with emacs state.

What is the cleanest way to prevent comint-mode from defining any additional keybindings at all since evil-mode is effectively managing all the keys?

I have tried adding

(setf comint-mode-map (make-keymap))

and

(setf comint-mode-map (make-sparse-keymap))

to my .emacs file, but whenever I type M-x shell, I get the error

Wrong type argument: keymapp, 1


texts: Multiple cursors package makes emacs run slow

texts:
I'm using the package Multiple Cursors in an html file and it's awesome for a few cursors but if I create more than 30 or 50 cursors it gets terribly slow and it takes about five or six seconds just to move the cursors.
Am I using it wrong or it just that it's not prepared for creating that many cursors?.


texts: How to setup comment-start and comment-start-skip?

texts:
Haskell has line comments starting with -- and multiline comments of the form {- ... -}. I'd like to make auto-fill-mode work for both of those.

Currently line comments are auto-filled correctly:

-- abc abc abc abc abc abc abc abc abc abc abc abc abc
-- abc abc abc abc abc abc abc abc abc

but multiline comments are not:

{- abc abc abc abc abc abc abc abc abc abc abc abc abc
{- abc abc abc abc abc abc abc abc abc

it should be just with spaces:

{- abc abc abc abc abc abc abc abc abc abc abc abc abc
   abc abc abc abc abc abc abc abc abc

current settings are:

(set (make-local-variable 'comment-start) "-- ")
(set (make-local-variable 'comment-padding) 0)
(set (make-local-variable 'comment-start-skip) "[-{]-[ \t]*")
(set (make-local-variable 'comment-end) "")
(set (make-local-variable 'comment-end-skip) "[ \t]*\\(-}\\|\\s>\\)")

How to set this up so that comment auto-fill works for both kinds of comments?

More about Haskell Mode: https://github.com/haskell/haskell-mode


texts: I have a lot of files on my system without extensions (i.e., files like todo, list_of_stuff, etc). I would like these types of files to default to markdown-mode for their major mode. How to do this? In case it matters, I'm running spacemacs.


texts: Concerns regarding uninstalling packages

texts: In order to uninstall a package from Emacs I read that I must delete the specific folder from the elpa folder. As the .emacs file is being written by itself when I install a package does that mean that it will also delete itself when I uninstall a package or I must delete specific entries by myself? Also I installed an auto complete package and inside elpa folder I found a folder with the name popup-20141002.320. Why was that folder in there? Can packages install other packages? If so then when I uninstall the first package I must uninstall also the one it installed by itself?


texts:
I am aware of How to place all auto-save files in a directory, but I cannot figure it out from Emacs manual how to save all auto-save versions and all backup copies of a given file in a subdirectory sitting in same parent directory where the file resides?

For example, if I am editing file etiology-macro.lisp, I would need to keep all auto-save and backup versions of that file in subdirectory auto-save-and-backup-subdirectory

path/to/directory/
          etiology-macro.lisp
          auto-save-and-backup-subdirectory/
              etiology-macro.lisp.20170827-132731
              etiology-macro.lisp.20170827-133007
              etc.

How to set auto-save and backup path as subdirectory sibling of a given open file?


texts: Exclude dot-files from the find-file Completion List

texts:
When I run the find-file command and hit the tab key twice without giving anything, I get the Completion List of my, for instance, home directory. By default it lists everything inside, including the hidden files and directories ("dot-files").

Is it possible to exclude the dot-files in this case? But additionally, when I start typing . and then hit the tab twice, I would like to see the all or matched dot-files.


texts: How can I copy syntax highlighted code as RTF or HTML?

texts:
I'm using Emacs to write code samples that I later want to be able to paste into a MS-Word document, preserving the syntax highlighting. I understand that in order to do this I need to copy the text in either RTF or HTML format.

Currently I'm just killing from Emacs into http://www.tohtml.com and then copying from there and pasting into Word. It strikes me that someone, somewhere has probably written some Lisp to make this process at least a couple of keystrokes shorter, but I can't seem to find any existing solution or anything in the docs that suggests this is even possible.

So I'm keen to know if there is a ready made solution I can include in my config or if anyone has any pointers about how I could write something to achieve this.

I'm fairly new to Emacs, loving it, but my e-Lisp is currently very basic.


texts: Can helm-apropos display the key bindings for commands the way helm-M-x does?

texts: I'm a recent convert to helm. helm-M-x displays commands and includes key-bindings in parens after the command name. helm-apropos displays commands and other things. I'd like it to display the key bindings for commands that have them the same way as helm-M-x does.


texts: Customize org-babel latex template when evaluating a source block

texts:
I'm using latex source blocks to generate images with org-babel using :results file as in the example below
#+begin_src latex :results file graphics :file myplot.pdf :fit yes
\LaTeX
#+end_src

When evaluating this block I get
#+RESULTS:
[[file:myplot.pdf]]

and the file myplot.pdf has "rendered" latex code.
This works quite well with tikz and pgfplots to create figures or plots that are properly included as images when the document is exported. However, the fonts in my plots created like this do not match the rest of the document when the whole org file is exported to PDF, since the main document and the plots are generated with different latex classes. I'd like to customize the template used by org-mode that surrounds the code inside the #+begin_src #+end_src block to use my customized class.
More specifically, when a latex code block like the one above is evaluated, org will create a temporary file containing something like
\documentclass{article}
\usepackage[usenames]{color}

WHAT IS IN MY org-latex-default-packages-alist VARIABLE

\pagestyle{empty}             % do not remove
% The settings below are copied from fullpage.sty
\setlength{\textwidth}{\paperwidth}
\addtolength{\textwidth}{-3cm}
\setlength{\oddsidemargin}{1.5cm}
\addtolength{\oddsidemargin}{-2.54cm}
\setlength{\evensidemargin}{\oddsidemargin}
\setlength{\textheight}{\paperheight}
\addtolength{\textheight}{-\headheight}
\addtolength{\textheight}{-\headsep}
\addtolength{\textheight}{-\footskip}
\addtolength{\textheight}{-3cm}
\setlength{\topmargin}{1.5cm}
\addtolength{\topmargin}{-2.54cm}
\usepackage[active, tightpage]{preview}

\begin{document}
\begin{preview}
\LaTeX
\end{preview}
\end{document}

where my code is inside the preview environment (preview is added by the :fit yes header). How can I change this template to use a different latex class? The ideal case would be something similar to the #+LATEX_CLASS:mycustomclass header that can be added to the main document. In order words, is it possible to choose one of the classes in org-latex-classes when evaluating a latex code block?


texts: Visual selection highlighting invisible (with Evil and color-theme)

texts:
In Emacs color-theme libraries, which items control the visual selection foreground and background?

I'm in the process of giving Emacs a try after many years of Vim use.  The vim emulator, Evil, is working imporessively well for me but I'm having trouble with visual selection highlighting.  The problem seems to be with my chosen color theme rather than with Evil. I say this because if I comment out the the theme I can see the selected text properly highlighted, but not with my chosen theme which is a port of the ir-black them I use in Vim.

I got the theme from https://github.com/jmdeldin/ir-black-theme.el/blob/master/ir-black-theme.el

Here's the section in my .emacs file that loads Evil and the theme.

;Enable "Evil", the Vim emulation package
(add-to-list 'load-path "~/.emacs.d/evil")
(require 'evil)
(evil-mode 1)
(line-number-mode t)

(add-to-list 'load-path "~/.emacs.d/color-theme-6.6.0")
(require 'color-theme)
(color-theme-initialize)
(color-theme-ir-black)

I've searched color-theme-ir-black.el for "visual" and find only the following lines that seem possibly relevant.

;;visual selection: #1D1E2C
 (region ((t (:background "#1D1E2C"))))
 (speedbar-file-face ((t (:foreground "#1D1E2C"))))

FWIW, I'm running GNU Emacs 24.4.1 on OS X 10.9.5


texts:
[Have been using Emacs for at least 40 years, but still ...]
What to put in .emacs so that Emacs opens in text mode?
I have tried:
(setq initial-major-mode #'text-mode)
(setq default-major-mode #'text-mode)
(setq-default major-mode #'text-mode)
(setq major-mode #'text-mode)

I use:
GNU Emacs 22.2.1
GNU Emacs 25.1.1
They open always with Lisp Interaction mode.
No need to tell me that I can use: M-x text-mode.
And opening a file with a .txt extension.
So?


texts: What is the equivalent code of a Unicode character

texts:
For example I know that 2018 is the hexadecimal equivalent of left single quotation mark, and I have the following questions:

1: Is there a way to input the Unicode name to Emacs and get the equivalent code, and vice versa?
2: Is there a way to list them all?

I know I can list the Unicode names using C-x 8 RET TAB, but this list doesn't show the equivalent codes (preferably in decimal).


texts: Setting frame-title-format and icon-title-format to nil does not help.


texts: Is there a command/package to pretty print based on parentheses?

texts:
I'm dealing with large files of output from Haskell code, most of which is debug info of stuff generating using Haskell's show.

The important thing about that is that it's a large file of things, nested in either parentheses, or square-brackets.

Something like this:

[(Assign (FormalReturn (Canonical {home = Local, name = "testState"})) (Label 3),ReachingDefs (fromList [(IntermedExpr (Label 22),Just (Label 22)),(FormalReturn (Canonical {home = Local, name = "testState"}),Just (Label 3))])),
(Assign (ActualParam (Label 12)) (Label 12),ReachingDefs (fromList [(IntermedExpr (Label 22),Just (Label 22)),(ActualParam (Label 12),Just (Label 12)),(ActualParam (Label 19),Just (Label 19)),(FormalParam Anything (Label 9),Just (Label 8)),(FormalParam Anything (Label 16),Just (Label 15)),(Ref (Canonical {home = Local, name = "ref"}),Just (Label 16))]))]

The way it's printed, there's no spacing or newlines, so it's pretty much unreadable.

I'm wondering, is there a quick command which will take output like this in a buffer, and space/indent it in an easy-to-read way, based on the hierarchical structure of the parentheses?


texts: How to grep all the Info manuals with a regexp search

texts:
People often recommend on emacs.stackexchange.com and stackoverflow.com (in the Emacs tag) that we should learn to "ask Emacs".  The built-in Info-mode is not capable of performing a recursive regexp search that can compete with the likes of grep.

Q:  How can I recursively grep the Emacs manual (i.e., all .info files) with a regexp search?

[Keep in mind that some .info files may be gzipped, whereas others will be unzipped.  This largely depends upon the install options specified at the time Emacs is built from source.]

In a related thread on reddit.com, @kaushalmodi made an excellent suggestion to use the ag (aka The Silver Searcher) command-line utility in conjunction with the counsel / ivy /  swiper packages, and the following function was provided by said author:

https://www.reddit.com/r/emacs/comments/4vvwr9/grepping_the_info_files_versus_infomode/?ref=share&ref_source=link

  (defun counsel-ag-emacs-info (&optional initial-input)
  "Search for a pattern in emacs 'info/' directory using ag.
    INITIAL-INPUT can be given as the initial minibuffer input."
  (interactive)
  (counsel-ag initial-input (car Info-default-directory-list)
              " -z" "Search emacs/elisp info"))


texts:
I'd rather not use cl-lib and cl at the same time. However, I really like using lexical-let to specify the usage of lexical binding on a more granular level.

Is there any equivalent in cl-lib or vanilla Emacs Lisp?


texts: Toggle major mode with a custom key binding

texts:
I currently have 2 key bindings for switching between two major modes:

(global-set-key (kbd "<f12>") 'js2-jsx-mode)
(global-set-key (kbd "<f13>") 'web-mode)

How would I reduce that to a single key binding, so that it toggles between these modes depending on the current mode?


texts: how org-capture can insert value in an existing table line

texts:
I am diabetic and I have to take my blood glucose three times a day (morning, noon, evening)
I can do in three separate tables, and I create a table to group the daily records.
How could I capture all three readings in one table with org-capture?

The type 'table-line' create a new table line but I want to complete an existing line for the midday and evening values.

   |      date         |matin|midi|soir|
   |-------------------|-----|----|----||
   | [2019-03-27 mer.] | 120 |    |    |


texts: How can I perfectly simulate an automatic package install?

texts:
There is a nefarious bug in a project stored locally in ~/my/project/path.  This project is on MELPA, but installing from MELPA fails for some reason for some users. It's unknown why it fails, but I believe I've found a fix which I've committed to a separate branch to create a pull request for discussion.

To make sure that it's a fix (I'm the only contributor able to reproduce the bug at the moment), I want to simulate installing the package from the usual means – via M-x package-install sx – with all the necessary byte-compilation that goes along with it.


texts: Read and edit Thunderbird's maildir with GNUS

texts:
As forums tell it should be possible to use GNUS for reading maildir created by Thunderbird. I did not find, however, any working implementations posted. And in my own experiments I could not make GNUS to list groups (folders in maildir) to subscribe to.

This is what I did:

Manually set up gmail account in Thunderbird and selected the option Message Store Type as File per message (maildir)
Checked Thunderbird's directory where it should store emails in maildir format. In my case it is /home/username/.thunderbird/some-id.default/ImapMail/imap.gmail.com which contains the following:

drwxr-xr-x  4     4k 01-26 10:36 Archive
drwx------  6     4k 01-26 10:49 [Gmail].sbd
drwxr-xr-x  4     4k 01-26 10:36 INBOX
-rw-rw-r--  1 196.7k 01-28 12:28 Archive.msf
-rw-rw-r--  1   1.1k 01-26 10:30 Drafts.msf
-rw-rw-r--  1   2.5k 01-26 11:00 [Gmail].msf
-rw-rw-r--  1 973.4k 01-28 12:22 INBOX.msf
-rw-r--r--  1     25 01-26 10:30 msgFilterRules.dat
-rw-rw-r--  1   2.8k 01-27 12:28 Outbox.msf
-rw-rw-r--  1   1.1k 01-26 10:30 Sent.msf
-rw-rw-r--  1   1.2k 01-26 10:36 Templates.msf
-rw-rw-r--  1   2.8k 01-26 10:59 Trash.msf

Then I set the following GNUS options:

(setq gnus-select-method
     '(nnmaildir ""
         (directory "/home/username/.thunderbird/some-id.default/ImapMail/imap.gmail.com")
         (get-new-mail nil)))
(setq mail-sources nil)
(setq gnus-secondary-select-methods nil)

M-x gnus and press ^ (gnus-group-enter-server-mode)
Select {nnmaildir:} (opened) and press RET
... and see nothing (there are no groups)
... also nothing to subscribe to in *Groups* buffer when I press U (gnus-group-unsubscribe-group)
Tried to change permissions for imap.gmail.com/ (Thunderbird's maildir directory) with chmod -R +w+r+x imap.gmail.com/. Same results.

What is wrong? Why does not GNUS see the groups (mail directories)? How should I set up GNUS to read and edit Thunderbird mails?

(I am on ubuntu 16.04 LTS with Emacs 25.1.1 and Gnus v5.13)


texts: Can I use org-mode to structure my .emacs or other .el configuration file?

texts:
My .emacs configuration file gets bigger and bigger and I'd like to get a better overview and structuring by adding headings, subheadings and being able to hide or show them like I can do with Emacs org-mode.

I noticed that I can activate org-mode also in the .emacs buffer and that it is possible to add headings and collapse them. But will Emacs/Aquamacs still be able to load the Elisp code from the document if I add org-mode headings (i.e., lines starting with one or more asterisks)?

Can I have all that in one file or would I have to have one .*org file and then regularly export the Elisp code to another file?


texts: Emacs and fortran 90. In which subroutine am I?

texts:
I have a long file.f90 with several subroutines. Sometimes I'm editing some subroutine and I forgot where I'm (I mean the name of the subroutine that I'm editing).

I wonder what subroutine I am, I mean, where the cursor is (obviously, without move the cursor until the beginning to the subroutine to see its name). Is it possible?


texts: Tramp: Is there a way to use something like ssh-directory-tracking-mode but via ssh instead of ftp?

texts:
The boxes I'm working with are locked down and only have the SSH port (22) open, so I can't use directory tracking via FTP. But directory tracking is really handy.

There has to be a way. Does anyone know of a method or library that will do dirtrack-mode via SSH?


texts: IPython doesn't work in a virtual environment

texts:
I've set up a virtual environment with venv and installed Ipython there via pip. On the terminal it works. Now, in my init.el, I have

(setq python-shell-interpreter "ipython"
      python-shell-interpreter-args "-i")

(defun my-python-mode-setup ()
  (anaconda-mode)
  (anaconda-eldoc-mode)
  (setq-local company-backends
              (append '((company-anaconda)) company-backends)))

(add-hook 'python-mode-hook 'my-python-mode-setup)

When I run Python after having pythonic-activated my virtual environment I get the following messages

Making python-shell-interpreter local to *Python* while let-bound!
Making python-shell-interpreter-args local to *Python* while let-bound!
Sent python-shell-completion-setup-code
Sent python-ffap-setup-code
Sent python-eldoc-setup-code

And the console looks like this (there are escape characters before square brackets that here aren't shown):

Python 3.5.2 (default, Nov 23 2017, 16:37:01)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.

[79Cg
[79Cs
[79C2
   ...: 28eJ''', 'exec'));[26D
[J[?7h[?12l[?25h[?2004l
[?1l[6n[?2004h[?25l[?7l[JIn [2]: [8D[8C[?7h[?12l[?25h[?25l[?7l[?7h[?12l[?25h

If I run-python from outside the virtual environment, Ipython launches and works flawlessly, but in that case it uses python2.7.

Emacs is v24.5.1, on Ubuntu 16.04. All packages are at the latest version from the Gnu repository, or from Melpa if only available there (anaconda-mode is 20171223.1118).


texts: How can I set the default value for reading a directory name?

texts:
I have a folder hardcoded in variable:

(defvar folder-start-mine "/path/to/start/folder/")

Then I want to interactively define new non-existing subfolder name:

(defun my-new-defun (sel-subdir)
     (interactive "GNew folder: " folder-start-mine)
     (mkdir sel-subdir)
     ... do some stuff with sel-subdir ...
)

The file navigator in minibuffer starts in home folder and I want it to start in folder-start-mine.


texts:
I have a file setup.py created with Emacs and I set 744 permissions to it:

$ ls -la
total 8
drwxr-xr-x  3 user  staff   96 10 Dec 20:49 .
drwxr-xr-x  6 user  staff  192 10 Dec 20:47 ..
-rwxr--r--  1 user  staff   39 10 Dec 20:49 setup.py

When I edit the file so that Emacs auto-saves, it creates a linked file that represents a lock, which is also executable:

$ ls -la
total 8
drwxr-xr-x  4 user  staff  128 10 Dec 20:56 .
lrwxr-xr-x  1 user  staff   36 10 Dec 20:56 .#setup.py -> user@computer.local.587
drwxr-xr-x  6 user  staff  192 10 Dec 20:47 ..
-rwxr--r--  1 user  staff   39 10 Dec 20:49 setup.py

I save the file with Emacs, and the executable bit resets to 0:

$ ls -la
total 8
drwxr-xr-x  3 user  staff   96 10 Dec 20:56 .
drwxr-xr-x  6 user  staff  192 10 Dec 20:47 ..
-rw-r--r--  1 user  staff   40 10 Dec 20:56 setup.py

I have the same problem if I edit with -q, which skips initialisation:

$ chmod +x setup.py
$ emacs -q setup.py
2019-02-01 10:26:12.136 Emacs-x86_64-10_10[7566:50149] ...
$ ls -la
total 48
drwxr-xr-x  10 user  staff   320  1 Feb 10:26 .
drwxr-xr-x  15 user  staff   480 31 Jan 14:56 ..
-rwxr-xr-x   1 user  staff  2139  1 Feb 10:26 setup.py

The version is 26.1 (9.0).

How can I prevent Emacs from resetting the executable bit?


texts: Advanced org mode templating: a jinja-like system possible?

texts:
I use org-mode for notes and technical content writing. I find myself frequently copy-pasting snippets and changing values within this region. For example, a table whose cells change, but dimensions and headers remain the same. Is there a way to create a jinja-like template that will update based on input values?
The key here is update. What I cannot use:

Macros. These will simply insert static text. If I want to change the template, I will have the do this manually at each place, i.e. I'm looking for a solution that minimizes work not only at creation but also updating.
Yas snippets. Again, static text problem

How can I do this in org-mode?


texts: Place the current buffer at the end of the buffer list without switching buffers in the frame

texts:
Is it possible to place the current buffer at the end of the buffer list without switching buffers in the window?  I would like to write a wrapper function for ibuffer that modifies the buffer list so that the IBuffer buffer is at the end of the list after calling it.  The motivation is for the case when working on say src1.code and then I call ibuffer and use it to select src2.code, then the buffer list looks like (most recent at the top)

src2.code
*Ibuffer*
src1.code
    .
    .
    .

but I would like it to look like

src2.code
src1.code
    .
    .
    .
*Ibuffer*

In the Emacs manual at https://www.gnu.org/software/emacs/manual/html_node/elisp/Buffer-List.html, it says that there is a function bury-buffer that places a buffer at the end of the buffer list.  So I was hoping to write a function such as follows to achieve the desired result:

(defun ibuffer-bury-buffer ()
  "Calls `ibuffer` and moves the buffer to the end of the buffer
   list.  Doesn't work!"
  (interactive)
  (ibuffer)
  (bury-buffer))

But it seems that when you call bury-buffer using the current buffer in the window that it also changes the buffer to the next buffer in the buffer list.  Is there anything that can be done to prevent that?


texts: Magit configuration file location on Mac

texts: I want to reset Magit defults for particular pop up that was previously saved using magit-popup-save-default-arguments (https://magit.vc/manual/magit-popup.html). Where is the file created by magit-popup-save-default-arguments command located on Mac? Thanks,


texts: Syntax highlighting in sql-mode on Emacs-24 not working?

texts:
I'm trying to get the font-lock stuff in plsql.el (https://www.emacswiki.org//emacs/plsql.el) to work in Emacs 24 (that's the version provided by my Linux distro), but it doesn't highlight automatically on entering the mode and it only highlights strings and comments, not keywords like procedure.

This module is working on the old computer with Emacs 21, so I assume something has changed. The docs on emacswiki seem vague to a non-elisp programmer. (I can read elisp, and have written a few macros, but not an expert by any stretch.)

So, unless somebody knows of an alternative working PL/SQL mode that works with font-lock on 24, I'd like to start by looking at the font-lock settings, but I don't see any usable functions that start with font-lock- in the autocomplete list. How do I do this?

I made the change suggested by Stefan and moved the sql-mode line and got the same thing. The image is after running M-x font-lock-fontify-buffer. New computer on left, old on right.

Plain SQL mode doesn't do anything different.


texts: What prevents emacs from indenting and how can I force it to?

texts:
In certain modes, such as Python I have noticed that Emacs will not indent how I want it it to.

It is getting "smart".

For instance, in this block of code:

def vec_select(veclist, k):
    """Return a sublist of veclist consisisting of the vectors v in veclist where v[k] is zero

    Args:
        veclist: A list of vectors over the same domain
        k: An element of the domain
    #RIGHT HERE

    """

I am unable to double indent (where #RIGHT HERE is written).

Going to the beginning of a line and pressing tabs makes the text flush with "Args" (one indent) but pressing TAB again unindents (to the beginning of the line).

I find this behavior very annoying.  When I press TAB I want to indent (regardless of what mode I am in).

Is there a way to force this?


texts: How to let `lsp` to detect flake8 disable warnings' list

texts:
I am using LSP for Python.
I have following flake8 file at ~/.config/flake8, which was detected by default flycheck within emacs. I realize it is not detected by LSP and keep showing warnings  for E501 and so on. I have added following lines into my init.el but seems like it didn't help. How can I let LSP to detect ~/.config/flake8 to consider disabling warnings list that I defined.
(setq flycheck-flake8rc "~/.config/flake8")
(add-hook 'after-init-hook #'global-flycheck-mode)

(setq python-shell-interpreter "python3"
      python-shell-prompt-detect-failure-warning nil
      flycheck-python-pycompile-executable "python3"
      python-shell-completion-native-enable nil
      python-shell-completion-native-disabled-interpreters '("python3")
      )

(require 'flycheck)
(require 'flycheck-mypy)
(flycheck-add-next-checker 'python-flake8 'python-pylint 'python-mypy)

file=/home/alper/.config/flake8
[flake8]
ignore = W291,W293,W391,E501,E203,W503,E722,W605,E124,E231,E1126

update ==> Adding following line seems like solved the issue:
(setq-default lsp-pyls-configuration-sources ["flake8"])


texts: What kinds of mistakes does transpose fix?

texts:
The only times I've ever found a use for transpose-words or transpose-chars is when I accidentally hit one of them unintentionally, in which case a backward-word followed by transpose-words again would undo the problem.

It seems like the use case is something along the lines of accidentally typing food dog while meaning to type dog food, in which case transposition is helpful. For characters, I've always found backspace twice + retyping the two characters just as fast and less error-prone.

However, I have never, ever had this "word dyslexia" problem in my history of using Emacs. Given the relatively "important" key bindings that transpose commands get, it seems like I may be missing an important use case. Am I?


texts: Perform function until it returns user-error

texts: I want to define a function org-move-subtree-top that calls org-move-subtree-up until it returns a user-error (in this case "Cannot move past superior level or buffer limit"). How can I do this in elisp?


texts:
I bind M-o to next-word, and want to use M-O to shift-select next word.  M-O works well on Emacs GUI app on Mac, but not on Emacs in a terminal.

The reason is: In the terminal, up-arrow is encoded as M-O A (similar for other arrow keys), so M-O becomes a prefix key.

A solution is to use timeout, which was implemented by ergoemacs.
However, I don't use ergoemacs keymap, so I don't wanna install it yet.  Is there any other (smaller) package/function implemented the timeout solution?


texts:
I want to setup the imaxima buffer with working LaTeX output. Following the EmacsWiki, I added this to my init:
(add-to-list 'load-path "/usr/share/emacs/site-lisp/")
(autoload 'maxima-mode "maxima" "Maxima mode" t)
(autoload 'imaxima "imaxima" "Frontend for maxima with Image support" t)
(autoload 'maxima "maxima" "Maxima interaction" t)
(autoload 'imath-mode "imath" "Imath mode for math formula input" t)
(setq imaxima-use-maxima-mode-flag t)
(add-to-list 'auto-mode-alist '("\\.ma[cx]" . maxima-mode))

I have maxima installed on my machine (Void Linux) and it runs fine in a shell. There are indeed .el files in /usr/share/emacs/site-lisp/: imaxima.el, maxima.el, imath.el and others.
In Emacs, I launch M-x imaxima and land in a maxima buffer. There are two problems:

Everything crashes if I hit Return with no ; character at the end of the line. Emacs becomes totally unresponsive and I have to kill it.
When I put the ; character, there is an error message :

(%i1) 1 + 1;

LaTeX error in: 2

I have a texlive installation on my machine but perhaps imaxima runs the wrong command?
Has someone encountered these problems and has an example of a working configuration?
Edit 1:
If I run emacs with emacs 2> emacs-stderr.log, I find that nothing gets written to stderr at all.


texts: Controlling the width of the vertical scroll bar

texts:
I am using emacs 24.5 under Linux Gentoo, and I would like to adjust the vertical scroll bar width, as I notice it became much larger than it was in a recent revision.

How to do this in my ".emacs" file ?
I tried to manually set variable scroll-bar-width, but emacs reports it does not know this variable (although I came across it while reading the documentation).

Alternatively, I could live without the scroll bar after all (more text space is always fine with me).


texts: Icons breaking when using emacs as a daemon

texts:
I'm trying to use emacsclient and systemd as a way to have speedier access to an emacs session, instead of spinning a new one up every time I need it. However, I've run in to a small problem:

The modeline (and a lot of other icons) are broken within this emacsclient frame. Any frames launched from this emacs session have the same issue. However, when emacs is launched directly, instead of as a daemon...

It's fine. Everything is correct here.

And I'm not entirely sure what's the issue here. I'm not sure if it's by the means I'm launching/enabling emacs via systemctl, or if it's something config-related.

In any case, I'll provide both the systemd unit file I used, as well as my own config, and hopefully this can all be sorted out.

systemd file
init.el


texts:
I diminish my minor modes into single Unicode characters to save space. However, this obviously breaks down in a Linux TTY for instance. How can I detect if the current display method supports Unicode (or better yet, can display a specific character)?

Note: Simply detecting a graphical frame is not enough, as many graphical terminal emulators support Unicode, but emacs does not run in a graphical frame.


texts: How can I enable terminal-like (-nw) scrolling in the emacs window (scroll with cursor)?

texts:
When I open Emacs in -nw mode, scrolling simply moves the cursor position.  However, in normal Emacs, scrolling will move the position in the document, rather than the cursor.
I found similar questions but neither solution worked for me.  I'm hoping for a solution I can just put in my config file:
(when (not (display-graphic-p)) ;; when not in terminal
    (do-some-scroll-stuff))


texts: How to apply org-ctrl-c-ctrl-c-hook from command line?

texts:
This problem is so convoluted that maybe I should call it a puzzle...

On the Unix shell command line, I can convert TSV (tab-separated-values) input to org-mode table format with this perl one-liner:

perl -lpe 's/(?:^|$|\t)/|/g'

So, for example, I can write something like

<<<pipeline producing TSV rows>>> | perl -lpe 's/(?:^|$|\t)/|/g' > mytable.org

The contents of mytable.org would be a valid org-mode table, but it would not be nicely formatted.

For example, if <<<pipeline producing TSV rows>>> produced the following

1   ABCDEFG
234567  HIJKLMNO
890123  P

...the contents of mytable.org would be

|1|ABCDEFG|
|234567|HIJKLMNO|
|890123|P|

To format it nicely, I could

open mytable.org with Emacs;
set the major mode to org-mode (if it doesn't happen by default);
hit C-c C-c, aka org-ctrl-c-ctrl-c-hook, which has the effect of reformatting the table so that the delimiters line up; and
save the file;

...after which the contents of mytable.org would look like this

|      1 | ABCDEFG  |
| 234567 | HIJKLMNO |
| 890123 | P        |

My question is, how can I perform this reformating operation from the command line, without having to start an interactive Emacs session?

More specifically, is there a way to implement a pipeline component, that uses Emacs, and that I can insert right before the output redirection > mytable.org, like this

<<<pipeline producing TSV rows>>> | perl -lpe 's/(?:^|$|\t)/|/g' \
    | format-org-table > mytable.org

...that it would achieve the same final form of mytable.org as shown earlier?  The goal here is to avoid the need to "manually" open mytable.org with Emacs, then hit C-c C-c, etc.


texts: What are these prefix commands that start with s-l?

texts:
I'm using lsp-mode, and I see these weird prefix commands that start with s-l. How do I type them?

`lsp-mode' Minor Mode Bindings:
key             binding
---             -------

s-l             Prefix Command
C-S-SPC         lsp-signature-activate
<C-down-mouse-1>                lsp-find-definition-mouse
<C-mouse-1>                     ignore
<mouse-3>       lsp-mouse-click

s-l =           Prefix Command
s-l F           Prefix Command
s-l G           Prefix Command
s-l T           Prefix Command
s-l a           Prefix Command
s-l g           Prefix Command
s-l h           Prefix Command
s-l r           Prefix Command
s-l s           Prefix Command

s-l G g         lsp-ui-peek-find-definitions


texts: how to keep my abbrevs table files separate?

texts:
I'd like to maintain several distinct abbrevs files for different types of abbreviation expansions.

I have this:

(read-abbrev-file "~/Dropbox/elisp/main-abbrevs-file.abbrev_defs")
(read-abbrev-file "~/Dropbox/elisp/own-separate-abbrevs.abbrev_defs")

But what happens is the all the abbrevs in my other separate abbrevs files get automatically sucked into and added to my main abbrevs file, which I don't want.

I can do (setq save-abbrevs nil)... but this disables other functionality that I want, which is to automatically learn my typos and add them to my main abbrevs file—functionality which seems to require (setq save-abbrevs t).

How can I get it so that Emacs automatically learns new abbrevs from ispell, but still allow me to keep a separate abbrevs file with abbrevs that don't get automatically added to my main abbrevs file?


texts: Emacs script to indent files from the command line

texts:
I am trying to create an Emacs script that indents HTML files from the command line. This is what I have so far:
#!/usr/bin/env -S emacs --script

(require 'web-mode)
(indent-region (point-min) (point-max) nil)
(save-buffer)

I saved this file as indent and made it executable with chmod 755 indent. Then, I tried running it on an HTML file:
$ ./indent base.html
Loading /etc/emacs/site-start.d/00debian.el (source)...
Loading /etc/emacs/site-start.d/50autoconf.el (source)...
Loading /etc/emacs/site-start.d/50cmake-data.el (source)...
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
Loading /etc/emacs/site-start.d/50figlet.el (source)...
Loading /etc/emacs/site-start.d/50gettext.el (source)...
Package gettext-el removed but not purged. Skipping setup.
Loading /etc/emacs/site-start.d/50latexmk.el (source)...
Loading /etc/emacs/site-start.d/50pylint.el (source)...
Indenting region...
Indenting region...done

It seemed to work, but there is no output. The content of file base.html remains unchanged. I'd really like to get this working, because I want to use this command as a git hook to format HTML files using web-mode.el.
Could anyone help?


texts:
Projectile, as of versions marmalade-0.10.0 and melpa-20150720.515, seems to have lost access to the it variable. I think that dash may have changed the variable's scope. How can I work around this?

To reproduce:

Install marmalade-0.10.0 or melpa-20150720.515
Invoke projectile-find-file


texts:
I have an issue when exporting a table using *matrix environments. The align string appears in the cell content, whatever it is specified or not

#+CAPTION: my matrix
#+ATTR_LATEX: :mode displaymath :environment pmatrix
| 1 | 2 | 3 |
| 4 | 5 | 6 |

#+CAPTION: my matrix
#+ATTR_LATEX: :mode displaymath :environment pmatrix :align ccc
| 1 | 2 | 3 |
| 4 | 5 | 6 |

Any idea about how to solve that?


texts: Windows 10 native (spac)emacs install can't call cygwin binary (ledger) with proper path passed

texts:
I'd like to use Windows (10) native Emacs (spacemacs) and ledger (both installed via Chocolatey). The finance layer from spacemacs provides integration for it, however when I tried to run a simple register report it gave me the following error:

Report: reg
Command: "ledger" -f "c:/Users/USERNAME/Dropbox/Priv/2018.ledger" reg
=================================================================================================================================================

Error: Cannot read journal file "/cygdrive/c/Users/USERNAME/Dropbox/Priv/c:/Users/USERNAME/Dropbox/Priv/2018.ledger"

I assume this is because the chocolatey installed package is cygwin based.

Do You have an idea how to get rid of this problem?


texts: org :PROPERTY: "read only" and "no spell check"?

texts:
I have a very long document inside one org file, I plan to add more documents to it making many top level headers in it.

I was wondering if there is a way to set a property to an org section making it and it's sub-sections read only, and avoid flyspell check the spelling too.

I read The Kitchin Research Group: Make some org-sections read-only for the read only part, but I'm not sure if that way covers the all sub-sections too.


texts: It is safe to delete set free variables?

texts:
For example I have followins line of code (usually I get these code from answers).
(projectile-global-mode)

; smerge-mode
(setq smerge-command-prefix "\C-cv")
(setq undo-tree-show-minibuffer-help t)
(setq undo-tree-minibuffer-help-dynamic t)

For each (projectile-global-mode, smerge-command-prefix, undo-tree-show-minibuffer-help, ...) I am having following warning: assignment to free variable. As I understand free variable does not have any affect on emacs's setup.
=> Is it safe for me to delete them?


texts:
Is it possible, or does some function exists, to get the equivalent of the alt-q command, but in programming?

Suppose I've just written this in python:

group_parser.add_argument('-n',nargs=1, default=5,
help='specifies how many missing entries in a row are allowed before the whole row gets omitted.')

The following is a rather long line. Is it possible to have some sort of automation for getting the following output?

parser.add_argument('-n',nargs=1, default=5,
                    help='specifies how many ' +
                    'missing entries in a row ' +
                    'are allowed before the whole row gets ' +
                    'omitted.')

In other words, a function that detects long input strings, and splits them up across multiple lines.


texts: I want to type special Spanish characters in Emacs on a MacBook Pro keyboard ... but I have no clue where to start

texts: I am using Emacs 26.3 with macos Catalina and I would like to type the inverted exclamation point and question mark characters. Can someone point me to a link that will get me started towards understanding how to input special characters not available on my standard MacBook Pro keyboard.


texts:
I have read that using use-package, one can manage installation of the packages from the init.el file. Is there any specific command for that ?

Background: I'm planning to port my existing init.el to use use-package. But I'm not able to find any documentation of how to install all the dependencies of my init.el file. I can see in the documentation that they have the :ensure keyword which will install the software if it isn't present already, but it raises few other questions:

1) How to make use-package understand that you have to install this package from MELPA and that from marmalade.

2) Is there a single command for installing all the packages from init.el.


texts: `undo-tree-mode` only goes back a small number of steps when using Ensime, then "no further undo information"

texts:
When using undo-tree-undo in Spacemacs v 300 in ensime-mode, I will run into "No further undo information" after a small number of steps --- just around five or so.

I have the following variables set:

undo-no-redo nil

undo-limit 80000

undo-in-region nil

undo-tree-mode t

undo-outer-limit 12000000

undo-extra-outer-limit nil

I am unable to find any Ensime specific variables controlling undo behavior.

How can I maintain a larger undo tree when using Ensime?


texts: How do I start emacs with one horizontal split and one vertical split

texts:
Every time I start Emacs, I want two windows, side by side, and one terminal/shell window below them both, as shown here.

Please help me with the necessary code to my init file.


texts: Turn off jabber notifications when Emacs has focus

texts:
I use jabber.el to communicate with people at work, and I have sound
notifications setup so that I get notified even when I’m not using
Emacs. The notification is setup in the following way.

(add-hook 'jabber-alert-message-hooks #'my-jabber-sound-notification)

The problem is: when I’m actually writing in Emacs I already have
access to mode-line notifications, and the sound notifications are just a
useless distraction.

Is there a way to disable sound notifications while Emacs has focus?

I guess I could write something with an idle timer. But if there’s a
way to check if Emacs has focus in the window manager, that would be
much nicer.

Using Emacs 24.4


texts:
I find myself pressing C-c C-e l o yes RET quite often in org-mode because I want to view the file I'm working on as a PDF.

My simplistic attempts of automating this by feeding "lo" to org-export-dispatch were foiled by this interactive function not accepting any arguments as a quick look at its source code revealed.

How can this be automated so I can assign a shorter key binding to it?


texts: How can I run an async process in the background without popping up a buffer?

texts: I have defined some functions to run async background process using async-shell-command in my .emacs, but everytime I run the commands a new window (not frame) is created and the process' buffer is shown there. How could I run the command without the "pop up" buffer?


texts: Setting Exec-Path When Using Zsh and Tmux

texts:
I am using Emacs 25.2 with Zsh; and I have added the following to my init.el file to set both the Path and exec-path.

;; Set shell path
(defun set-shell-path ()
  (let ((shell-path (shell-command-to-string "$SHELL -i -c 'echo $PATH'")))
    (setenv "PATH" shell-path)
    (setq exec-path (split-string shell-path path-separator))))

(when (display-graphic-p)
    (set-shell-path))

When the above executes it results in the error:

  ("compaudit" "133" "command not found" "getent compaudit" "open terminal failed" ...)

My zshrc includes the following:

autoload -U compinit && compinit -i
...
# Launch Tmux.
if command -v tmux &> /dev/null; then
  [[ ! $TERM =~ dumb ]] && [[ ! $TERM =~ screen ]] && [ -z $TMUX ] && exec tmux -u
fi
...

Suggestions on how I can/should solve this error are appreciated? Thanks.


texts: How can I remove the logo image in the dashboard package?

texts:
I'd like to remove the image of the Emacs cow from the startup screen, but I want to keep my recent files, bookmarks, and agenda. Currently, I'm using the dashboard package with use-package.

My current configuration:

(use-package dashboard
  :ensure t
  :config
  (dashboard-setup-startup-hook)
  (setq initial-buffer-choice (lambda () (get-buffer "*dashboard*"))))

Thanks


texts: fill-paragraph does not honor fill-column

texts:
C-h v fill-column gives me 80.

Pasting the lorem ipsum text in *scratch* (lines longer than 80) then going M-x fill-paragraph fills around column 66.

The same in c-mode. In this mode, comment wraps seem to work, but not raw text outside code.

If I switch to text-mode, filling paragraphs work as I expect (column 80).

What makes it fail in *scratch* and in c-mode?


texts: How to enter/render d-hat in emacs and latex export

texts:
I want to be able to use d-hat (d with a caret (^) above it) in emacs to indicate an estimate of Cohen's 'd' (an effect size statistic).
How can I enter this in org-mode in a way that it renders within emacs, and also how can I make sure it exports out to latex/PDF?
Thanks
EDIT: Below are a tex file that resulted from a LaTeX export of a one-line org file, with the latex output
% Created 2020-09-17 Thu 16:09
% Intended LaTeX compiler: pdflatex
\documentclass[11pt]{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[colorlinks=true]{hyperref}
\author{U-BRXPS\brett}
\date{\today}
\title{}
\hypersetup{
 pdfauthor={U-BRXPS\brett},
 pdftitle={},
 pdfkeywords={},
 pdfsubject={},
 pdfcreator={Emacs 26.3 (Org mode 9.1.9)},
 pdflang={English}}
\begin{document}

\tableofcontents

This is a d-hat: \(\hat{d}\)
\end{document}

$ latex test.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (MiKTeX 20.6.29)
entering extended mode
(test.tex
LaTeX2e <2020-02-02> patch level 5
L3 programming layer <2020-07-17>
("C:\Program Files\MiKTeX\tex/latex/base\article.cls"
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
("C:\Program Files\MiKTeX\tex/latex/base\size11.clo"))
("C:\Program Files\MiKTeX\tex/latex/base\inputenc.sty")
("C:\Program Files\MiKTeX\tex/latex/base\fontenc.sty")
("C:\Program Files\MiKTeX\tex/latex/graphics\graphicx.sty"
("C:\Program Files\MiKTeX\tex/latex/graphics\keyval.sty")
("C:\Program Files\MiKTeX\tex/latex/graphics\graphics.sty"
("C:\Program Files\MiKTeX\tex/latex/graphics\trig.sty")
("C:\Program Files\MiKTeX\tex/latex/graphics-cfg\graphics.cfg")
("C:\Program Files\MiKTeX\tex/latex/graphics-def\dvips.def")))
(C:\Users\brett\AppData\Roaming\MiKTeX\tex/latex/grffile\grffile.sty)
y) (C:\Users\brett\AppData\Roaming\MiKTeX\tex/generic/pdfescape\pdfescape.sty)
(C:\Users\brett\AppData\Roaming\MiKTeX\tex/latex/hycolor\hycolor.sty)
(C:\Users\brett\AppData\Roaming\MiKTeX\tex/latex/letltxmacro\letltxmacro.sty)
(C:\Users\brett\AppData\Roaming\MiKTeX\tex/latex/auxhook\auxhook.sty)
(C:\Users\brett\AppData\Roaming\MiKTeX\tex/latex/kvoptions\kvoptions.sty)
("C:\Program Files\MiKTeX\tex/latex/hyperref\pd1enc.def")
(C:\Users\brett\AppData\Roaming\MiKTeX\tex/generic/intcalc\intcalc.sty)
(C:\Users\brett\AppData\Roaming\MiKTeX\tex/generic/etexcmds\etexcmds.sty)
("C:\Program Files\MiKTeX\tex/latex/url\url.sty")
(C:\Users\brett\AppData\Roaming\MiKTeX\tex/generic/bitset\bitset.sty
(C:\Users\brett\AppData\Roaming\MiKTeX\tex/generic/bigintcalc\bigintcalc.sty))
(C:\Users\brett\AppData\Roaming\MiKTeX\tex/generic/atbegshi\atbegshi.sty))
("C:\Program Files\MiKTeX\tex/latex/hyperref\hdvips.def"
("C:\Program Files\MiKTeX\tex/latex/hyperref\pdfmark.def"
(C:\Users\brett\AppData\Roaming\MiKTeX\tex/latex/rerunfilecheck\rerunfilecheck.
sty (C:\Users\brett\AppData\Roaming\MiKTeX\tex/latex/atveryend\atveryend.sty)
(C:\Users\brett\AppData\Roaming\MiKTeX\tex/generic/uniquecounter\uniquecounter.
sty))))
! Undefined control sequence.
<argument> U-BRXPS\brett

l.26  pdflang={English}}

?


texts: Extra indents in adaptive-wrap mode only for lines beginning with \item

texts:
When using the adaptive-wrap mode in the plain latex-mode (no AUCTeX), I want to give extra indents to only lines beginning with "\item". For example, I currently have:

\begin{itemize}
\item This is a very very very very very very very (soft-wrap here)
very very very very very very long line.

  And this is another very very very very very very (soft-wrap here)
  very long line.
\end{itemize}

Note that there are two leading white-spaces at the beginning of the second paragraph ("  And this is ..."), which wraps by adaptive-wrap nicely to my eyes. Now I would also like the paragraph beginning with "\item This is ..." to wrap with extra indentation even though it has no leading white-spaces. That is, I would like it displayed as follows:

\begin{itemize}
\item This is a very very very very very very very (soft-wrap here)
  very very very very very very long line.

  And this is another very very very very very very (soft-wrap here)
  very long line.
\end{itemize}

Please note the indentation at the beginning of the line next to the first soft-wrap. Could I do it somehow? Any help would be appreciated.

Globally setting adaptive-wrap-extra-indent to 2 makes all lines have 2 extra indents, which I want to avoid. I would like only the line beginning with "\item" have the effect.

Thank you.

PS. I am already very happy with the combination of latex-mode and adaptive-wrap, and this is the final issue I would like to resolve. I have the following in my .emacs file with some other stuff.

(load-library "adaptive-wrap")
(visual-line-mode 1)
(adaptive-wrap-prefix-mode 1)
(whitespace-newline-mode 1)


texts: org-mode export with ox-pandoc: setting CSS for HTML5 output

texts:
The latest versions of emacs and ox-pandoc already provide a great output but I need to customize the HTML5 output by setting a CSS stylesheet that matches my company's templates.
How can I do that?
I tried adding:
#+PANDOC_OPTIONS: css: ./style.css

and even
#+PANDOC_OPTIONS: css: <style>h1, h2 {color: #00abff;}; </style>

but I get this:
org-babel-exp process bash at position 3277...
Wrong type argument: stringp, nil

This would make producing reports so much easier than using word documents and slides and such manually.
Thank you!


texts:
Running in emacs -Q I set up this file and added it to my agenda

#+TAGS: [ toptag : subtag ]

* headline 1 :toptag:
* headline 2 :subtag:
* headline 3

org-tag-alist now has value (("[") ("toptag") (:grouptags) ("subtag") ("]"))

Per the docs, I should now be able to C-c / m toptag RET to find headlines matching either toptag org subtag.

But it only finds headline 1, tagged toptag. Wondering if I'd interpreted it backwards, I also tried  C-c / m subtag RET, but that only finds headline 2, tagged subtag.

How do I set this up and search to find a tag and all its children?


texts: How to write the result of running an external command to a scratch buffer?

texts:
I'm running this ex command in evil mode:
:%!grep -E "^\#"
how can I write the result to some arbitrary buffer, instead of replacing the content of the current buffer?


texts: How to add tab character while inside a rune (or string) in go-mode?

texts:
In go-mode, inside a rune hitting the tab key doesn't add the tab character.

E.g.:

var foobar = `
If I place the point at the start of this line and press tab it wouldn't add the tab character :(
`
var barfoo = 1 // I expect the tab character not to be added if I do the same  here

How can I get this behavior?

Trying what's proposed here doesn't do it.


texts: Running Anaconda Python within emacs on Windows

texts:
I have a Windows 10 machine, with the official GNU emacs Windows build, and Anaconda Python 3.7.3.  I can't get Python to properly run within emacs.  Whenever I start Python, I get the message:

Python 3.7.3 (default, Mar 27 2019, 17:13:21) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32

Warning:
This Python interpreter is in a conda environment, but the environment has not been activated.  Libraries may fail to load.  To activate this environment please see https://conda.io/activation

Type "help", "copyright", "credits" or "license" for more information.

And numpy, scipy, etc won't load.  I have tried several things with the pyvenv and elpy packages, all to no avail.  From a DOS prompt, I type 'activate' to activate the conda env.  I haven't setup any venv's of my own.


texts:
Is it possible to remove a sub-theme so that it does not appear in the theme list when invoking load-theme or customize-themes?

For instance removing only doom-spacegrey from the doom theme-set, while keeping the other sub-themes.

A related question is whether it is possible to install only a deliberate subset of sub-themes from a main theme.


texts: Where can I find pre-built Emacs for what Ubuntu calls emacs 25.1?


texts: Change the template used by the function LaTeX-section (C-c C-s)

texts:
In a document using LaTeX-mode (i.e., AUCTeX), the command LaTeX-section (C-c C-s) inserts a small template corresponding to a LaTeX sectioning element. How can these inserted templates be modified?

The original function inserts something like this:

\section{A Section}
\label{a-label}

And let's say that, instead, I'd like the command to insert something different, like:

\section{\color{red}A Section}\label{a-label}


texts: Make AUCTeX compile each \include to a separate file

texts:
In LaTeX it is customary to put the content of different chapters into different files which are then pulled into a master file using \include{FILENAME} statements. One can then use the \includeonly{SPEC} command to compile only those chapters which are specified by SPEC.

The TeX.SO question Typeset single chapter from book shows how to do this. Here comes my question:

  Is it possible to tell AUCTeX to parse through the master file and compile each of the \include'd files to its own pdf file?

Say I have this:

\documentclass{book}

\begin{document}
\include{Chap1}
\include{Chap2}
\include{Chap3}
\end{document}

in a file called Master.tex. The function I'm looking for would then compile Chap1 to Master_Chap1.pdf, Chap2 to Master_Chap2.pdf and so on [By using \includeonly I'd assume].


texts: How do I get better indication that my git configuration is wrong?

texts:
I ran magit-status, and was surprised by the absence of changes. It turned out that I'd misconfigured my git textconv settings, so 'git diff' was returning an error. However, I saw no indication of this in magit-status at all (for other git misconfigurations in the past I've seen a git process error buffer). Is there some debug variable I need to turn on?

This is with magit 20180630.1235 from melpa.


texts: Replace placeholder by incremental value

texts:
Windows 10
Emacs 26.1

I has the next text

[
  {
    "id": N,
    "name": "Agent#N",
    "address": "N Tabernacle St, London EC2A 4DD, UK"
  },
  {
    "id": N,
    "name": "Agent#N",
    "address": "N Tabernacle St, London EC2A 4DD, UK"
  },
  {
    "id": N,
    "name": "Agent#N",
    "address": "N Tabernacle St, London EC2A 4DD, UK"
  }
]

I need to replace N in every node by incremental integer value.
The result must be like this:

[
  {
    "id": 1,
    "name": "Agent#1",
    "address": "1 Tabernacle St, London EC2A 4DD, UK"
  },
  {
    "id": 2,
    "name": "Agent#2",
    "address": "2 Tabernacle St, London EC2A 4DD, UK"
  },
  {
    "id": 3,
    "name": "Agent#3",
    "address": "3 Tabernacle St, London EC2A 4DD, UK"
  }
]

Is it possible?


texts: How to have emacs format/indent javadoc comments correctly?

texts:
Very new to emacs.  (I only started day before yesterday.)  I'm writing some Java and was wondering if there's an option or something I can set up so it will indent Javadoc comments correctly.

What I mean by that is, if I type:

public class NiftyClass {

    /*
     * Here's what this method does.
     *
     * @return the answer
     */

every time I hit enter to start a new line in the Javadoc comments the pointer is at the left margin.  Inside the body of a method when I hit enter it takes me to the next line at the correct indentation.  I'd prefer that it do something similar with these comments, such that the pointer aligns itself underneath the previous *.  Or, better yet, that it add the next *space for me and start me right after that.

Is there anything that can do this?


texts:
In my .emacs file I have (split-window-right). This has been working fine so far, but now I'm finding it would be easier if my workspace looked like:

where each box is a separate window. So really I just need to split the right window in half after the initial split on startup. How can I do this?


texts: org-capture : how to choose the target file at the end of the process?

texts:
I use org-capture a lot, it's a terrific feature.

However, sometimes i'd like to choose the target of the note during or at the end of the process, not at the beginning from the template.

The process I imagine (below I use the exact terms of the variable org-capture-template, in italic:

C-c c
choosing the entry for it's template, not caring for it's target
typing my note
C-c C-c refiles my note at the place I want

So far, my org-capture-template is :
(("t" "Test" entry (file+headline "my/path/to/notes.org" "Entries to be refiled") (file "my/path/to/my-org-capture-template.org")))

with org-capture-template.org :

* %?
:PROPERTIES:
:TARGET-FILE:
:TARGET-HEADLINE:
:END:

What I want is C-c C-c running a function inferring the target, file and headline, from the value of TARGET-FILE and TARGET-HEADLINE, and refiling my note accordingly.


texts:
It looks like firefox has a remote debugging protocol,

https://wiki.mozilla.org/Remote_Debugging_Protocol

Does anyone know of any tools that would allow emacs to make a connection and to allow debugging from within emacs? Maybe I should file a feature request to port their protocol to a swank/slime protocol?


texts: Using code from other packages in your own

texts: I am currently making a package which is for my own use, but it will be publicly available on github. Some of the code is borrowed from another package. How do I properly accredit the copied code to the original authors? Both the original code and modified code are GPL licensed.


texts:
In org-agenda, it is possible to enable a "follow mode" so that moving the point over an agenda item automatically displays the linked item in another window.

In ivy-occur, you need to press f to get this, it doesn't happen automatically.

Is there a way to make j and k behave like j f and k f?


texts: Defining different fonts (color) per file in org-agenda

texts: My org-agenda view is made out of 5-6 files. Can one define a different face (mainly color) per file?


texts: Configuring Emacs and especially undo-tree-mode for tiling window managers

texts: I want to use Emacs in a frame-oriented fashion and let my tiling window manager handle buffer organization. For example, following this tutorial. By default, Emacs packages such as undo-tree-mode seem to be dependent on windows to display the visualization. Am I wrong on this? Can I make undo-tree-mode default to opening the visualizer in another frame?


texts: How to use fixed point decimals in emacs lisp?

texts:
How to use large decimal numbers with fixed precision, like money amount, in emacs lisp? For example, I'm writing a function that takes amount of money as a parameter. When I pass large float like 999999999999999.01 it looses precision and becomes 999999999999999.0. I didn't find fixed type in manual. My workarounds are:

Pass two integers separately, integer part and fraction part - like dollars and cents
Pass amount as string and parse it to two integers,

but both of this approaches will be less convenient for users.


texts: Count and display the number of subheadings

texts:
With this:

* Cookie counter [0/2]
- [ ] Item 1
- [ ] Item 2

I can count the number of list items or TODO items.

But what if I just want to count the number of subheadings? Is it possible to get something like this:

* Cookie counter [2]
** Item 1
** Item 2

So, I wrote a function as follows:

  (defun my-no-of-headings ()
    (interactive)
    (save-excursion
      (length (org-map-entries t t 'tree))))

But when I execute it at the beginning of the heading, it does not display the number of subheadings.

What do I do to actually see the number of headings?


texts: Specifying org-agenda-custom-commands to skip both UNSCHEDULED and specific tag

texts:
I am setting a org-agenda view where I could see my unscheduled TODO items (except those with a specific tag):
(setq org-agenda-custom-commands
      '(("n" "unscheduled TODOs"
         ((agenda "" nil)
          (alltodo ""

                   ((org-agenda-overriding-header "UNSCHEDULED TODO entries")
                    (org-agenda-skip-function
            '(org-agenda-skip-entry-if 'timestamp 'tag ":GHD:")

                     )))))))

I can't make the "tag ":GHD:" line work. The agenda shows these items.
Help! :)


texts:
I'm working with GNU Emacs 26.1
I have troubles with setting up butler.

(add-to-list 'load-path "~/.emacs.d/elpa/deferred-20170901.1330/")
(add-to-list 'load-path "~/.emacs.d/elpa/butler-20150812.8/")
(require 'butler)
(add-to-list 'butler-server-list
             '(jenkins "SERVER-NAME"
                       (server-address . "https://<server>:443")
                       (server-user . "<username>")
                       (server-password . "<password>")))

When i try to run butler-statusi see this in *Messages* buffer:

Contacting host: <server>:443
deferred error : (error "Bad bounding indices: -6, nil")

I haven't found a way do debug this issue.
As the traffic flows through https, i can't see actual request and response.
Also I'm bad at lisp so looking at butler's *.el files doesn't help :)


texts: What happens if I have different versions of Emacs using the same directory

texts:
Currently I have two versions of Emacs (system installed by apt-get: emacs26 and my own compiled version emacs27). They both us emacs.d directory, and I wonder what happens the packages are incompatible with emacs27. May I use a different .emacs.d" such as.emacs27.d` for only emacs27.

Is it okey to use the same directory for different version of Emacs.


texts: Magit connecting to github with alternate ssh key

texts:
I have two github accounts – one personal and one for my job. In most of my repos, I use my work account and magit works fine. In a couple personal repos, I have this in .git/config:
sshCommand = ssh -i /my/home/directory/.ssh/personal/id_rsa -F /dev/null

This works well from the command line for things like git push, but when I try to push from magit, I get this error:
ERROR: Permission to <personalaccount>/unified_docs_switcher.git denied to <workaccount>.

Since my work account is mentioned in the error message, it seems like magit's connection to git is ignoring the line in .git/config.
Is there some other config I can add to magit to recognize this?
Is there a different/better solution in magit to using different github accounts?
(Edit: emacs 27.1 on MacOS from here, tested on magit 2.90.1 from melpa-stable and then 20210105.1030 from melpa)


texts: Where are recentf entries stored? How can I import them into another emacs installation?

texts:
I've installed emacs on a new OS, and would like to maintain my 'recentf' file history entries (they'll be in the same location thanks to symlinks).

Where are these entries stored? And how could I export + improt them to the new emacs installation?


texts: How to insert/dump all keyboard macros at once?

texts:
Is there a way to show all keyboard macros (similar to insert-kbd-macro) without having to first name each macro?

Using macros with evil-mode in case this makes a difference.


texts: help with dired function i wrote..how to insert current file at point into buffer?

texts:
i have zero coding skills but somehow (mainly goggle) managed to write this script

(defun z/dired-shell-other-window-beets ()
  "Open a shell with dired path in a new window and issue beet import on file at point "
  (interactive)
  (let ((buf (shell)))
    (switch-to-buffer (other-buffer buf))
    (switch-to-buffer-other-window buf)
(insert (concat "beet import "  (dired-copy-filename-as-kill) ))

))

what im trying to do is issue a interactive shell command (beet import) on the current folder point is on in dired

i managed to get the beet import inserted to the new shell buffer thats opened but how do i follow that with the current dir name/path?


texts: Can counsel-git-grep for string search keep the history of previous searches?

texts:
In general when I run M-x and do control-p or control-n or (M-p) (M-n) I can move around the previous inputs that I provided in the past. Is it possible to achieve it in counsel-git-grep ?

I am using [counsel-git-grep][1] to grep for a string in the current Git repository.
Lets assume I am searching string " hello world " and close it.
When I do re-run counsel-git-grep and do ctrl-p; I just want to obtain the my previous inputs like hello world.


texts: How to put a html attribute in the header of an orgmode file so it applies to all images on export?

texts:
To export to html an orgmode file which has links to multiple images, each of which has to have a given width, you can put something like #+ATTR_HTML: :width 800 above each image.
Is there a way to put this into the header of the file so that it will apply to all images without repetion?


texts: Copy the extra information lines from *Org Agenda*

texts:
It's somehow strange.
In the *Org Agenda* you can get extra information with v c (time gaps) or v E (some entry text).
What I want is just to copy the extra information (text lines) with the rest of the text, so just to copy all the text from the *Org Agenda* buffer -- nothing else.
I have tried org-copy-visible or even C-x C-w; org ignores the extra information and doesn't copy them.
C-x h also ignores the extra information lines.
How can I copy the whole buffer text?


texts: emacs orgmode files rendering and reminders

texts:
I'm receiving task/todo lists in this format (orgmode) .
Emacs is useful for creating and editing this, but useless for end users who want to have well rendered lists/sublists (similar to MS Outlook tasks style or any other desktop organizer) and of course the primary function for any organizer software: flexible desktop reminders.
Is there some GUI software for the work with this format, for any OS?


texts: Refresh org statistics cookies automatically

texts:
I try to automatically refresh statistics cookies while changing buffer to org buffer, saving buffer, showing agenda and refreshing agenda.
I know it's possible to update entire file by calling org-update-statistics-cookies with prefix.
Any ideas?


texts: Is there a command to delete items from an org list?

texts:
I have an org-mode list.

1) John
2) Paul
3) Jimmy
4) George
5) Ringo

I've decided that item number three doesn't belong on this list. I can purge this item by removing it and then issuing C-c C-c and the list updates.

1) John
2) Paul
3) George
4) Ringo

Is there a command to do this automatically?


texts:
I am trying to set :scale 2.0 in org-format-latex-options with the follows line in my .emacs file:
(plist-put org-format-latex-options :scale 2.0)

However I get the error:
Symbol's value as variable is void: org-format-latex-options

I am following the advice from these posts: post one and post two. Can someone please explain what is going wrong and how to fix it?


texts:
I have been struggling to find a simple and direct question to the answer and therefore I have decided to ask here.

Q: Is there a way to use Super in Emacs launched in a Terminal in Linux?

P.S: I read a lot of information about xmodmap but I think the key is that the terminal emulator cannot represent the Super key. However, (kbd "s-SPC") returns something and I was thinking of using the translation facility of .Xdefaults/X. Am I on the right path? Given the result of kbd, what do I need to put as XTerm.VT100.translations?


texts: Call a function before a specific major mode starts

texts:
I have a setup function that I want to run before I use pdb/gud to debug a Python script. I know about gud-mode-hook which runs after the debugger starts (too late) and change-major-mode-hook which, if I understand correctly, runs when you change major modes but before the major mode hook for the new mode (early enough, but will run in cases I don't want it to). How can I have a function called before a specific major mode is initialized?

So for my particular use case the flow would be something like:

M-x pdb -> (my-setup-function) is called -> pdb starts (i.e., it's hooks are run etc.)

So far I have tried doing this with major mode hooks pdb-mode-hook and gud-mode-hook but then the setup doesn't happen in time, and is only available the next time I run pdb. At one point I tried to do it with advice as well, but was not successful (potentially, because I did it wrong). This is what I tried (though I am confused as to whether or not this counts as advice):

 (add-function :before (pdb) #'my-setup-function)

...which I based on a snippet from the Emacs Lisp Reference manual:

(add-function :before (process-filter proc) #'my-tracing-function)

Obviously, I have not set this up right, and I get the message that (pdb) is not a valid place expression when I evaluate it. Even though (because?) the documentation for add-function is very detailed, I have a lot of trouble understanding how to use it properly.


texts: color rgrep matching results in the rgrep results buffer

texts: I am liking rgrep as it lets you choose a path and searches recursively. How is it possible to highlight the matches in the rgrep buffer?