texts:
#+NAME: fun1
#+BEGIN_SRC elisp :var var1="val1"
(format "%s" var1)
#+END_SRC

#+NAME: fun2
#+HEADER: :var var2="val2"
#+CALL: fun1(var2)

#+NAME: fun3
#+BEGIN_SRC elisp :var var2="val2" var3=fun1(var2)
(format "%s" var3)
#+END_SRC

Both fun2 and fun3 complain Reference 'var2' not found in this buffer

Update:
I need to simplify this form

#+NAME: funA
#+BEGIN_SRC elisp :var varA="valA"
(format "%s" varA)
#+END_SRC

#+NAME: funA2E
#+CALL: funA[:var varF="valF"](funB(funC(funD(funE(varF)))))

#+CALL: funA2E("foo")

#+CALL: funA2E("bar")

#+CALL: funA2E("baz")


texts: org-time-stamp-custom-formats are just reformatting the date for the org files, not writing it as is

texts:
I use dates in org-mode(C-c .) and the format is like this:
(setq-default org-display-custom-times t)
(setq org-time-stamp-custom-formats '("<%Y-%m-%d>" . "<%Y-%m-%d %a %W %H:%M>"))

It parses the date in the format:
<2020-08-20>

On the other hand I open the org-mode files with different text editors and under the hood the format is:
<2020-08-20 чт>

Is this how it normally works? Is there any way to change the date format of org-mode's date C-c . to print without the day, just as seen as in the org file?


texts: Dynamic IP address for org babel ssh dir param

texts:
I use this in emacs to connect and execute commands remotely:

#+BEGIN_SRC sh :dir /ssh:app_user@34.143.149.84:/tmp
pwd
#+END_SRC

#+RESULTS:
: /tmp

Recently, people have gone "cloud scaling" so the IP address 34.143.149.84 changes often.

The IP address can be determined by this bash:

sentinel list staging | grep InService | ruby -ne '$_=~/\A  (.*?) /; puts $1' | tail -n 1

How can I modify the header

+BEGIN_SRC sh :dir /ssh:app_user@34.143.149.84:/tmp

to dynamically determine the IP address.


texts:
Inspired by this blog I wrote a function which replaces arithmetic expressions between two $ symbols with the mathematical result inline (and deletes the $ symbols). How can I modify this such that it recognizes if the expression is invalid and prints an error message (without without modifying or replacing the expression) in this case in the minibuffer.

(require 'calc)
(defun calc-eval-and-insert ()
  "Replaces an arithmetic expression between two $ sympols with the result. Example expression: $2*(3 + round(5.5))$"
  (interactive)
  (let (result p1 p2)
    (skip-chars-backward "^$“")
    (setq p1 (point))
    (skip-chars-forward "^$“")
    (setq p2 (point))
    (setq result (calc-eval (buffer-substring-no-properties p1 p2)))
    (goto-char p1)
    (delete-char -1)
    (setq p1 (point))
    (goto-char p2)
    (delete-char -1)
    (delete-region p1 p2)
    ;(insert " = " result)
    (insert result)
    )
  )

(global-set-key (kbd "C-c r") 'calc-eval-and-insert)

Since I am a beginner in elisp, other suggestions of how to improve the code are also welcome.

Edit

I just noticed that executing it on $2 + 2.2.2$ results in a "Bad Format" error (as expected). But for example $roundd(2.2)$ (instead of $round(2.2)$ results in no error messages but replaces the expression with round(2.2).


texts: Copy a file content to clipboard with dired

texts:
I would like to emulate the fonctionnality of xclip in dired. That is, copying file content to clipboard (but without opening it in Emacs).
Sadly, using dired-do-async-shell-command and xclip does not work.
Any ideas ? Thanks !


texts: How can I get flush left text in org-indent-mode?

texts:
I open an org file in emacs and it displays thus:

I enable word wrap with M-x visual-line-mode and get:

But I prefer the extra indenting of headlines provided by org indent mode, so then do M-x org-indent-mode and get this:

Which spoils the body text indentation. What I would ideally like is for all the body text to remain flush left, beginning under the S of each Sn heading.

How can I do this please?


texts: Jump to next merge conflict in project using Magit and Smerge

texts:
When I am resolving merge conflicts with Magit and Smerge, is there a way for me to cycle through all merge conflicts in the project? Currently I can only move through them one file at a time.

I wrote something like this as as utility but it's not great:

(defun jump-to-first-merge-conflict ()
  (interactive)
  (magit-status)
  (beginning-of-buffer)
  (magit-section-forward-sibling)
  (magit-section-forward-sibling)
  (magit-section-forward)
  (execute-kbd-macro (kbd "<return>")))

It would be nice if I could just use smerge in a project context, instead of a file context.


texts: How can I create a dired buffer listing all open files?

texts: I have a mechanism for burning items to disc from a dired buffer.  Unfortunately,  the file's I've patched are strewn accross the file system.  How can I create a dired buffer from all open files?


texts: What is the good resource for getting started using EMACS?

texts:
I have not used EMACS seriously in 20 years.

I work on a Mac and am a vi/Eclipse person now.

I want to switch back to EMACS for C and C++ programming.

When I was researching EMACS add-on packages for C and C++ programming I quickly stumbled onto some good resources:

https://www.emacswiki.org/emacs/CProgrammingLanguage
https://tuhdo.github.io/c-ide.html
http://cedet.sourceforge.net

However after several hours of tinkering I was left pretty much where I started.

What I was looking for was:

A light weight configuration
Syntax highlighting
Make file editing
Compilation and integration with the error and warning output form EMACS
Execution without have to switch to a terminal
A basic interface to GDB or LLDB
Syntax completion would be a good extra

Any thoughts on where I can start this journey?


texts: Toggle org-html-head-include- only when publishing

texts:
I use org-mode to publish a blog which is based on org files in a particular directory. I've customized values in html-head, html-preamble, and html-postamble with some Bootstrap code to get the desired html code marked up and everything works well. Accordingly, I've set org-html-head-include-default-style and org-html-head-include-scripts to nil.
I also sometimes use org-mode to export files in other locations to html which I may sometimes share (e.g., with coworkers). However, because I've set org-html-head-include-default-style and org-html-head-include-scripts to nil, those exports are boring (lack HTML tags that are included by default). I'd like to toggle org-html-head-include-default-style and org-html-head-include-scripts depending on where I'm publishing from (e.g., nil when exporting from my blog directory, other t when exporting from anywhere else). How do I achieve this?
My org-mode config is something like the following:
(setq org-html-htmlize-output-type 'css)
(setq org-html-head-include-default-style nil)
(setq org-html-head-include-scripts nil)

(setq org-publish-project-alist
      '(("orgfiles"
         :base-directory "~/blog/content/"
         :base-extension "org"
         :publishing-directory "/ssh:user@blog.com#22:/blog/"
         :recursive t
         :html-head "<!-- 3rd party css and js -->
<link rel=\"stylesheet\" type=\"text/css\" href=\"https://blog.com/site/3rdParty.css\"/>
<script src=\"https://blog.com/site/3rdParty.js\"></script>

<!-- Site css and js -->
<link rel=\"stylesheet\" type=\"text/css\" href=\"https://blog.com/site/site.css\"/>
<script src=\"https://blog.com/site/site.js\"></script>"
         :html-preamble "... preamble code ..."
         :html-postamble "... postamble code ...")))

Do I need to create some function (to toggle org-html-head-include-default-style and org-html-head-include-scripts) and a hook for org-publish depending on my present working directory?


texts: How can I enable greek language spellchecking in Emacs to be the default spellchecking language, and how can change spellchecking between greek and english language?  (My system is Ubuntu 14.04 64bit).


texts: Emacs cannot find virtual drive defined by MS Windows command `subst`

texts:
I am using spacemacs (0.200.13@26.1), but this should be applicable to vanilla Emacs too. The version of Emacs I'm experiencing this issue on is "GNU Emacs 26.1 (build 1, x86_64-w64-mingw32) of 2018-05-30".
I created a virtual drive in windows, using the subst MS Windows command. Something like this:

w: subst c:/users/me/projects

Then, I open Emacs and try to access this drive. I fail to do so and the only information I get back is.

  The system cannot find the drive specified.

How to solve this? Can I even use virtual drives in Emacs?


texts:
I have a mediawiki table with three columns and some rows, eg.:

{| class="sortable"
! Column header (one) !! Middle column !! Last column
|-
| value 1 || loong value ... and some more || another value
|-
| some|| more ||rows
|}

How do I efficiently swap the second column (the one with the Middle column heading) with the last one?

I just did it with query-replace-regexp and it wasn't so bad, but I suppose there must be a nicer way. Answers either for stock GNU Emacs 24.3, or using some generally useful packages (eg. multiple-cursors) will be appreciated.


texts:
I'm thinking of making a UI which has different font size/color for different lines.
Can I change the font of a particular line, like the color and size?
Org-mode can do this for headlines, so I suppose this is possible, but I couldn't find a way to do it.


texts: How do I run an Emacs function from the terminal with an argument?

texts:
I want to install icon font for that I need to run all-the-icons-install-fonts function. According to the documentation I have to type: emacs --batch -f all-the-icons-install-fonts in the terminal. After that I get the message: "Symbol's function definition is void: all-the-icons-install-fonts".
The Emacs help says "When PFX is non-nil, ignore the prompt and just install" and that's what I need, but I can't pass any argument to this function because -f flag means "call Emacs Lisp function FUNC with no arguments".
Is it possible to run this function with an argument or suppress prompt(no questions asked)?
Emacs version: 27.1


texts: Emacs times out trying to read from /dev/tty on startup?

texts:
After several years of being annoyed of Emacs on Ubuntu (not Mac via brew) having a ~2-3 second delay before displaying file contents at startup I finally decided to debug this.

I ran strace -r emacs and piped all output to a file. Reading through the file I noticed that there were only three syscalls that took longer than 10ms and they were all pselect6 calls. One of the calls in particular was taking a lot of time (if you're not immediately familiar with -r it shows the time between syscalls):

0.000499 pselect6(4, [3], [], NULL, {1, 996507900}, {NULL, 8}) = 0 (Timeout)
1.997844 ioctl(3, FIONREAD, [0])   = 0

and tracing that back to the open call with fd 3:

0.000000 open("/dev/tty", O_RDWR|O_NOCTTY) = 3

So Emacs is timing out, waiting for user input on startup?

This occurs regardless of what init scripts I use and I've tried both enabling and disabling the splash screen. All to no avail, the 2 second delay persists.

The only thing that seems to affect this 2 second pause is to hit a key, which will take me directly to the file you wanted to open.

I've tried installing both Emacs 23 and 24 and both are affected.

Here is a screenshot of what Emacs looks like while waiting:
http://imgur.com/5WWKL0h
And here is after the 2 seconds are up and scratch has loaded:
http://imgur.com/ZRfSJxg

Does anyone know how to get emacs to not wait for input on /dev/tty?

Edit:
Here's the entire strace log from starting up emacs:
https://paste.ee/r/cL5jP


texts: reload bookmarks file without restarting Emacs?

texts:
I'm using Emacs (latest master branch as of June,2017) and I'm using Syncthing (like Dropbox) to store my emacs-bookmark file which I load in my configuration using

'(bookmark-default-file "~/Sync/emacs-bookmarks")

On one computer I have to do a bookmark-save command to output my current bookmarks to the ~/Sync/emacs-bookmarks file. On the other computer this file is updated but when I do a list of bookmarks using C-x r l the listing is not refreshed it's showing the old bookmarks.

Is there a way without restarting emacs to reload the bookmarks file?


texts:
The code constantly prints server-process: nil instead of the server process name:

-*- lexical-binding: t; -*-
(let* ((port 1234)
       (server-process 'something))
  (setq server-process
        (make-network-process
         :server t
         :name "libbasecampel-oauth-http-server"
         :service port
         :buffer (generate-new-buffer "*libbasecampel-oauth-http-server*")
         :filter (lambda (_process _data)
                   (message "server-process: %s" server-process)))))

Can someone please explain why I can't access the server process from the filter lambda? Also, I would like to know how to do it, my goal being to kill the server when data arrives.

In case you wonder, the _process argument to the filter function is the client process, not the server one.


texts: function to add/split a new line each time a dot (.) is present?

texts:
Im looking for a way (function) to add/split a new line each time a dot (.) is present?

for example turn this

When a user wants to communicate with the computer, the user interacts with an application. The application interacts with the operating system, and the operating system makes hardware components to work according to the user given instructions. The hardware components sends the result back to the operating system, then the operating system forwards the same to the application and the application shows the result to the user.

to this

When a user wants to communicate with the computer, the user interacts with an application.

The application interacts with the operating system, and the operating system makes hardware components to work according to the user given instructions.

The hardware components sends the result back to the operating system, then the operating system forwards the same to the application and the application shows the result to the user.

Any ideas would be greatly appreciated!


texts: Problem with org-export: how to avoid hard-wrapping when exporting to text?

texts:
When I export my org buffer to text, I would like not to have it hard-wrapped.
I do not know how to disable this feature. I have asked previously years ago, but have not found an answer for this simple problem.

Thank you,
EG


texts: Stop company-lsp from completing function arguments

texts:
I try to configure lsp-mode and company-lsp with python-language-server for python autocompletion, but when I choose completion candidate it completes with function arguments. How can I prevent this behaviour?

For example for function

def foo(arg1, arg2):
    ...

It will autocomplete like

foo(arg1, arg2)

I tried to set (setq lsp-enable-snippet nil) but it didn't help


texts: How to output an octave array as a org-mode table?

texts:
I am trying to output a matlab/octave array as an org-mode table. So for an array/matrix like

a =[ 1 2; 3 4; 5 6];

I'd like to have a 3 by 2 org-mode table. I tried to just echo the array a as if in matlab, but it does not work. I am wondering how to make the output work.

More specifically, for an input array:

#+name: test-data
#+begin_src octave :session test_case :exports both
  a =[ 1 2; 3 4; 5 6];
#+end_src

#+RESULTS: test-data
: org_babel_eoe

I can generate its size as a table:

#+NAME: test-output-size
#+BEGIN_SRC octave :session test_case :results value :colnames yes :hline yes
  size(a)
#+END_SRC

#+RESULTS: test-output-size
| 3 | 2 |

But when I tried to print the array a itself as a table, I got no output:

#+NAME: test-output-value
#+BEGIN_SRC octave :session test_case :results value :colnames yes :hline yes
  a
#+END_SRC

#+RESULTS: test-output-value
: org_babel_eoe

I also tried disp(), to no avail. So my question is:

What is the proper way to output an array as a table?

(This is with the Emacs 26 in Ubuntu 20.04 LTS)


texts: I have some TODO headings with italicized text. These display correctly in Org buffers, but aren't fontified and italicized (slanted) when retrieved as part of an agenda view. Is there a way to ensure that /foo/, which is rendered as /foo/ in an Org buffer, is also displayed as /foo/ in an agenda view?


texts: How can I view the full `package-alist` value (without the truncation characters "...")?

texts:
When I do C-h v package-alist, I see something like

((PACKAGE-NAME1 [cl-struct-package-desc
                PACKAGE-NAME1
                (VERSION1)
                "DESCRIPTION1"
                (DEPENDENCIES-ALIST1)
                nil
                nil
                "LOCAL-INST-PATH1"
                (URL-ALIST1)
                nil])

 (PACKAGE-NAME2 [cl-struct-package-desc
                PACKAGE-NAME2
                (VERSION2)
                "DESCRIPTION2"
                (DEPENDENCIES-ALIST2)
                nil
                nil
                "LOCAL-INST-PATH2"
                (URL-ALIST2)
                nil])
  ...)

How can I see the full alist instead of its truncated form with the ellipsis characters ... at the end?


texts: I use quite a lot the useful command show-branches and I couldn't find the analogue command to hide all the branches under a certain Item. In other words my aim is to fold only a subtree and its parent. How to do this?


texts: How to GPG-sign a commit when reverting in Magit?

texts: When I commit in Magit, I have the option to "Sign using GPG". But when I revert a commit in Magit, I don't see this option. Is it hidden? If so, how do I activate signing in that context? Otherwise, does the feature not exist?


texts: Modifying the reader would allow introducing new read-syntax (such as #(hash table) and '(quoted)).  Many Lisps have this capability, but no such facility seems to exist for elisp.


texts: Finding Numbers in Brackets and Summing Them

texts:
QUESTION:

How can I make an emacs command M-x sum-the-brackets that scans highlighted text for all occurrences of [ <number> u ] and [ <number>u ],  and sums them?

EXAMPLE:

Selecting the text

Here is some text. [0.1u]
Here is some more text [0.2 u]
And here is some noise: 0.2

and running M-x sum-the-brackets should yield 0.3 in the mini-buffer.


texts: js2 mode doesn't recognize variable in "for in" statement

texts:
When I use a for in statement, js2 mode doesn't recognize the new variable:

let foo = {bar: 1};

for(key in foo) {
    console.log(key);
}

It prints:
Undeclared variable or function 'key'


texts: Fontconfig Error in Snap version of Emacs

texts:
I installed Emacs 26.3 using Snap in my Debian Buster. After I launch it, it gives me the following errors:

Fontconfig warning: "/etc/fonts/fonts.conf", line 5: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/fonts.conf", line 6: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/fonts.conf", line 6: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/fonts.conf", line 6: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/fonts.conf", line 7: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/fonts.conf", line 7: invalid attribute 'version'
Fontconfig warning: "/etc/fonts/fonts.conf", line 9: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/10-hinting-slight.conf", line 4: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/conf.d/10-hinting-slight.conf", line 5: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/conf.d/10-hinting-slight.conf", line 5: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/conf.d/10-hinting-slight.conf", line 5: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/conf.d/10-hinting-slight.conf", line 6: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/conf.d/10-hinting-slight.conf", line 6: invalid attribute 'version'
Fontconfig warning: "/etc/fonts/conf.d/10-hinting-slight.conf", line 8: unknown element "description"
Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 4: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/conf.d/10-scale-bitmap-fonts.conf", line 5: unknown element "its:translateRule"
...
Fontconfig warning: "/etc/fonts/conf.d/90-synthetic.conf", line 4: unknown element "its:rules"
Fontconfig warning: "/etc/fonts/conf.d/90-synthetic.conf", line 5: unknown element "its:translateRule"
Fontconfig error: "/etc/fonts/conf.d/90-synthetic.conf", line 5: invalid attribute 'translate'
Fontconfig error: "/etc/fonts/conf.d/90-synthetic.conf", line 5: invalid attribute 'selector'
Fontconfig error: "/etc/fonts/conf.d/90-synthetic.conf", line 6: invalid attribute 'xmlns:its'
Fontconfig error: "/etc/fonts/conf.d/90-synthetic.conf", line 6: invalid attribute 'version'
Fontconfig error: Cannot load config file from /etc/fonts/fonts.conf

To check if it is any issue related to my system, I installed Emacs 26.2 using flatpak but it gave me no error. (However Im not using flatpak's version as it makes Emacs look alien)
So what could be the issue??

Emacs works fine, though with these warnings and error.


texts: Issue archiving when maintaining org-mode subtree structure

texts:
I'm trying to archive DONE org-mode tasks while maintaining the subtree structure. There's a partial solution for what I'm trying to attempt at https://gist.github.com/edgimar/072d99d8650abe81a9fe7c8687c0c993.

This could be a really nice solution, however, it only works for me when executing on a single DONE task. If I try extending it to all DONE tasks in a subtree using org-map-entries as shown below, it creates a new top-level * ARCHIVED heading each time it's run. Is there a way to avoid this unwanted behavior?

Example of undesired behavior with org-map-entries

Define function to operate on all DONE tasks in current subtree:

(defun org-archive-done-tasks ()
  (interactive)
  (org-map-entries 'org-archive-subtree-hierarchical "/DONE" 'tree))

Note: org-archive-subtree-hierarchical defined in above link.

Now if I take the following buffer

* Project 1
** TODO Task 1
** TODO Task 2
** TODO Task 3

and mark Task 1 as DONE, run org-archive-done-tasks on Project 1, and then do the same for Task 2, I get

* ARCHIVED
** Project 1
*** DONE Task 1

* ARCHIVED
** Project 1
*** DONE Task 2

* Project 1
** TODO Task 3

Here is the desired result, which is what would happen if org-archive-subtree-hierarchical were run directly on ** DONE Task 1 and then ** DONE Task 2 (as children of * Project 1)

* ARCHIVED
** Project 1
*** DONE Task 1
*** DONE Task 2

* Project 1
** TODO Task 3

The whole point is to avoid having to run such an archive command on each individual DONE task. Is the desired behavior possible using something similar to org-map-entries? Is there a better method of executing org-archive-subtree-hierarchical on all DONE tasks in a subtree multiple times without duplicating the archive target heading?


texts:
I work a lot these-days with org-reveal to create presentations for some of my classes.

Each time to see what I've changed and how it would look, I need to manually export using C-e R R. Is there a way to auto export the current org file to a reveal html file of the same name when I save manually?

If the manual save methods is to difficult, I wouldn't mind automatically exporting every X minutes.


texts: Emacs insane CPU load caused by org-superstar-mode

texts:
if I try to open a fairly large file in emacs with org-mode enabled (loads of bullets and babel snippets), emacs uses an insane amount of cpu - my cpu is maxed out for 30 sec or so. I am running a spacemacs instance which I have extensively modified over the years.
I have found the culprit via profiler-report (see below). org-superstar-mode seems to use a lot of resources. however, I find no way of disabling it. i also do not remember installing or enabling it (does it ship with org-mode?)
So, 3 questions:

has someone else experienced this behaviour
any hints on exploring the cause of high cpu load further?
hints on disabling superstar-mode?

  - funcall-interactively                                       49485  97%
   - #<lambda 0x14898bcabbc69a1a>                               48160  94%
    - find-file                                                 48160  94%
     - find-file-noselect                                       48157  94%
      - find-file-noselect-1                                    48150  94%
       - after-find-file                                        48140  94%
        - normal-mode                                           48014  94%
         - set-auto-mode                                        47994  94%
          - set-auto-mode-0                                     47991  94%
           - org-mode                                           47991  94%
            - run-mode-hooks                                    44502  87%
             - apply                                            44502  87%
              - run-hooks                                       44502  87%
               - org-superstar-mode                             40013  78%
                - org-superstar--fontify-buffer                 39993  78%
                 - font-lock-ensure                             39973  78%
                  - jit-lock-fontify-now                        39973  78%
                   - jit-lock--run-functions                    39973  78%
                    - run-hook-wrapped                          39973  78%
                     - #<compiled 0x4010f3d>                    39973  78%
                      - font-lock-fontify-region                39973  78%
                       - font-lock-default-fontify-region              39973  78%
                        - font-lock-fontify-keywords-region              39932  78%
                         + eval                                 21488  42%
                         + org-fontify-meta-lines-and-blocks              16664  32%
                         + org-activate-links                     510   1%
                         + org-do-emphasis-faces                  458   0%
                           org-fontify-drawers                    116   0%
                           org-activate-code                       16   0%
                           org-activate-dates                      13   0%
                           org-activate-tags                       10   0%
                         + org-activate-footnote-links                  6   0%
                           org-font-lock-add-priority-faces                  6   0%
                           font-lock-prepend-text-property                  4   0%
                           org-fontify-macros                       3   0%


texts: Can I create a shortcut for this operation?

texts:
I've been learning emacs the for last few days, trying to get some python development going, until I ran into this. Is it possible to create a shortcut to execute this command specificly? And if yes, what is this command exactly ? :) I've been doing some digging and didn't find quite the thing I was looking for.

]1


texts: How to export Markdown from Org-mode with ``` syntax?

texts:
I can export Markdown from Org (using C-c C-e) but #+BEGIN_SRC lang ... #+END_SRC is not exported as i expected as: ```lang ... ```.

I would like that the code source will be replaced with ``` (markdown syntax), any suggestion?


texts: Emphasize (make bold) texts within a subscript for LaTeX exports?

texts:
There are some mathematical equations in the form of:

G_{u}

which I enter in org-mode as

$G_{*u*}$ or $G_{ *u* }$

It gets displayed correctly in org-mode, but when exported to LaTeX, the asterisks are interpreted as literal texts.

Is there a way to get LaTeX export to properly recognize that the subscript should be wrapped in \textbf{}?

There doesn't seem to be a problem with non-subscript texts, e.g. $ *X* $.


texts: `case` doesn't switch correctly with strings

texts:
I have the following code which doesn't work:

(eval-when-compile (require 'cl))
(setq mymachine (system-name))
(case mymachine
  ("HP" (setq package-user-dir (concat user-emacs-directory "packages/hp")))
  ("DELL" (setq package-user-dir (concat user-emacs-directory "packages/dell")))
  ("MBP.local" (setq package-user-dir (concat user-emacs-directory "packages/mbp")))
)

There's something happening in the key comparison between the variable mymachine and its three possible values. The following does work, however:

(when (string= system-name "HP")
  (setq package-user-dir (concat user-emacs-directory "packages/hp")))
(when (string= system-name "DELL")
  (setq package-user-dir (concat user-emacs-directory "packages/dell")))
(when (string= system-name "MBP.local")
  (setq package-user-dir (concat user-emacs-directory "packages/mbp")))

But I would prefer, for the sake of legibility, to use the case key selection.

What's happening here?


texts: Hiding State Changes of Org Mode Repeating Task

texts:
I have several repeating tasks (some with the "habit" style). I like my setup but now I have a lot state changes log just below the not drawers. For example:

** TODO Random Task                                                   :dailies:
SCHEDULED: <2015-12-03 Thu 13:00 ++1d>
:PROPERTIES:
:LAST_REPEAT: [2015-12-02 Wed 16:59]
:ID:       BA24BAA8-5094-49C9-A014-619C8D98F25E
:STYLE:    habit
:RESET_CHECK_BOXES: t
:CATEGORY: AccordionLearn
:END:
- State "DONE"       from "TODO"       [2015-12-02 Wed 16:59]
- State "DONE"       from "TODO"       [2015-12-01 Tue 14:16]
- State "DONE"       from "TODO"       [2015-11-27 Fri 18:55]
- State "DONE"       from "TODO"       [2015-11-23 Mon 22:02]
- State "DONE"       from "TODO"       [2015-11-18 Wed 17:02]

is there a way to hide the  Lines:  - State "DONE"       from "TODO"    ...?


texts: Antialising of light text on dark too heavy (OS/X 10.10)

texts:
Is anyone else using an Emacs 24.x build on OS/X 10.10 with light colors on a dark background? I'm seeing the text rendered unusually thick and bold.

The same font (Inconsolata) with the same colors and same text on Sublime Text and Terminal.app is rendered much thinner. (Conversely it seems quite thick on iTerm 2 too).  Dark text on a light background seems to render just fine.

This is with straight Gnu Emacs and the Emacs-mac variant both installed via Homebrew.

As a workaround I'm using the Source Code Pro "extra light" variant which looks okay, but would prefer to use Inconsolata. Are there compile-time options or font attributes I can set to influence the rendering (antialising I'd guess) of text?


texts: org-mode and following links to `#+name: target` things

texts:
I have the following in my org-mode buffer:
#+name: my-element-name

and then I made a link to that:
and here is a link to [[my-element-name]].

According to the org-mode manual on internal links, that ought to work, but when I try to following the link with C-c C-o, I get an error: Wrong type argument: stringp, nil.
I'm using org 9.4 from ELPA; I've used edebug on some of the functions and it seems that something isn't working deep inside org-link-search but I couldn't figure out where. I see some regexp matching in that function...this seems like something that ought to work.
Using NAME instead of "name" didn't make a difference.
Is this expected to work? It seems like it.
(More generally, what's the difference between "dedicated targets" -- the ones <<like-this>> -- versus "named elements" with #+NAME: some-name-here?)


texts: Don't complain about unmatching parenthesis and brackets in latex math mode

texts:
In mathematical notation, parenthesis and brackets have overloaded meaning, and when it comes to represent intervals, the parenthesis/brackets don't have to match. For example,

(1, 2]

means an interval with left open and right closed. But unfortunately, in math mode in latex mode, this becomes fairly annoying that whenever notation likes this is used, emacs highlights it as error.

For example,

But outside of math mode, it's really not normal if any mismatches happen. I am wondering if you guys got a way to fix it?

enabled minor modes:

Enabled minor modes: Async-Bytecomp-Package Auto-Composition Auto-Compression
Auto-Encryption Auto-Fill Auto-Revert Company Diff-Auto-Refine Electric-Indent
File-Name-Shadow Flyspell Font-Lock Global-Eldoc Global-Font-Lock Global-Git-Commit
Global-Hi-Lock Global-Undo-Tree Hi-Lock Latex-Preview-Pane Line-Number Linum
Magit-Auto-Revert Magit-File Menu-Bar Mouse-Wheel Origami Override-Global Projectile
Pyvenv Rainbow-Delimiters Save-Place Shell-Dirtrack Show-Smartparens
Show-Smartparens-Global Tex-Pdf Tool-Bar Tooltip Transient-Mark Undo-Tree Yas


texts: How do I make evil-search-forward / evil-search-backward use fuzzy search?

texts:
I'd like to search in buffer with the same fuzzy style that turns the search string into a regexp that splits characters and joins them with .*, like in Helm command search.

Is there a way to do this for evil-search-forward and evil-search-backward in Spacemacs?


texts:
Is it possible for emacs to detect a press and immediate release of a meta key?
I would consider binding this to toggle-input-method.  I know there are external programs that can make tapping a modifier equivalent to a different key, but I would like to keep the ability to bring up a menu by tapping alt/meta.


texts: Viewing the number of words in org or text files in one of the details columns in Emacs Dired

texts: Is there a way to display the number of words in org or text files in one of the details columns in Dired? This would save having to open each file individually and count the words by selecting the whole region and typing M-x =.


texts: Why doesn't M-v following C-v move cursor back to the original position?

texts: M-v following C-v doesn't move the cursor back to the original position. Why is that? Can we make it happen?


texts: Setting up flycheck in pair with different mode is not working

texts:
For the SQL-mode I use the package Sqlint with Flycheck. This works fine. Now I switched to the package EDBI which is an database interface for Emacs. There is a query editor built-in.  I would like to tell flycheck that he must syntax-check the query editor with the help of the SQL-lint.

The major mode of the query editor is edbi:sql-mode.

After reading the well written documentation of flycheck, I have set it up as following:

(eval-after-load 'flycheck
  '(progn
     (flycheck-add-mode 'sqlint 'edbi:sql-mode)))

After evaluating it and creating a new buffer, Flycheck doesn't have any checker in the edbi:sql-mode, as M-x flycheck-verify-setup tells me the following:

  Syntax checkers for buffer *edbi:query-editor 1 * in edbi:sql-mode:

  There are no syntax checkers for this buffer!

  Flycheck Mode is disabled.

I wonder why flycheck doesn't use sqlint in edbi:sql-mode? It's set up following  the documentation.


texts: Is there a plugin that does color HTML matching tags like rainbow delimiters?

texts:
I would like some plugin which colors html tags with a corresponding color based on which tag they match. For example

 and
 would be highlighted the same color while
 and
 would be highlighted the same color, but differently than the div tags. It wouldn't be based off of what type of tag it is, just what depth it is.


texts: Error running timer (wrong-number-of-arguments equals 3)

texts:
I am trying to automatically change my Emacs theme according to time set (Thanks to answer provided by Dan).
My code looks like this:
(setq emacs-curr-theme nil)
(setq emacs-light-theme 'faff)
(setq emacs-dark-theme 'atom-one-dark)

(defun emacs-synchronize-theme ()

  (let ((hour nil) (now nil))
    (progn (setq hour
        (string-to-number
            (substring (current-time-string) 11 13)))
    (if (member hour (number-sequence 7 13))
        (setq now emacs-light-theme)
        (setq now emacs-dark-theme))

    (if (equal now emacs-curr-theme now)
        nil
        (progn
          (setq emacs-curr-theme now)
          (load-theme emacs-curr-theme t))))))

(defun emacs-set-theme ()
  ;; Load theme only when using GUI
  (when (display-graphic-p)
      (run-with-timer 0 900 'emacs-synchronize-theme)))

When I am calling the function emacs-set-theme from my init.el, I am getting this error -
Error running timer 'emacs-synchronize-theme': (wrong-number-of-arguments equal 3)

I have no clue what I am doing wrong here. I have checked documentation for run-with-timer, but unable to figure out the problem by myself.


texts:
How can I modify (or replace) elpy-shell-send-region-or-buffer (bound to C-c C-c) to behave like ess-eval-region-or-function-or-paragraph-and-step, i.e.

if region is active, evaluate it (this currently works), goto 4.
if inside a function, evaluate it, goto 4.
evaluate current paragraph
Jump to the beginning of next paragraph

Thank you very much!


texts: Melpa packages auto updating makes then incompat

texts:
I did some work on my machine that should not have affected my current HD (installed an OS on a
secondary disk; ran update-grub). When I booted to my primary working HD I find that nearly all my installed ELPA packages have become incompat or deleted. I did nothing to my system to account for the change. A LaTeX document I was working on reverted to an earlier version. Had to get current version from backup. Nothing else on my system so far seems amiss.
I'm running Devuan (fork of Debian) Beowulf operating system. I have TeXLive 20200731 (version 3.14159265-2.6-1.40.21) installed. Off hand it seems that the ELPA packages that acquired the incompat status were upgraded and thus came to depend on a newer version of emacs than what is currently stable for my operating system (emacs 26.1). For example vcard acquired an incompat status because it depends on Emacs 27.1.
Some ELPA packages were automatically deleted. For example AUCTeX is not loaded because its status became deleted:
Status: Deleted in ‘auctex-12.3.1/’.
Version: 12.3.1
Summary: Integrated environment for TeX
Requires: emacs-24.1, cl-lib-0.5
Required by: auctex-lua-20151121.1610
Other versions 12.1.2 (installed)...
In this case it is not because of dependencies. AUCTeX 12.3 is the current version. Is there a
LaTeX file or set of files on my backup that I can restore to return to my earlier state? If I simply reinstall TeXLive that would not seem to return ELPA packages to earlier versions. Or is there a simpler way to get back to my prior state?


texts: Get pandas data-frame as a table in org-babel

texts:
In the following example, I create a very simple pandas DataFrame and export results verbatim:

#+BEGIN_SRC python :exports both :results verbatim :return test
import pandas as pd
test = pd.DataFrame({'A': [1000, 1000], 'B' : [60, 100]})
#+END_SRC

#+RESULTS:
:       A    B
: 0  1000   60
: 1  1000  100

If I try to have the output as a table, things get messed up:

#+BEGIN_SRC python :exports both :results value table :return test
import pandas as pd
test = pd.DataFrame({'A': [1000, 1000], 'B' : [60, 100]})
#+END_SRC

#+RESULTS:
| A    B |

Is there any way to fix this?

Expected output:

|   |    A |   B |
| 0 | 1000 |  60 |
| 1 | 1000 | 100 |


texts: Executing programs the efficient way with Spacemacs

texts:
I'm a Vim user trying to learn Spacemacs. In Vim, I execute a Scheme program by typing :mit-scheme < xxx.scm. After the program exits, I can continue editing simply by press Enter.

However, doing this in Spacemacs (in evil mode, of course) would create a new buffer, which I have to kill manually by typing three characters: <space> b d. This is quite inconvenient for me, because I'm a inexperienced programmer who needs to execute programs very frequently while debugging.

How to make execute a program more efficiently in Spacemacs? For example, I want close the output window/buffer in one keystroke. I'm also glad to know if I can replace :mit-scheme < xxx.scm with some key bindings.


texts: Evil-surround: How can I make `ves(` act like `ves)`?

texts:
Same question for surrounding with bracket and braces as well. I'd like visually highlighted text to be surrounded without any added whitespace.

Currently ves( on text will result in ( text ) whereas ves) will result in (text). Because I will never need the spaces I'd just like to make ves({[ act like their closing parens/bracket/braces counterpart.


texts: bookmark+: after emacs restart the bmkp-jump-dired/bmkp-jump wont work before visiting buffers

texts:
this is a weird issue regarding Bookmark+. after an emacs restart the bmkp-jump-dired/bmkp-jump-1 functions wont work (when I launch them via a command such as in a hydra) before visiting the buffers.

This is what i see in my message buffer:

Loaded /home/zeltak/.emacs.d/settings.el
For information about GNU Emacs and the GNU system, type C-h C-a.
Invalid face reference: quote [24 times]
bmkp-jump-1: No bookmark specified

anyone else has this issues or know what causes this?


texts: How to use describe-key in Helm results buffer?

texts:
While in the results buffer of helm-projectile-grep, I know I can use C-<up> and C-<down> to visit the files with the matches, but I would like to rebind those keys.

Normally I would use C-h k to run describe-key on the C-<up> sequence, then use the function name in global-set-key.

But typing C-h k in the results buffer (which I'm assuming in Helm's case is an expanded minibuffer, not sure about the terminology) only appends k to the search string, ignoring the C-h.

So how do I find out which function a key sequence is bound to in that situation?


texts: Closing emacs after TRAMP session is aborted

texts:
Sometimes i work on remote machine (or several) via TRAMP. However, sometimes sessions end in such a way they cannot be reopened later.

In such situation, closing emacs results in unacceptable delays as futile failing attempts to reconnect to remote host go on; even if all buffers are killed.

How to avoid that and ensure emacs simply closes without resorting to means of sysstem process control?


texts: How to Debug Javascript in HTML in Webmode.el

texts:
I am new to Emacs webmode. I was wondering how to debug javascript embedded into my html page using webmode.el. The script is in the <script> tag.

I'd like to see break lines and see the values as they progress and have the error shown describing the issue.


texts:
I'm using emacs on ubuntu 19.04. This is my init file

(use-package org
    :ensure t
    :pin org)

(use-package org-bullets
      :ensure t
      :config
      (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1))))

bullets are not supported in the terminal mode as well as GUI mode

What am I doing wrong?

I tried M-x RET revert-buffer-with-coding-system and tried different UTF encodings available such as utf-8, utf-8-unix, utf-8-dos, utf-8-mac, prefer-utf-8, prefer-utf-8-unix and so on.. but no sulution

M-x RET describe-current-coding output

Coding system for saving this buffer:
  U -- utf-8-dos (alias: mule-utf-8-dos cp65001-dos)

Default coding system (for new files):
  U -- utf-8 (alias: mule-utf-8 cp65001)

Coding system for keyboard input:
  U -- utf-8-unix (alias: mule-utf-8-unix cp65001-unix)

Coding system for terminal output:
  U -- utf-8 (alias: mule-utf-8 cp65001)

Coding system for inter-client cut and paste:
  nil
Defaults for subprocess I/O:
  decoding: U -- utf-8-unix (alias: mule-utf-8-unix cp65001-unix)

  encoding: U -- utf-8-unix (alias: mule-utf-8-unix cp65001-unix)

Priority order for recognizing coding systems when reading files:
  1. utf-8 (alias: mule-utf-8 cp65001)
  2. iso-2022-7bit
  3. iso-latin-1 (alias: iso-8859-1 latin-1)
  4. iso-2022-7bit-lock (alias: iso-2022-int-1)
  5. iso-2022-8bit-ss2
  6. emacs-mule
  7. raw-text
  8. iso-2022-jp (alias: junet)
  9. in-is13194-devanagari (alias: devanagari)
  10. chinese-iso-8bit (alias: cn-gb-2312 euc-china euc-cn cn-gb gb2312)
  11. utf-8-auto
  12. utf-8-with-signature
  13. utf-16
  14. utf-16be-with-signature (alias: utf-16-be)
  15. utf-16le-with-signature (alias: utf-16-le)
  16. utf-16be
  17. utf-16le
  18. japanese-shift-jis (alias: shift_jis sjis)
  19. chinese-big5 (alias: big5 cn-big5 cp950)
  20. undecided

  Other coding systems cannot be distinguished automatically
  from these, and therefore cannot be recognized automatically
  with the present coding system priorities.

Particular coding systems specified for certain file names:

  OPERATION TARGET PATTERN      CODING SYSTEM(s)
  --------- --------------      ----------------
  File I/O      "\\.tzst\\'"            (no-conversion . no-conversion)
                "\\.zst\\'"             (no-conversion . no-conversion)
                "\\.dz\\'"              (no-conversion . no-conversion)
                "\\.txz\\'"             (no-conversion . no-conversion)
                "\\.xz\\'"              (no-conversion . no-conversion)
                "\\.lzma\\'"            (no-conversion . no-conversion)
                "\\.lz\\'"              (no-conversion . no-conversion)
                "\\.g?z\\'"             (no-conversion . no-conversion)
                "\\.\\(?:tgz\\|svgz\\|sifz\\)\\'"
                                        (no-conversion . no-conversion)
                "\\.tbz2?\\'"           (no-conversion . no-conversion)
                "\\.bz2\\'"             (no-conversion . no-conversion)
                "\\.Z\\'"               (no-conversion . no-conversion)
                "\\.elc\\'"             utf-8-emacs
                "\\.el\\'"              prefer-utf-8
                "\\.utf\\(-8\\)?\\'"    utf-8
                "\\.xml\\'"             xml-find-file-coding-system
                "\\(\\`\\|/\\)loaddefs.el\\'"
                                        (raw-text . raw-text-unix)
                "\\.tar\\'"             (no-conversion . no-conversion)
                "\\.po[tx]?\\'\\|\\.po\\."
                                        po-find-file-coding-system
                "\\.\\(tex\\|ltx\\|dtx\\|drv\\)\\'"
                                        latexenc-find-file-coding-system
                ""                      (undecided)
  Process I/O   nothing specified
  Network I/O   nothing specified


texts: how to select and edit text in multiple different lines

texts:
everyone I'm trying to achieve a behaviour described here Fundamentals of multiple-cursors.

Particulraly the following comment:

Edit several places simultaneously. Either mark several instances of a string like before, but cancel the selection (but not the cursors) immediately using C-g

The only problem is that there is not detailed explanation or description of the commands to achieve that.

Can someone please give an example on can I accomplish that?
Thanks in advance!


texts: Avoid minor modes from turning off when changing/restarting major mode

texts:
Is there a smart way to keep locally enabled minor modes enabled when changing/restarting major modes without adding it to the mode hook or enable it globally?

For instance, if I usually don't use paredit, but decide one day I want to try it out, but then want to change my major mode from emacs-lisp-mode to lisp-interaction-mode. How can I do this without paredit being disabled?

More specifically I want this to be the case with an extension I am writing for org-mode, where I want a variable to be updated when org-ctrl-c-ctrl-c is run, but because org-mode in some contexts restarts and thus disables my minor mode, it is unable to do this without always being enabled with org-mode.


texts: How can I automatically add some local variables info to a C-x C-f new (.tex) file?

texts:
I use auctex to edit my .tex files. Each time I create a new file .tex file via C-x C-f, I want to insert two local variables informations:

% Local Variables:
% coding: utf-8-unix
% TeX-engine: luatex
% End:

Until now, I do M-x add-file-local-variable two times. Is there a way to automate this?


texts: How to turn off "error" highlighting in emacs-lisp-mode for Emacs 25?

texts:
Since the update, a certain style of formatting code is highlighted with font-lock-warning-face:

How do I turn off this behavior?


texts: Evil mode interacting with python.el (invoking skeletons)

texts:
Skeletons such as python-skeleton-if in python.el has been giving me problems - I never use them but they get invoked unexpectedly. If they are invoked, it is a pain to get out of it and also it messes up my code.

I tried to use python-mode instead of python.el but it seems it gets loaded by other packages (such as lisp/cedet/semantic/wisent/python.elc) when I look at load-history and thus whenever I open a .py file python.el is always loaded.

Since the skeletons are my main issue, I was wondering if there is a way to completely disable all the skeletons?

---- Edited ----

It seems like Evil mode is interaction with python.el. Specifically, evil-normal-state after typing if invokes python-skeleton-if.

For example, if I type if and then press ESC, it invokes python-skeleton-if.


texts: How to show completions in minibuffer instead

texts: Is there a simple way to make it so that the *Completions* buffer that pops up when, say, tab completing on a find-file doesn't create a new buffer but shows the possible completions in the minibuffer? I've spent quite a bit of time trying to figure out how to do this, but am finding it a lot harder than I expected.


texts:
I am connecting regularly to servers via tramp. Sometimes everything works fine but often times my messages buffer gets spammed full of

Tramp: Waiting for prompts from remote shell...done
Tramp: Found remote shell prompt on ‘134.60.29.152’
Tramp: Opening connection for 123.630.239.152 using ssh...done

everytime I type something in a .py file. If I log into a different machine (same setup Ubuntu 18.04) it does not occur. I use build in tramp and did not specify anything with respect to tramp. If I open on the remote machine e.g. .bashrc this problem does not happen. does anyone know what the problem is?

thanks in advance


texts:
When using the agenda in org-mode to show my daily tasks, there's a bunch of tasks scheduled for that day (or with past deadlines) that appear at the bottom.

I'd like these tasks, and only these, to be sorted by category.

Is that possible?


texts: Can the kmacro internal format contain literal commands?

texts: I'm trying to modify key-chord.el so that you can have key-combination specific timeouts and I noticed that key-chord uses heuristics to decide when two keys pressed sequentially in a kmacro are intended to form a key chord. I don't completely understand the heuristics yet, but it seems like a better approach would be to detect when the keychord is being executed inside a kmacro, delete the relevant keys from the kmacro, and insert a command in their place. I tried skimming the kmacro.el source distributed with emacs and it's not clear to me how to insert an input event that's more complicated than a simple key press into a kmacro, or if only key presses are supported.


texts: Prevent emacs to indent when yanking into html buffer

texts:
I have disabled electric indent mode, as specified here, but when yanking text, indenting is still performed.

I am yanking text into an html buffer, and I do not want any change whatsoever to be applied to the yanked text. I want it as-is, no indentation, no nothing.

How can I achieve this? I am running:

  GNU Emacs 24.5.1 (x86_64-pc-linux-gnu, GTK+ Version 3.18.9)  of
  2016-04-17 on lgw01-04, modified by Debian


texts: Activate a mode when only one window is displayed

texts:
I'm trying to enable/disable visual-fill-column when there is one window/multiple windows.
Since I don't like trying it on my own before asking, here is the solution I came up with:
(defun my-visual-fill-one-window ()
  (global-visual-fill-column-mode -1)
  (if (one-window-p)
      (global-visual-fill-column-mode 1)
    (global-visual-fill-column-mode -1)
    )
  )

(add-hook 'window-state-change-hook 'my-visual-fill-one-window)

I have three problems (maybe more but these are the three I could identify):

Problem 1
I need to disable the mode globally at the start of the function because if I don't and try to split one window horizontally I have the following error (strangely, I don't have it if I M-x visual-fill-column-mode manually and split the window without having this function hooked):

split-window: Window #<window 3 on file> too small for splitting

Problem 2
Treemacs stops working (I can't open its window) with the following error:

treemacs--popup-window: Wrong type argument: window-live-p, nil

Problem 3
I'm hooking it to  window-state-changed-hook because it looked like the most suited one but maybe I could do better (the main problem being that if I use ivy-posframe it's considered as a second window, the mode is disabled, the text is instantly flushed to the left and as soon as the posframe is closed the mode is enabled again and the text centered)

Do you have a better solution (and possibly one that doesn't make treemacs fail miserabily)?
[EDIT]
There's actually another question: is it possible to enable this mode if there's more than one window but they're all split vertically?


texts: resize-temp-buffer doesn't work in my code when 2 windows are diplayed into the frame

texts:
I'm searching for a way to display messages while replacements are proposed to the users of a script.
I tried to write a macro but I'm in trouble with this code:
(defmacro with-user-explanation (MESSAGE &rest body)
  "DOCSTRING."
  (declare (indent 1))
  `(let* ((temp-buffer-resize-mode temp-buffer-resize-mode)
      (frame-config (current-frame-configuration))
      (fit-frame-to-buffer t))

     (temp-buffer-resize-mode 1)
     (resize-temp-buffer-window)
        (unwind-protect
       (progn
         (with-output-to-temp-buffer "REPLACEMENT INFO"
           (princ ,MESSAGE))

         ,@body)
     ;; *CLEANUP*
      (progn
        (kill-buffer "REPLACEMENT INFO")
        (set-frame-configuration frame-config)))))

(defun my-ue-test ()
  "DOCSTRING"
  (interactive)
  (save-excursion
    (let* ((a (point-min-marker))
       (z (point-max-marker)))
      (with-user-explanation
      "This message provide info about this specific string replacement in the document."
    (query-replace "foo" "bar" nil a z)))))

I have 2 issues:

When I run the function with 2 windows opened:
 the temp buffer is not resized:
 I need it to be resized:  It is correctly resize when I run the function with only one window diplayed.

At the function exit, the layout (the color) of the pointer has changed (from white to gray). I moved this issue here: Cursor's color differs from what specified in the frame parameters

Edit. Maybe using a temp-buffer to display MESSAGE is not a good idea. Everything is messed up, also with the Arch Stanton's solution, if I use e.g. occur:
(defun my-ue-test ()
  "DOCSTRING"
  (interactive)
  (save-excursion
    (let* ((a (point-min-marker))
           (z (point-max-marker)))
      (with-user-explanation
          "This message provide info about this specific string replacement in the document."

        (occur "foo")
        (query-replace "foo" "bar" nil a z)))))

EDIT 2. This last issue is solved with set-window-dedicated-p:
 (defmacro with-user-explanation (MESSAGE &rest body)
  "DOCSTRING."
  (declare (indent 1))
  `(let* ((temp-buffer-resize-mode temp-buffer-resize-mode)
          (frame-config (current-frame-configuration))
          (fit-frame-to-buffer t)

          (temp-buffer-show-function
           (lambda (bufname)
             (display-buffer bufname '(display-buffer-at-bottom)))))

     (unwind-protect
         (progn
           (with-output-to-temp-buffer "REPLACEMENT INFO"
             (princ ,MESSAGE))
       (fit-window-to-buffer (get-buffer-window "REPLACEMENT INFO"))
       (set-window-dedicated-p (get-buffer-window "REPLACEMENT INFO") t)
           ,@body)
       ;; *CLEANUP*

       (progn
         (kill-buffer "REPLACEMENT INFO")
         (set-frame-configuration frame-config)))))


texts: Should I update or install emacs and related packages?

texts:
Emacs site says:

  The current stable release is 24.4 (released October 20, 2014; see also dates of older releases).

I have installed it on my Ubuntu 14.04, by downloading the source from the emacs site and compiling it. But I used checkinstall and dpkg instead of make install, so dpkg knows about it.

Now Ubuntu software update asks me if I want to update emacs and other emacs packages, if I am not misunderstood, (also See the following list and the screenshots below).

Common facilities for all emacsen (Changes for emacsen-common versions: Installed version: None. Avaliable version: 2.0.7)
Emacs (Changes for emacs versions: Installed version: 24.4-1; Available version: 45.0ubuntu1)
GNU Emacs common non-DFSG items, including the core documentation (Changes for emacs24-common-non-dfsg versions: Installed version: None; Available version: 24.3+1-1)
GNU Emacs editor (with GTK+ user interface) (Changes for emacs24 versions: Installed version: None; Available version: 24.3+1-2ubuntu1)
GNU Emacs editor's shared, architecture dependent files (Changes for emacs24-bin-common versions: Installed version: None; Available version: 24.3+1-2ubuntu1)
GNU Emacs editor's shared, architecture independent infrastructure (Changes for emacs24-common versions: Installed version: None; Available version: 24.3+1-2ubuntu1)

Q:

Why does Ubuntu software update suggest me another version of emacs,
if my installed one is the latest?
What is the difference between the second item (Emacs), the fourth item (GNU Emacs editor (with GTK+ user interface))  in the
update list, and my installed Emacs 24.4?
Should I update the emacs, or install the emacs packages, or
neither?

Thanks.


texts: How can I make the lisp function immediately take effect?

texts: When I add some lisp program in the init.el.  I don't want to restart emacs in order to make effect.  Then how can I do that?


texts:
I'm trying to set up a custom battery indicator in the mode line and I'd like to use the battery-status-function variable defined in battery.el, which is a part of emacs. However, I cannot use it in any elisp config. I have to search for it using the describe-variable function first before the value is available.
For right now, I've gotten around this by setting up a timer that runs 30 seconds after I load emacs (and once a minute afterwards) to use the battery-status-function variable. That gives me 30 seconds to search for it using describe-variable, then the battery indicator shows up in the mode line.
The problem exists even in quiet mode and both emacs 26 and 27. 26 is from the official Ubuntu package and 27 is built from source. I'm using Ubuntu 20.04 on an HP Pavillion laptop.
I can reproduce this by using eval-expression (M-:) and trying to just evaluate the battery-status-function variable. Before I look it up using describe-variable, it results in an error:
Debugger entered--Lisp error: (void-variable battery-status-function)
  eval(battery-status-function nil)
  eval-expression(battery-status-function nil nil 127)
  funcall-interactively(eval-expression battery-status-function nil nil 127)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)

After looking it up, it returns 'battery-linux-sysfs'
Has anyone run into a similar problem? What could be causing this? The variable is void until I look up the documentation on it. It's like quantum mechanics.
You might be thinking, 'just hard code "battery-linux-sysfs" into the elisp config,' but, of course, the same behavior exists for the battery-linux-sysfs function:
Debugger entered--Lisp error: (void-function battery-linux-sysfs)
  (battery-linux-sysfs)
  eval((battery-linux-sysfs) nil)
  eval-expression((battery-linux-sysfs) nil nil 127)
  funcall-interactively(eval-expression (battery-linux-sysfs) nil nil 127)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)

After looking up documentation on battery-linux-sysfs, evaluating it again returns the information about the battery as expected.


texts: How do I link an email from a webpage to mu4e?

texts:
So when I press a link in, for example firefox, it open Emacs mu4e "Compose email" with the receiver attached.

I’m on Linux.


texts: How to disable the logging of timestamps for repeated tasks?

texts:
For example, if I have a repeating TODO such as
* TODO item 1
SCHEDULED: [date]
- State "DONE"        from "TODO"      [timestamp]

How do I keep the third line from displaying? It clutters up the buffer after a while, and I have to keep deleting the lines. I don't need to have a log of the date and time I completed the task. I can tell from the agenda whether it's done or overdue.


texts: 'No such file or directory' when I install 'org-bullets'

texts:
I'm trying to install the org-bullets mode and after pasting the install code given in the GitHub's site in .emacs, and paste the .el file into the home directory, I get this result.:

Warning (initialization): An error occurred while loading ‘c:/Users/nazao/AppData/Roaming/.emacs’:

File is missing: Cannot open load file, No such file or directory, org-bullets

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

Is this a problem with my load-path? What can I do?

I'm using Windows 10.


texts: Can I exclude .git/COMMIT_EDITMSG from file-name-history?

texts: Is there a way to exclude .git/COMMIT_EDITMSG files from file-name-history? Now that I'm authoring commits with Magit, those commit message files are often the most recent entries in file-name-history, which is annoying since they're never what I'm looking for when scrolling through history entries.


texts: Aligning multi-lined equations and tables in latex-mode

texts:
Let's say I'm editing a latex in Auctex's latex-mode, and I have the following equation.
This is just indented with indent-region.

\begin{align}
    \phi & = a + b
    + c + d \\
    & = a + b
    + c + d + e
\end{align}

The above alignment is what I get if I select everything and hit TAB,
that is, if I'm just using indent-region.

What I would like to get is the following:
Note how the + c + d is aligned with the text after the &. This would make the most sense to be, as the + c + d are part of the same "column" as = a + b.

\begin{align}
    \phi & = a + b
           + c + d \\
         & = a + b
           + c + d + e
\end{align}

Below is what I get if I call align-current.

\begin{align}
    \phi & = a + b
    + c + d \\
         & = a + b
         + c + d + e
\end{align}

Which almost gets there, but not quite. The difference is clear.
Also, if I decide to remove the \phi, align-current does something simply bizarre:

\begin{align}
 & = a + b
    + c + d \\
 & = a + b
         + c + d + e
\end{align}

Is there a way I can customize align-current or use something else to get the desired effect?


texts:
I am using org files to organize my research projects. I am using org both on Linux and Windows. While I am exporting org files to LaTeX or Beamer, a link to a local file on Windows starts with [[C:\Users\MYSELF\Document\org...][Text]], whereas a link to a same synced local file on Linux starts with [[/home/MYSELF/local/docs/org....][Text]].

I thought that #+MACRO: docs_path system_specific_docs_heading can do the job but it expands only on specific locations and not replacing this in links. I tried and write a function hooking on rg-export-filter-latex-fragment-functions but it did not replace strings in the link definitions either.

I am wondering if there is an efficient way to make these change in the link definitions automatically when I am exporting to the LaTeX/Beamer.


texts:
When I use tuareg I like to have the toplevel in a separate frame, but as soon as I evaluate some code in the original frame the toplevel window reopen in that frame and that's not what I wan't.

More generally, I'd like to always popup new windows into frames as I'm using emacs daemon and a tiling window manager, I would like to replace all the window part of emacs by the frame.

There's a function to pop a window into a frame but I'd like to change the default behaviour.

"Pop" a window into a frame

How tuareg works :

I can open ocaml interpreter with C-c C-s, if the interpreter isn't running it runs it in a new buffer called *ocaml toplevel* in a new window splitted horizontally. If it's already opened but the window at the bottom isn't, it open the window with the already opened *ocaml toplevel* in it.
It is binded to the function :

(defun tuareg-run-ocaml ()
  "Run an OCaml toplevel process.  I/O via buffer `*ocaml-toplevel*'."
  (interactive)
  (tuareg-run-process-if-needed)
  (display-buffer tuareg-interactive-buffer-name))

I guess that it's display-buffer whih I wan't to hack...

There's also evaluate region and evaluate buffer that evaluate some code in the tuareg buffer by the opened interpreter, and if it's not opened it opens it in a new window at the bottom like previously. In fact, it is quite similar to elisp evaluation but the result is in the *\ocaml toplevel* buffer and the window is always reopened when needed to show the result.

I don't show these functions because they call other tuareg functions so there would be a lot of functions in the post and I don't want to bother you with all that code. Jus tell me if you want more.

Thanks


texts: `scad-mode` (derived from CC Mode) hangs Emacs. How to debug/fix?

texts:
I have found that scad-mode.el, a derived mode from CC Mode, which can be found here:

https://github.com/openscad/openscad/blob/master/contrib/scad-mode.el

hangs emacs if I type

#(

into the window, or indeed any line containing a # and also one of ()[]{}.  I have to kill Emacs completely and restart it after this crash.

I'm not familiar with how one write a derived mode and have not been able to figure out why this happens.  I deleted almost all of scad-mode.el and I still get the hang.  (This makes me suspect that the hang is caused by something missing rather than something in the code.) Furthermore, I can't find a coherent explanation of how one writes derived modes.  The example derived mode,

http://cc-mode.sourceforge.net/derived-mode-ex.el

doesn't look much like scad-mode.el.  I wonder if perhaps things have changed since 2002, when the example was written.  The documentation text for c-basic-common-init says I need to call c-init-language-vars first, which scad-mode does not.  But if I add a call to this

(c-init-language-vars scad-mode)

I get the message:

File mode specification error: (void-function c-init-language-vars)

Can anybody tell me what's wrong with scad-mode.el that it causes Emacs to hang?  Or how to go about debugging it?

Note: I reduced scad-mode.el to this:

(add-to-list 'auto-mode-alist '("\\.scad$" . scad-mode))
(require 'cc-mode)
(define-derived-mode scad-mode prog-mode "SCAD"
  "Major mode for editing OpenSCAD code."
  (c-initialize-cc-mode)
  (c-basic-common-init 'scad-mode "k&r")
)
(provide 'scad-mode)

and it still hangs the same way.  It's not clear to me how to truly disentangle the question of how to write a mode from the question of why this is hanging.  It has been suggested to me that it's an emacs bug.


texts: Updating pyenv when switching to a Python buffer

texts:
I use pyenv to maintain my python versions and virtualenvs. I really like the way you can create a local .python-version for each project, pointing to the version I need. I use pyenv-mode which allows me to set the right pyenv version pretty easily. The problem is that I tend to keep a single emacs server running, so when I switch between buffers in different projects I have to manually switch my pyenv, and if the python version is different I also have to restart the RPC server. I'm trying to automate this, and I found a great library to enable me to run hooks when I switch buffers (https://github.com/10sr/switch-buffer-functions-el).

Here's what I have so far, but it doesn't seem to be working at all (neither the if or then clauses execute):

(add-hook 'switch-buffer-functions
          (lambda (prev cur)
            (if (string-equal "Python" (format-mode-line mode-name nil nil (get-buffer cur)))
                (lambda ()
                  (message "Switching python buffer")
                  (pyenv-use-corresponding)
                  (elpy-rpc-restart))
              (lambda ()
                (message "Switched to non-python buffer"))
              )))

however if I do something like:

(add-hook 'switch-buffer-functions
          (lambda (prev cur)
            (message (format-mode-line mode-name nil nil (get-buffer cur)))))

it seems like it should work as expected as it does print the mode-name. I also tested the if comparison with M-: and it seems to work.... anyone see what I'm doing wrong?


texts: KBD macros defined in emacsclient disappear when client is closed

texts:
I defined a macro in an emacs client, which was attached to my emacs server.
I closed the client, and opened the client on a new file, and attempted to run the macro on the new file.

In both the new emacs client, and the server, I was told No keyboard macro defined.

a) Why might someone want this behaviour?
b) How can I work around it?


texts: `which-key` displays "lambda" when keybinding bound to lambda expression

texts:
I'm using the which key plugin in my emacs setup and I notice that when I set a key binding in a keymap with a lambda expression, like this

(define-key my-yank-keymap "l"
  (lambda ()
    "Yank whole line"
    (interactive)
    (save-excursion
      (back-to-indentation)
      (set-mark-command nil)
      (move-end-of-line nil)
      (kill-ring-save 'doesnt-matter-because 'of-next-argument t))))

(global-set-key (kbd "C-c w") my-yank-keymap)

Activating my-yank-keymap with C-c w displays my keybinding for the l key, but the label for it is simply lambda. Can which-key be configured to use the DOCSTRING of the function/lambda when there is no function name to display?


texts: Why does magit now prompt for which submodule to update?

texts:
I used to be able to press "o" then "u" (magit-submodule-update) in a magit buffer and have it update all my submodules. Now, it asks me to type in the path of which submodule I want to update. Is there a way to go back the the old behavior where all submodules were updated?

My submodules are somewhat buried in a directory structure, so having to type them in each time is annoying (not to mention, I have more than one).

I'm currently using Magit 20180220.1117, Git 2.15.1, Emacs 25.3.1, darwin


texts: Using a custom TeX .fmt file is Emacs/Auctex

texts:
I am attempting to use a plain TeX format, say, foo.fmt (which is findable with kpsewhich), with
Emacs/AUCTeX (actually Aquamacs with built-in AUCTeX). I'm unable to
get AUCTeX to recognize the custom format. In TeXShop (a Mac TeX
frontend) I would simply say at the top of the file:

% !TS-program=foo

In Emacs, I have tried various "Local Variables" such as

%%% Local Variables:
%%% TeX-engine: foo
%%% End:

followed by C-c C-n. C-c C-c returns an error indicating that the .fmt file has not been used. What am I missing?


texts:
It seems like this should be pretty straightforward since Emacs knows how to display images.

In a buffer, let's say I have a URL to an image like:

http://centre.nikkeiplace.org/wp-content/uploads/2012/07/aikido11.jpg

I'd like to put the caret on that url, call a function like expand-image-from-url and have it render the image in-line.

Is this something that's easily possible?


texts: How to use a specific latex template in org-mode

texts:
I would like to create this Latex template in org-mode :
\documentclass[french, 11pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage[hidelinks]{hyperref}
\usepackage[ddmmyyyy]{datetime}
\usepackage{microtype}
\usepackage{antiqua}
\author{My Name}
\date{\today}
\renewcommand{\contentsname}{Table des matières}

So I have added this to my .emacs in order to not have any of the default packages, just the one I want, based on what I saw on this tutorial :
(require 'ox-latex)
(with-eval-after-load 'ox-latex
(add-to-list 'org-latex-classes
           '("koma-article"
             "\documentclass[french, 11pt]{scrartcl}
             \usepackage[utf8]{inputenc}
             \usepackage[T1]{fontenc}
             \usepackage{babel}
             \usepackage[hidelinks]{hyperref}
             \usepackage[ddmmyyyy]{datetime}
             \usepackage{microtype}
             \usepackage{antiqua}
             \author{My Name}
             \date{\today}
             \renewcommand{\contentsname}{Table des matières}
             [NO-DEFAULT-PACKAGES]
             [NO-PACKAGES]"
             ("\\section{%s}" . "\\section*{%s}")
             ("\\subsection{%s}" . "\\subsection*{%s}")
             ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
             ("\\paragraph{%s}" . "\\paragraph*{%s}")
             ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))))

So that when I want to create a new document in org-mode I just have to put :
#+TITLE: My Title
#+LaTeX_CLASS: koma-article

However when I try to compile a document I get :Unknown LaTeX class 'koma-article'. I am not sure what I'm doing wrong here. Is there a way to load only these packages without having to specify then in the buffer using #+LATEX_HEADER: \usepackage ?


texts:
I am trying to have a vertical bar inside a verbatim environment as part of an org-mode table. Following https://orgmode.org/manual/Built_002din-table-editor.html#FOOT20 I have tried this:

| =find -name "*Lafontaine*" \vert xargs okular &= | finds files |

where \vert is meant to be the pipe character. Yet, not surprisingly, \vert is output verbatim, and not as "|" as intended.

How can I get this work please?

Michael


texts: File link in Org mode to a file that has spaces in it’s file name on Mac

texts:
Yes, I know this question has been asked before and solved for Windows users but the solution does not work for me under MacOS 10.13.6 and Emacs 26.1

I have a file on my desktop named "Test with Spaces.rtf". When I drag this file into a Terminal window I get the path "/Users/RonDoe1/Desktop/Test\ with\ Spaces.rtf"

Now I write in Emacs org mode "[[file:/Users/RonDoe1/Desktop/Test\ with\ Spaces.rtf][Test]]" which collapses nicely to "Test". So far so good. But:

When I click on "Test" I get the error message in the minibuffer:

"No such file: /Users/RonDoe1/Desktop/Test\ with\ Spaces.rtf"

What do I do wrong?


texts: Prevent folding org files opened by ediff

texts:
Folding gets in the way when merging two org files using ediff, so I'm trying to disable all folding in org-mode buffers created by ediff.  Non-ediff folding behavior should remain unaffected.

Naively I think that something akin to the following should work:

  (add-hook 'ediff-mode-hook
        (lambda ()
          (set (make-local-variable 'org-inhibit-startup-visibility-stuff) t)))

I'm fairly certain that this is the org variable to modify (rather than org-startup-folded or org-agenda-inhibit-startup).

I've tried various hooks to no avail (mainly ediff-mode-hook, ediff-before-setup-hook, ediff-meta-mode-hook, and ediff-prepare-buffer-hook- which is probably too late) hoping that the interned variable will be inherited.

It's quite possible that I'm using make-local-variable incorrectly; the pattern is just borrowed from what I've widely seen.

Only setting the value globally has been effective (but that's not what I'm shooting for).  Should I be (ab)using the advice mechanism?


texts: How to set TAB to CTRL inside Emacs only?

texts:
I am using spacemacs and I am wondering how I can set TAB to Control Key inside of emacs only.

I have set TAB to CTRL on my laptop in the OS, but I want to use TAB in other applications.  So, in only Emacs, I want to use TAB to be CTRL.  How I can do that?


texts:
This question was asked on stackoverflow. Just cross posting it here for better visibility. I am too facing the same issue.
I'm using EWW Emacs browser for opening various remote pages(mostly documentation) which is very handy most of the time.
I'm still trying to understand why certain pages take 4-5-6+ seconds to be rendered in eww(which take <1s in Chrome, for comparison).
For my tasks, I only care about the loaded content - images and fancy styles are not needed.
Is there any simple way to speed it up? Like setting readable mode/disabling images before calling eww? If that's possible at all.
I did some basic profiling and its seems the eww-render is lost spending time in recursive descend. Does this give any idea what could be amiss here?
- url-http-generic-filter                                        5103  39%
 - url-http-content-length-after-change-function                 4998  38%
  - url-http-activate-callback                                   4871  37%
   - apply                                                       4871  37%
    - eww-render                                                 4667  35%
     - eww-display-html                                          4659  35%
      - shr-insert-document                                      3725  28%
       - shr-descend                                             3292  25%
        - shr-tag-base                                           3292  25%
         - shr-descend                                           3292  25%
          - shr-tag-html                                         3292  25%
           - shr-descend                                         3292  25%
            - shr-tag-body                                       3292  25%
             - shr-descend                                       3292  25%
              - shr-tag-div                                      3288  25%
               - shr-descend                                     3288  25%
                - shr-tag-div                                    3288  25%
                 - shr-descend                                   3288  25%
                  - shr-tag-div                                  3212  24%
                   - shr-descend                                 3212  24%
                    - shr-descend                                3208  24%
                     - shr-descend                               3124  23%
                      - shr-tag-div                              3124  23%
                       - shr-descend                             3124  23%
                        - shr-descend                            3084  23%
                         - shr-tag-div                           3084  23%
                          - shr-descend                          3084  23%
                           - shr-tag-div                         3084  23%
                            - shr-descend                        3084  23%
                             - shr-tag-div                       3084  23%
                              - shr-descend                      3084  23%
                               - shr-tag-div                     3084  23%
                                - shr-descend                    3084  23%
                                 - shr-tag-div                   3023  23%
                                  - shr-descend                  3023  23%
                                   - shr-tag-div                 1604  12%
                                    - shr-descend                1604  12%
                                     - shr-descend               1428  10%
                                      + shr-tag-table               1377  10%
                                      + eww-tag-a                  47   0%
                                        shr-tag-div                  4   0%
                                     + shr-tag-div                176   1%
                                   + shr-descend                 1407  10%
                                   + eww-tag-a                      8   0%


texts: How to parse calendar date or timestamp at cursor from elisp?

texts:
Is there a function to parse the text around the cursor and return the date if found?

E.g., if I'm in a buffer with the cursor in the middle of this text:

2015-12-01 First day of new exercise program
2016-01-08 Hit a milestone: ran a 7-minute-mile

and I want to use emacs to parse the dates and tell me the elapsed time between them, is there a function to help me do that?
Ideally it would handle full ISO timestamps also, e.g.

2016-01-08T08:13:55-0700

and of course other date formats.  Yeah - I know - it gets tricky, might need some hinting on formats, etc....

It looks like date-to-time can parse ISO strings, and parse-time-string can parse some formats, but not ISO.  But are there any functions to pick the right text from around the cursor?

See e.g. Emacs Lisp: Parsing Date Time


texts:
I am running GNU Emacs on Ubuntu, using a Swedish PC-keyboard. When I use swedish-keyboard as my input method, shift-key combinations work fine (e.g. S-7 gives the '/' character). But I have found a few things that doesn't work properly:

Alt Gr-combinations: Alt Gr is interpreted as Meta-key, so when I press e.g. (Alt Gr + 7) I get M-7 instead of '{'. So I can't type '@','£','$','{','[',']','}','\' or '|' using swedish-keyboard. Is there a way to separate Alt and Alt Gr-key such that Alt is Meta-key and Alt Gr can be used for extended character input?
Misplaced characters: Pressing e.g. '<' on the keyboard produces a ';' character (shift+'<' gives ':'). Similarly, '§' gives '~', shift+'§' gives '^', '´' gives '§', shift+'´' gives '½', '¨' gives 'é', shift+'¨' gives 'É'. So there is no way to type '<','>','´','`' or accented characters other than 'é' and 'É'.

Is there a way to solve these issues? The way I solve it now is simply to toggle between swedish and american input whenever I need to type any of the unaccessible characters in the swedish input mode.

P.S. I am a bit of a noob on Emacs, so carefully explained solutions are appreciated.


texts: Retrieve the lunar phases to diary.org as a record

texts:
I tried to record  the sunrise and sunset info to the diary

#+begin_src emacs-lisp :tangle yes
(sunrise-sunset)
;;(lunar-phases)
#+end_src

#+RESULTS:
: Sunrise 6:57am (CST), sunset 5:00pm (CST) at 40.0N, 116.3E (10:03 hrs daylight)

sunrise-sunset worked as expected,

But to lunar-phases

#+begin_src emacs-lisp :tangle yes
;;(sunrise-sunset)
(lunar-phases)
#+end_src

#+RESULTS:
: Computing phases of the moon...done

How could get the lunar phases as it print to the echo area?


texts: Make all done org-mode items invisible (collapsed)

texts:
How can I make all done (e.g. DONE) org-mode items "invisible"?  I'm using org-mode's "visibility" terminology here, but what I'm referring to is collapsing (folding) those items closed, not making them literally invisible.  I don't want to use org's sparse trees for this.

I have multiple custom done states (including SKIP, for example).  I want items to be collapsed if they are in any of those states.


texts: How to return focus to dired window after killing buffer opened from dired?

texts: Sometimes I use dired to view or edit several files in one folder, one after the other. Dired is open in one window, and I open the files in another window by typing o in dired. When I finish with one file and kill the associated buffer, I would like focus to switch back to the dired window, instead of remaining in the window that used to hold the buffer I just killed.


texts:
I have the following question regarding org-mode tables:
I have the following simplified org-mode table with:
A,B as arguments or parameters
and C1, C2 results or return values.

#TBLNAME: function
| A          |  3 |
| B          |  4 |
| C1(A+B)    |  7 |
| C2(A*B)    | 12 |
#+TBLFM: @3$2=@1+@2::@4$2=@1*@2

I want to call function table with:
Given variables at column A,B
Get results at columns C1,C2 using function table.

#+TBLNAME: results-table
| A | B | C1  | C2  |
|---+---+-----+-----|
| 1 | 2 | ... | ... |
| 2 | 3 | ... | ... |
| 3 | 4 | ... | ... |

Is this possible?


texts: Recursive load error in csharp mode on upgrading to 24.4

texts:
I'm on OSX 10.9.4 and I was previously running emacs 24.3 installed via brew.

This morning I got around to asking brew to upgrade me to 24.4. Everything seemed to go smoothly, except csharp-mode no longer functions correctly. On opening a .cs file I get this error:

File mode specification error: (error "Recursive load"
    "/Users/Andrew/.emacs.d/elpa/csharp-mode-20120204.1826/csharp-mode.elc"
    "/Users/Andrew/.emacs.d/elpa/csharp-mode-20120204.1826/csharp-mode.elc"
    "/Users/Andrew/.emacs.d/elpa/csharp-mode-20120204.1826/csharp-mode.elc"
    "/Users/Andrew/.emacs.d/elpa/csharp-mode-20120204.1826/csharp-mode.elc"
    "/Users/Andrew/.emacs.d/elpa/csharp-mode-20120204.1826/csharp-mode.elc")

I still have 24.3 on my machine and I can open .cs files correctly in that.

Unfortunately csharp mode seems to be dead - it's not been touched in a few years. Any help or pointers as to how I can hack this to work would be appreciated.


texts:
Is there any easy way, including installing a package, to list all waiting checkboxes in all the files in the directory?

So far I do the following for the checkboxes in a file:

M-x occur - \[ \]

This is for the checkboxes in the whole directory and all files:

M-x rgrep \- \[ \]

rgrep works, but it includes a whole bunch of arguments and it's slow.

Is there any nonobvious and easy solution?


texts: How do I change the color of the prompt in the mini-buffer?

texts: I am using the zenburn theme and my mini-buffer prompt is unreadable (image attached). Please help me. I am just learning emacs.


texts: Trying to run a lisp-dialect through inferior-lisp, but can't evaluate code

texts:
I'd like to run txr lisp as an inferior-lisp process in Emacs.

From bash in xterm I can start a repl with txr -i.

I know I first need to change the inferior-lisp-program variable:

(setq inferior-lisp-program "txr -i")

Now I try to run it:

  M-x run-lisp

After I type the expression I want to evaluate I press the enter key and I see escape codes rather than the evaluation.

I also observe this behavior on a fresh instance of emacs started with emacs -Q.

From the txr man page:

  The interactive listener is based on 8 bit  character  processing.
  Its
         editing functions do not recognize UTF-8 multi-byte characters.

I've tried changing the buffer coding system with set-buffer-process-coding-system to raw-text and us-ascii with no luck.

How might I debug/fix this?


texts: Command to navigate up one directory in speedbar?

texts: How does one navigate up one directory whilst in speedbar without using the mouse?


texts: Custom title format in iTerm2 / Terminal

texts:
I've been looking all over but none of the guides I saw worked for me.

I am trying to have the title of Spacemacs to show a custom format, namely the current project's name (the current folder's name).

I am using Iterm2, so I want the tabs to represent the directories.

Currently, the title says emacs (emacs-25.2) which isn't very useful.


texts: How do I make the timespan shown by org agenda start yesterday?

texts:
If today is Thursday, I want the agenda to be from Wednesday (yesterday) through next Tuesday.

When I set org-agenda-day to "-1d", it shows the full week (starting Monday) that contains yesterday. I want it to start yesterday, even if yesterday isn't Monday.


texts: How to start Emacs without the cmd.exe window (on MS Windows)?

texts: It says emacs/bin/emacs.exe. If it's not necesarily useful, I'd like to stop it from starting with emacs. The extra window is messing me up a bit.


texts: How to use align-regex to align text as column or matrix?

texts:
I am trying to align code using align-regex but I could not figure out how to solve the below problem.

This is what I have:

public class Person
{
    public static String id = "";
    private String name = "";
    public int age = 10;

}

This is what I am trying to get:

public class Person
{
    public  static String id =       "";
    private String name   =  "name";
    public  int    age    =  10;

}

Actually I just want to separate them into each column.

I have tried M-x align-regex RET \(s-*\)\s- and many more but none is working. Please help me solve this or advice me.


texts: How to disable eager load-time macro expansion in emacs 24.3?

texts:
Is it possible to disable eager load-time macro expansion in emacs 24.3.1? For debugging purposes, I would like to expand macros lazily on each invocation at run-time.

A working non-standard method to obtain lazy macro evaluation is to include a variable dummyVar (undefined at load-time, defined later at run-time), then an error message like "Eager macro-expansion failure: (void-variable dummyVar)" occurs at load-time and the macro is expanded at run-time. I did not find a lisp command to get this behaviour.


texts: How to highlight matching brackets when the cursor is behind or in front of starting or ending brackets?

texts:
I am using Emacs: Highlight Brackets ()[]{}.
I want to highlight matching brackets when the cursor is behind and front of starting and ending brackets. How can I accomplish this?
foo ( "hello" )
   ^ ^       ^ ^
   1 2       3 4 // cursor points

I have followed @Gilles 'SO- stop being evil's answer for Changing show-paren-mode Areas:
(defadvice show-paren-function
 (around show-paren-closing-before
         activate compile)
 (if (eq (syntax-class (syntax-after (point))) 5)
     (save-excursion
       (forward-char)
       ad-do-it)
   ad-do-it))

which helped me to highlight brackets cursor points 1, 3, 4, but it does not highlight when on 2nd cursor point.
My setup is:
(show-paren-mode 1)
(setq show-paren-delay 0)
(setq show-paren-style 'parenthesis)

(defadvice show-paren-function
  (around show-paren-closing-before
          activate compile)
  (if (eq (syntax-class (syntax-after (point))) 5)
      (save-excursion
        (forward-char)
        ad-do-it)
    ad-do-it))

(require 'paren)
(setq show-paren-style 'parenthesis)


texts: Regular expression gives different results as variable and as literal

texts:
In the Emacs *scratch* buffer, I get different results when I use the same regular expression as a variable compared to a literal:

(setq splitter-string "9:20")
"9:20"

(string-match "[0-9]?[0-9]:[0-9][0-9]" splitter-string)
0

(defvar org-clock-split-absolute-time-regexp "[0-9]?[0-9]:[0-9][0-9]"
  "Regular expression to match an absolute time to split at.")
org-clock-split-absolute-time-regexp

(string-match org-clock-split-absolute-time-regexp splitter-string)
nil

What is the difference between a variable and a literal for regular expressions?

Update: The problem stems from the inability to overwrite a variable defined with defvar, as below in the scratch buffer:

(defvar pattern "some pattern"
  "Some regular expression")
pattern

pattern
"some pattern"

(defvar pattern "[a-z]*"
  "Some regular expression")
pattern

pattern
"some pattern"

(string-match "[a-z]*" "abcdefg")
0

(string-match pattern "abcdefg")
nil

I would not do this in final code, but may do it in the scratch buffer during development. The problem is about defvar, and a duplicate of this question, and not about regular expressions (I knew about the different syntaxes with re-builder and suspected it was about that).


texts: Running all tests in a leiningen project?

texts:
Is there a way, via cider or some other emacs extension, to run all of the tests in a leiningen project?

cider has the function cider-test-run-tests which attempts to just run the tests
related to the code in the current buffer. That's fine, but often I want to run all of the tests in a project. (In fact, I'd like to run this all the time while editing.) I can't seem to find a simple way to say "find all of the tests in this project and run them."

Does anyone know how to do this?


texts: Error installing "Package 'emacs-24.3' is unavailable"

texts:
I'm running emacs 24.4.1.  Like the title says.  When I run
M-x package-install RET flycheck  I get the message

Package 'emacs-24.3' is unavailable

Any ideas?


texts: How to set the engineering notation as default in calc?

texts:
In calc, I can switch to the engineering notation by pressing d e. But how do I make that a default?

I can store the calc defaults in the file specified in the calc-settings-file variable but I can't find the elisp required to change the default notation to engineering.


texts: Adding #+LATEX: \newpage before a heading

texts:
In latex export of orgmode, I would like to be able to add #+LATEX: \newpage before a heading with newpage tag, so I don't have to manually specify #+LATEX: \newpage when I want a heading to be on a new page.

It seems I can add a hook to org-export-before-parsing-hook, but I have not been able to do it. The following code successfully adds #+LATEX: \newpage before a heading with newpage tag, but when I try to add \n ((insert-string "#+LATEX: \\newpage\n")), exporting gets stuck with the message org-babel-exp process txt at position 280541.... I suspect inserting \n messes up the position.

(defun org/parse-headings (backend)
  (if (member backend '(latex))
      (org-map-entries
       (lambda ()
         (progn
           (insert-string "#+LATEX: \\newpage")
           ))
       "+newpage")
    )
)

(add-hook 'org-export-before-parsing-hook 'org/parse-headings)


texts: How to use Magit to git log / git grep to find expressions across all previous commits

texts: I am using Magit and was wondering how to revert to a specific commit that contained a specific expression. First I need to find the expression across all commits content. How to do this? In command line it would be something like git grep / git log. Thanks!


texts: Vim Triple Braces Code Folding in Emacs?

texts:
I am migrating from Vim to Emacs because I can't get Org mode to work in Vim. In Emacs is there a way to replicate Vim's marker folding so that

# Foo {{{
foo
# }}}

Turns into

+--  1 lines: # Foo ----

via foldmethod=marker and foldlevel=0. I have tried using vimish-fold and origami with no success. I am running Emacs GTK2 on FreeBSD 11.1 with the Evil mode plugin.


texts: (key-binding (this-command-keys)) not translating keybindings

texts:
I have put the following code (partially adapted from a company-mode issue and a Stack Exchange question) in my init.el in order to adjust the keybindings active in the company-mode completions menu:

(defun company-complete-if-explicit ()
  "Complete the current selection, but only if the user has interacted
explicitly with Company."
  (interactive)
  (if (company-explicit-action-p)
      (company-complete)
    (call-interactively
     (key-binding (this-command-keys)))))

(define-key company-active-map (kbd "<return>") #'company-complete-if-explicit)
(define-key company-active-map (kbd "RET") #'company-complete-if-explicit)
(define-key company-active-map (kbd "TAB") #'company-complete-selection)
(define-key company-active-map (kbd "SPC") nil)

(setq company-auto-complete-chars nil)

In terminal Emacs, pressing RET will dismiss the completions menu and insert a newline. However, if I have explicitly interacted with the menu (for instance, using up and down), then RET will instead insert the selected completion.

The problem is that this doesn't work in windowed Emacs: if I press <return> while the completions menu is showing (but I haven't explicitly interacted with it), then instead of Emacs inserting a newline, I receive the following error:

Debugger entered--Lisp error: (wrong-type-argument commandp nil)
  call-interactively(nil)
  (if (company-explicit-action-p) (company-complete) (call-interactively (key-binding (this-command-keys))))
  company-complete-if-explicit()
  call-interactively(company-complete-if-explicit nil nil)
  command-execute(company-complete-if-explicit)

I debugged this, and here is what I think is happening:

In windowed Emacs, the Return key sends <return> instead of RET.
Only RET has a binding (to newline), but normally <return> is translated automatically to RET, so the Return key still inserts a newline in windowed Emacs.
When I call this-command-keys in company-complete-if-explicit, the returned value is <return>.
The key-binding function does not appear to do the key translation that usually occurs, so that (key-binding (kbd "RET")) is newline but (key-binding (kbd "<return>")) is nil.
The error is thrown because nil is then passed to call-interactively.

My question is therefore: what is the best way to fix this problem (either by making key-binding perform automatic translations, or otherwise)?


texts: How can I visualize VCS status in dired?

texts:
I'm particularly concerned with git, but I imagine this is a good place to use vc.  I want to emulate Atom's git integration with its file explorer:

How can I get something like this in dired?  I understand there are other tools for simulating a proper tree structure, but the normal i/RET workflow should work just fine.


texts:
is there a way to set the font attributes on per file basis? I'm surprised this is not a main feature... I don't want my todo lists to look the same as my articles or journal.

IF there is such a thing is there also something like importing? e.g. import 'article_style'?

I tried the following without success

;; Local Variables:
;; eval: '(org-level-1 ((t (:weight thin :height 1.6 :family "Helvetica Neue"))))
;; End:


texts: Any way to invoke vim from within an org file and on closing vim, the result is copied back at parent org file cursor?

texts:
This is a specific use case and I understand that not a lot of folks will have use (or prefer) this. But I'd still like to understand whether this is possible.
While editing an org file, I want to open a temp file in my vim (with my plugins as I would from a terminal) and by the end of the edit, on close, I want to get the contents of the file into the org file at the cursor. Deleting the temp file would be a plus but not really needed. Maybe I can reuse the same file again.
This is what I have tried:
(defun vim-insert-here ()
  (interactive)
(shell-command
 (format "gvim temp"))
(insert-file-contents "temp"))

This works well enough for simply copying the contents. But I need help adding functionality such as:

Not inserting the vim file text when vim is exited with q!
Selecting an existing piece of text in the org file and opening that in vim, and the resulting changes are overwritten in the org file


texts: Modifying internal-border-width messes up UI

texts:
When I am modifying the internal-border-width of the selected frame the "resizing" happens but for example the minibuffer and the modeline are not visible anymore. They are there but offscreen:

As you can see the borders are unbalanced and the buffer is "pushed" from the top left.

This is likely to be window manager related (bspwm in my case). Because when I for example full screen emacs after setting the internal border width everything looks as expected. Same when I open another application or anything like that which "repositions" and that causes a "redraw":

Can this be solved from within my .emacs.d or do I need to look in my window manager or somewhere else?