texts: Speedbar tag hierarchy in Clojure - organize manually with comments?

texts:
If I run speedbar and call (speedbar-add-supported-extension ".clj") in init.el, then I see my Clojure files in the speedbar, and I can expand them to show the function definitions inside, like this:

What I don't like is that Emacs is grouping and sorting the tags by alphabetical order. I would prefer to control the sorting and grouping in the file myself, by functional area. I'd like to give the groups titles (maybe with a comment). For example, something like this works in Xcode:

Leads to hierachy view:

Is there a way to do this with Emacs and Speedbar?


texts: How to prevent agenda view from showing items' creation timestamp?

texts:
My agenda view shows duplicated items when they are created and scheduled in the same day, which litters this view:

So for instance The item that was created today at 11:33 will show once with its creation timestamp, and then again without timestamp. I'd like to remove the former from the view and keep the latter.

EDIT

Thank y'all for your help.

As @erikstokes poined out, my question was a duplicated of this one. So the only solution I could think of is to make the timestamp inactive when capturing (creating) a note.

To this end I changed %T by %U in my capture template:

(setq org-capture-templates
      '(("t" "New Task" entry (file+headline agenda-path "Inbox")
         "* TODO %?\n  %U\n  %i\n")
        )
      )

I also customized org-agenda-time-grid as suggested in the answer by @NickD, which causes timestamps to be displayed in a more compact manner, in case they are shown.

(setq org-agenda-time-grid
      '((require-timed)
        "----------------"
        (800 1000 1200 1400 1600 1800 2000)))


texts: Strip arbitrary characters from a string?

texts:
Q: How can I strip non-word characters from a string?

For an arbitrary string, how do I strip all characters with non-word syntax?  Alternately, using a regexp, how do I strip out the non-alphabetic characters?

Hypothetical example:

(some-fnx "#here's a string!") ; => "heres a string"

Specific application:

I want to get a list of the LaTeX font commands without the markup syntax.  The value of LaTeX-font-list is:

((1 "" "" "\\mathcal{" "}")
 (2 "\\textbf{" "}" "\\mathbf{" "}")
 (3 "\\textsc{" "}")
 (5 "\\emph{" "}")
 (6 "\\textsf{" "}" "\\mathsf{" "}")
 (9 "\\textit{" "}" "\\mathit{" "}")
 (13 "\\textmd{" "}")
 (14 "\\textnormal{" "}" "\\mathnormal{" "}")
 (18 "\\textrm{" "}" "\\mathrm{" "}")
 (19 "\\textsl{" "}" "\\mathbb{" "}")
 (20 "\\texttt{" "}" "\\mathtt{" "}")
 (21 "\\textup{" "}")
 (4 "" "" t))

I want to iterate through the nested lists in order to get returned values like "textbf", "textrm", etc., without the rest of the markup.


texts: How to make gdb mode send proper filename to gdbserver? Running gdb from pure terminal works

texts:
I am trying to debug an application on a remote environment. Ofcourse running Tramp over gdb works as in https://www.gnu.org/software/emacs/manual/html_node/tramp/Remote-processes.html, but you miss out on source code linking. The frame/stacktrace buffer for example... now you can't click on a frame and go to source code on host machine.

[Host] (Source code) -> compiled binary -> scp binary to remote -> Debug On Remote.

So I tried making gdbserver work. Firstly I made both versions of gdb/gdbserver on both host and remote machine same. 8.3 latest. Now running from terminal:

In Terminal Remote:

$ cd /path/to/folder/
$ gdbserver --multi :44421

gdbserver starts listening. Also tried entire exercise with gdbserver --no-shell-on-startup --multi :44421 but it results in same thing.

In Host machine TERMINAL:

$ gdb /file/to/executable
gdb> target extended-remote <remote>:44421
gdb> set remote exec-file ./executable
gdb> set args -c config.xml
gdb> r

^This works as expected. Or atleast it starts and i am able to get debug output.

BUT In emacs GBD mode it doesn't work:
In HOST machine. EMACS:

M-x gdb RET gdb -i=mi /file/to/executable
gdb> target extended-remote <remote>:44421
gdb> set remote exec-file ./executable
gdb> set args -c config.xml
gdb> r

^This doesn't work. I get output:
In Remote Machine:

$ gdbserver...
...
/bin/sh: /path/to/executable/folder/executable: No such file or directory
...

How do I solve this?

Emacs: 26.3
GDB: 8.3
Both machines are centos 7.
Using spacemacs develop branch as emacs frontend.

Since I do frequently copy executable from host to remote, I do want gdbserver to simply run forever, hence the --multi <port> use case. And I can do k from gdb when i need to copy the binary over.


texts:
I have used xemacs for years and have a lot of lisp code I have written.
Now I want to switch to emacs and convert all the lisp code over to work in emacs.  This is on an winXP machine.

I'm sure I am not the first one to convert code back and forth.  Does anyone know what differences to expect? Are there any documents out there explaining the differences I need to watch for in converting lisp code?


texts: How can I use Emacs and iTerm for the same keybinding?

texts:
In my .emacs file I have also set ctrl-o to delete a word:

(defun backward-delete-word (arg)
  "Delete characters backward until encountering the beginning of a word.
With argument ARG, do this that many times."
  (interactive "p")
  (delete-region (point) (progn (backward-word arg) (point))))

(global-set-key "\C-o" 'backward-delete-word)

Please note that this works. I want to have same setup on my Terminal shell. By default \C-w does it (link).

So I created following key binding (\C-o) in iTerm2 in order to delete a word by folliwing this solution, which works on Terminal shell.

  Delete a word - Send escape sequence - 0x1b 0x08 or 0x17

But when I enable it, my keybinding for \C-o in emacs start to not work. iTerm's keybinding supress emacs's, even though they do the same job.

[Q] How can I use link emacs and iTerm for the same keybinding? I think I have to do a incode-decode-map
(https://stackoverflow.com/q/36613839/2402577) but I wasn't able to do it.


texts: Custom comment with comment-line and comment-dwim

texts:
Basically, what I want to do is to customize comment-start and comment-end when invoking different commands to then call comment-dwim or  comment-line with them.
What I managed to do so far is the following (thanks to http://ergoemacs.org/emacs/elisp_comment_command.html):
(defun rust-doc-comment-dwim (c)
  "Comment or uncomment the current line or text selection."
  (interactive)

  ;; If there's no text selection, comment or uncomment the line
  ;; depending whether the WHOLE line is a comment. If there is a text
  ;; selection, using the first line to determine whether to
  ;; comment/uncomment.
  (let (p1 p2)
    (if (use-region-p)
        (save-excursion
          (setq p1 (region-beginning) p2 (region-end))
          (goto-char p1)
          (if (wholeLineIsCmt-p c)
              (my-uncomment-region p1 p2 c)
            (my-comment-region p1 p2 c)
            ))
      (progn
        (if (wholeLineIsCmt-p c)
            (my-uncomment-current-line c)
          (my-comment-current-line c)
          )) )))

(defun wholeLineIsCmt-p (c)
  (save-excursion
    (beginning-of-line 1)
    (looking-at (concat "[ \t]*//" c))
    ))

(defun my-comment-current-line (c)
  (interactive)
  (beginning-of-line 1)
  (insert (concat "//" c))
  )

(defun my-uncomment-current-line (c)
  "Remove “//c” (if any) in the beginning of current line."
  (interactive)
  (when (wholeLineIsCmt-p c)
    (beginning-of-line 1)
    (search-forward (concat "//" c))
    (delete-backward-char 4)
    ))

(defun my-comment-region (p1 p2 c)
  "Add “//c” to the beginning of each line of selected text."
  (interactive "r")
  (let ((deactivate-mark nil))
    (save-excursion
      (goto-char p2)
      (while (>= (point) p1)
        (my-comment-current-line c)
        (previous-line)
        ))))

(defun my-uncomment-region (p1 p2 c)
  "Remove “//c” (if any) in the beginning of each line of selected text."
  (interactive "r")
  (let ((deactivate-mark nil))
    (save-excursion
      (goto-char p2)
      (while (>= (point) p1)
        (my-uncomment-current-line c)
        (previous-line) )) ))

(use-package rust-mode
  :mode "\\.rs'"
  :bind ("C-M-;" . rust-doc-comment-dwim-following)
  :bind ("C-M-," . rust-doc-comment-dwim-enclosing)
  :config
  (defun rust-doc-comment-dwim-following ()
    (interactive)
    (rust-doc-comment-dwim "/ "))
  (defun rust-doc-comment-dwim-enclosing ()
    (interactive)
    (rust-doc-comment-dwim "! "))
  )

Which allows to comment as /// when pressing Ctrl-Alt-; and //! when pressing Ctrl-Alt-, (and uncomment lines starting with /// or //! depending on the keys pressed)
But I would actually prefer to have something more like
(defun comment-dwim-line (&optional arg)
        "Replacement for the comment-dwim command.
        If no region is selected and current line is not blank and we are not at the end of the line,
        then comment current line.
        Replaces default behaviour of comment-dwim, when it inserts comment at the end of the line.
        Taken from https://www.emacswiki.org/emacs/CommentingCode"
          (interactive "*P")
          (comment-normalize-vars)
          (if (and (not (region-active-p)) (not (looking-at "[ \t]*$")))
              (comment-or-uncomment-region (line-beginning-position) (line-end-position))
            (comment-dwim arg)))

(defun rust-doc-comment-dwim-following (&optional arg)
    (interactive)
    (setq comment-start "/// ")
    (comment-dwim-line arg)
    (setq comment-start "// ")
    )

And it kind of works but only for commenting. If I'm on an already commented line it will not uncomment it which is kind of strange. I don't know what I'm missing here because it's supposed to call my function with comment-start temporarily equal to /// .


texts: Org mode python session does not return a file name

texts:
In the following link you can find the following simple example:

#+begin_src python :session :results file
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
fig=plt.figure(figsize=(3,2))
plt.plot([1,3,2])
fig.tight_layout()
plt.savefig('myfig.pdf')
'myfig.pdf' # return this to org-mode
#+end_src

I have the problem that the string that contains the file name is not returned. Thus, I don't get something like:

#+RESULTS:
[[file:images/myfig.pdf]]

Here is what I can see in the session's buffer:

Process Python finished

Python 3.4.3 (default, Feb 27 2015, 00:22:26)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> >>> >>> r/folders/kz/1c2cxn1x60n_t5p2j1p02b180000gn/T/py6499_X0''', 'exec'));
import matplotlib
>>> import matplotlib
matplotlib.use('Agg')
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt
fig=plt.figure(figsize=(3,2))
fig=plt.figure(figsize=(3,2))
plt.plot([1,3,2])
plt.plot([1,3,2])
fig.tight_layout()
fig.tight_layout()
plt.savefig('myfig.pdf')
plt.savefig('myfig.pdf')
'myfig.pdf' # return this to org-mode
'myfig.pdf' # return this to org-mode

open('/var/folders/kz/1c2cxn1x60n_t5p2j1p02b180000gn/T/babel-64998Up/python-6499xhD', 'w').write(str(_))
open('/var/folders/kz/1c2cxn1x60n_t5p2j1p02b180000gn/T/babel-64998Up/python-6499xhD', 'w').write(str(_))

'org_babel_python_eoe'
'org_babel_python_eoe'
>>> [<matplotlib.lines.Line2D object at 0x10bc987f0>]
>>> >>> 'myfig.pdf'
>>> >>> 9
>>> >>> >>> 'org_babel_python_eoe'
>>>

However, the following works as expected:

#+begin_src python :session :results file
'./myfig.pdf' # return this to org-mode
#+end_src

#+RESULTS:
[[file:./myfig.pdf]]

What is the problem here? How can I debug it? It seems like matplotlib causes some problem.

Edit:

Same org file behaves as expected on a Linux box. The problem described above happens on Mac. So, probably it has something to do with the installed python versions. Still, I don't know how to debug it...

Edit 2 (Debugging steps):

Ok, I'm trying to break the steps. Consider the complete example:

#+BEGIN_SRC python :session :results file
import matplotlib             #1
matplotlib.use('Agg')         #2
import matplotlib.pyplot      #3
fig=plt.figure(figsize=(3,2)) #4
plt.plot([1,3,2])             #5
fig.tight_layout()            #6
plt.savefig('myfig.png')      #7
'myfig.png'                   #8 return this to org-mode
#+END_SRC

If I comment lines 1-7, then the results block is correct:

#+RESULTS:
[[file:myfig.png]]

Now, I start to add the lines in their order. Each time I exit the interpreter, so it will be a "fresh" run.

With lines 1,8: The result is correct (as can be found above)
With lines 1-2,8: Still correct
With lines 1-3,8: Result is incorrect!

#+RESULTS:
[[file:]]

Therefore, if I understand correctly, this is not a problem of the interpreter, but something else. The version of python I use is (as indicated by import sys; sys.version invoked from the interactive interpreter that was started by babel):

'3.4.3 (default, Feb 27 2015, 00:22:26) \n[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)]'

Furthermore, matplotlib.__version__ yields: `1.4.3'

M-x version returns: GNU Emacs 24.4.51.1 (x86_64-apple-darwin14.1.0, NS apple-appkit-1344.72) of 2015-02-02 on Boxname and it runs in OS X 10.10.

Maybe this additional information can help someone solve this issue?


texts: How to fill in a formula into adjacent cells in org-mode spreadsheet?


texts: How to specify buffer local variables for the edit buffer of org source blocks?

texts:
Consider the following org-file.

#+NAME: example-src-block
#+BEGIN_SRC emacs-lisp
(defun my-message ()
  "Issue my message."
  (message "Within the emacs-lisp source block."))
#+END_SRC

How can the buffer local setting

(setq-local flycheck-disabled-checkers '(emacs-lisp-checkdoc))

be specified for the edit buffer of source block example-src-block.

Note: For opening the edit buffer place point on BEGIN_SRC and press C-c '.

The user J. Ricardo tried in a deleted question the following approach:

#+NAME: example-src-block
#+BEGIN_SRC emacs-lisp
(and (boundp 'flycheck-disabled-checkers)
     flycheck-disabled-checkers)
#+END_SRC

#+RESULTS: example-src-block
| emacs-lisp-checkdoc |

# Local Variables:
# eval: (setq-local org-babel-default-header-args:elisp '((:var . "flycheck-disabled-checkers='(emacs-lisp-checkdoc)")))
# End:

That does not set flycheck-disabled-checkers in source edit buffers for the source block.
It only sets flycheck-disabled-checkers for the evaluation of the source block. as the printed result of the source block in the above example suggests.


texts: How to specify a pdf viewer for ess mode

texts:
I have set the variable ess-pdf-viewer-pref to "evince"

But when I export any Rnw file using M-n e, instead of displaying the pdf in evince it is displayed inside Emacs.

How can I stop Emacs displaying the exported pdf in a split buffer? and make it display the pdf in evince?

I am using Emacs plus ESS, polymode, and poly-R as prescribed in this answer


texts: Output of emacsclient not visible in terminal, in contrast to Vim

texts:
Version: GNU Emacs 25.1.50.2 (GTK+ Version 3.18.9).
Gnome terminal.

When I type in terminal emulator: vim foo/bar.el.

Then I close the Vim session with :wq, I see the content of my Vim screen in the terminal.

When I type in terminal emulator: emacsclient -nw foo/bar.el. And save it and close Emacsclient, I do not see the content of my previous Emacsclient session in the terminal. An example what I mean:

As illustrated in this screenshot above, the output from my Vim session is visible in terminal. With the Emacsclient, it's not the case after closing Emacsclient. Makes me to wonder why? It's basically the same output in Terminal with both editors.


texts: How can I fontify a symbol by regexp match group (as in a naming convention)?

texts:
I want to add better support for expl3 to AUCTeX.  I have regular expressions that properly group according to the naming conventions for:

functions (\\(?:__)?[a-z]+_)([a-z_]+)(:[nNpTFwcVvxof]*),
variables (\\[cgl]__?)([a-z][a-z_]+)(_[A-Za-z]+), and
key-value segments \s*([a-z\-]+)\s+(\.[a-z_]+):([nNpTFwcVvxof]*)\s+=

How can I apply faces to both

the match as a whole and
the individual groups (overriding the whole match where appropriate)?

Just a proof-of-concept using the function-regexp would be very helpful :)

rx Forms

(setq LaTeX-expl3-function-regexp
      (rx symbol-start
          (group "\\" (optional "__") (+ alpha) "_")
          (group (+ (any alpha "_")))
          (group ":" (* (any "nNpTFwcVvxofD")))
          symbol-end)

      LaTeX-expl3-variable-regexp
      (rx symbol-start
          (group "\\" (any "cgl") "_" (optional "_"))
          (group (or (seq (any alpha) "_") "@@_"))
          (group (any alpha) (+ (any alpha "_")))
          (group "_" (+ alpha))
          symbol-end)

      LaTeX-expl3-keyval-regexp
      (rx (* whitespace)
          (group (any alpha "-"))
          (+ whitespace)
          (group "." (+ (any alpha)))
          (group ":" (* (any "nNpTFwcVvxofD")))
          (+ whitespace) "="))


texts: Pasting rectangle indents text to the right

texts:
Copying and pasting a rectangle from the following table with C-x SPC C-x r M-w C-x r y shifts the beginning of the line to the right as shown below:

|----+----------+------+------+--------|
|    | 今本     | 偽古 | 今文  | 西周書  |
|----+----------+------+------+--------|
|  1 | 堯典     | NA   |    1 | NA     |
|  2 | 舜典     | NA   |    2 | NA     |
|  3 | 大禹謨   | 1    |   NA | NA     |
|  4 | 皋陶謨   | NA   |    3 | NA     |
|  5 | 益稷     | NA   |    4 | NA     |

Why does this happen and how do we paste rectangles so that they behave like normal text?

Result of C-u C-x =

First character:

             position: 1 of 431 (0%), column: 0
            character: 堯 (displayed as 堯) (codepoint 22575, #o54057, #x582f)
              charset: unicode (Unicode (ISO10646))
code point in charset: 0x582F
               script: han
               syntax: w    which means: word
             category: .:Base, C:2-byte han, L:Left-to-right (strong), c:Chinese, h:Korean, j:Japanese, |:line breakable
             to input: type "C-x 8 RET 582f"
          buffer code: #xE5 #xA0 #xAF
            file code: #xE5 #xA0 #xAF (encoded by coding system utf-8)
              display: by this font (glyph code)
    mac-ct:-*-STFangsong-normal-normal-normal-*-28-*-*-*-p-0-iso10646-1 (#x9C4)

Character code properties: customize what to show
  name: CJK IDEOGRAPH-582F
  general-category: Lo (Letter, Other)
  decomposition: (22575) ('堯')

There are text properties here:
  fontified            t
  line-prefix          [Show]
  wrap-prefix          [Show]

Last Character (not shown here)

             position: 426 of 431 (99%), column: 2
            character: 誓 (displayed as 誓) (codepoint 35475, #o105223, #x8a93)
              charset: unicode (Unicode (ISO10646))
code point in charset: 0x8A93
               script: han
               syntax: w    which means: word
             category: .:Base, C:2-byte han, L:Left-to-right (strong), c:Chinese, h:Korean, j:Japanese, |:line breakable
             to input: type "C-x 8 RET 8a93"
          buffer code: #xE8 #xAA #x93
            file code: #xE8 #xAA #x93 (encoded by coding system utf-8)
              display: by this font (glyph code)
    mac-ct:-*-STFangsong-normal-normal-normal-*-28-*-*-*-p-0-iso10646-1 (#x35BE)

Character code properties: customize what to show
  name: CJK IDEOGRAPH-8A93
  general-category: Lo (Letter, Other)
  decomposition: (35475) ('誓')

There are text properties here:
  fontified            t
  line-prefix          [Show]
  wrap-prefix          [Show]

Problem is fixed when I run emacs -Q


texts: detect unprintable glyph (aka "no font available") programmatically

texts:
Sometimes a font or a font at a special fontsize does not support a unicode glyph. Then a placeholder (box with character number) is printed, see screenshot with selected line:

How can I programmatically detect such unicode glyphs from within Emacs with elisp?
I intend to overlay|replace them with a printable representation.

I could change general fontset, but this is not an option.

Edit: what-cursor-position states that:

  display: no font available

But I can't decode from the source, how it detects that.


texts: Automatically complete org-mode tasks in agenda based on headings in specific org file

texts:
So I'm trying to set up a specific workflow with emacs. Basically, I'll have NFC tags around the house on the various things I need to deal with for chores and etc. As I do these tasks, I'll tap the tag with my phone and will have a heading added to an org file indicating that I've done this. (I can already do this much)
The next thing I want to do with it is add a hook to my agenda that will go through this file and match any new headings to whichever tasks I have in my agenda, completing these tasks for me.
I'm new to elisp though, so I'm hoping that I could get some direction on the creating the pieces I think I'll need to do this.
So I think I'll need:

A method to scan through my 'completed' file

It'll mark any new heading it finds as being already found
It'll ignore already found ones

A method to go through tasks in my agenda
A method to set these tasks as being completed


texts: Interactive function to convert Windows path to POSIX path

texts:
Here at 'dayjob I'm often sent paths from developers using Windows in Windows format:

D:\Some\Path

These paths can uniformly be converted to paths valid on at least some Linux machines at 'dayjob like:

/mnt/remote-d/Some/Path

I would like to write an interactive function to automate this conversion, so that I may simply tap something along the lines of C-t C-p to perform this conversion. The string transformation part of the function will probably be something along the lines of

(replace-regexp-in-string "\\\\" "/" str)

But then we also have to capture the string from the buffer. For that purpose thing-at-point looks promising, but I've thus far been unable to tame it. I have also found the following function which I think captures what I'm after with some modification: https://github.com/akicho8/string-inflection/blob/master/string-inflection.el#L184


texts:
I am using eclim and I am loving it! But I had to disable eclimd-autostart because it keep trying to fire up eclimd when I pop a .js buffer.

Autostarting of eclimd is disabled, please start eclimd manually. [2 times]

Here its my eclim configuration

(use-package eclim
  :ensure t
  :after evil-leader
  :init (custom-set-variables '(eclim-default-workspace "~/workspace/"))
  :if (string-match-p (regexp-quote "cesco") user-login-name)
  :config (progn
        ;; (setq eclimd-autostart t)
        (cond
         ((string-equal system-type "gnu/linux")
          (setq eclim-executable "/opt/eclipse/eclim"))
         ((string-equal system-type "darwin")
          (setq eclim-executable "~/eclipse/Eclipse.app/Contents/Eclipse/eclim")))
        (evil-leader/set-key-for-mode 'java-mode
          "rr" 'eclim-java-find-references
          "rj" 'eclim-java-find-declaration)
        (define-key eclim-mode-map (kbd "C-c C-c") 'eclim-problems-correct)
        (global-eclim-mode)
        ))

I also observing a very weird problem when using org-edit-special to edit any language source block. Eclim seems to take the job

error in process filter: apply: Not enough arguments for format string
error in process filter: Not enough arguments for format string
eclimd serving at port 9091


texts: AUCTeX - delete 'other' files like .out, .aux, .log on successful compilation

texts:
I do not want to keep the miscellenous files created during compilation of my .tex files if the compilation is successful.

I tried setting Latex-clean-output-suffixes by adding these extensions but that did not help.

How do I achieve that?


texts: How to supress transforming link names by org-export to html?

texts:
The HTML export of an org file transforms the links to "to equivalent HTML links in the output"

How can I suppress this? I want to keep the same link names.

Example: If we have this org file.

** section 1
This is important.
<<important>>
** section 2
As we have seen in [[important]] ...

We get after the html export something like this:

1 section 1

This is important.

2 section 2

As we have seen in 1

So the export has transformed 'important' into 'orgcfaef91'.

I need the old link name ('important') in the html file.
How to get this?

Are there  problems I don't see -- that org-mode has this setting (transforming the id's) ?


texts:
I am running Wayland on Ubuntu 18.04.
According to the Wayland FAX, one of it's advantages, compared to X11, is that

Wayland allows better isolation between processes: one window cannot access resources from, or inject keystrokes into, another window.

That same Wayland document also says that

because Emacs is not a real GTK apps, it still talks with X11 and therefore will use XWayland

where XWayland is described as:

Note that any X program will still run, as there is a XWayland server that provides backwards compatibility with X program. Those programs will not, however, benefit from the security and performance improvements Wayland provides.

There is a 2016 devlevel discussion thread which considers removing X11 dependency from Emacs - notably a condition already achieved in Win23 and NS versions of Emacs.
It's now 2019 and so my question is, as the title states:
Is there an X11-free build of Emacs that can run on Wayland (not going through XWayland)?
If the answer is no, I do have another question which is probably off topic for this list:
Why can't Wayland just intercept all X11 calls in XWayland and convert them into proper Wayland calls?

Edit Background Info:  Apparently Electron (which the editor Atom uses to interface with Linux) has some X-call dependencies which require a setting DISABLE_WAYLAND=1 causing it to run via XWayland when running on Wayland.  Also see Arch docs on Wayland which suggests setting GDK_BACKEND=x11 for Electron. So it's by no means an Emacs only issue.

Edit: Clarification (c.f. @phils very helpful and through provoking comments)
Wayland does intercept X11-calls, and of course Wayland-calls.  However, the Wayland documention suggests only the Wayland calls enjoy the security benefits that Wayland has to offer.
As @phils and @wasamasa point out, emacs-nox makes no X-calls, so it should theoretically be able to run on a terminal-emulator (e.g. terminology, termite) which itself is using only Wayland protocol, and not X-protocol.
Testing that on Ubuntu has turned out not to simple, as even with a Wayland desktop on 18.04 it seems to use XWayland as the default.  So the dual Wayland/X compatible terminology terminal emulator runs in X mode by default. From terminology:
~$ echo $XDG_SESSION_TYPE
x11

FINISHED
Emacs-nox runs well in Fedora 29 (personally ran it), and Fedora 29 doesn't support X at all.
By default it seems to not share the system clipboard - the same as seen in emacs-nox on Ubuntu.  But emacs-nox can be modified easily enough to work with @wasamasa' s answer below and custom emacs calls to external clipboardhere and here.


texts: Can't close Robe console split in spacemacs

texts:
I run SPC m s i to start Robe (Ruby code inspection tool) in spacemacs, and it opens a split with a REPL. When I'm done issuing commands I can't close the split.

SPC is not usable because the REPL and the buffer are just interpreting what I type as text, it just outputs whitespace.
I can stop the console process with C-c C-\ but then I'm still left with an open split and the buffer still ignoring SPC.

How do I close the other split?


texts: How can I open a file with a BOM Byte Order Mark and ensure that BOM is gone when I save the file.


texts: Keep heading contents always visible in org-mode

texts:
How can you keep a heading's main content always visible in org-mode?
Perhaps a property that can be set, so that S-tab never collapses it? (Not keeping the children's contents visible, unless they are also set the same way, not impacting e.g. narrowing etc.)


texts: Use helm-company as default for company autocompletion?

texts:
I want helm-company as the default selection method for company. Helm-company is meant to be invoked manually after company completion started. But I would really like to invoke helm automatically on completion (after . etc) instead of using the usual pop-up method company provides.

I tried to use company-completion-started-hook but it did not work. I'm not very familiar with company, has anyone solved a similar problem or knows how to accomplish this?


texts:
For example, I get

#+BEGIN_SRC python :session sdfjkl :results output
  import numpy
#+END_SRC

#+RESULTS:
: Python 3.8.0 (default, Oct 23 2019, 18:51:26)
: [GCC 9.2.0] on linux
: Type "help", "copyright", "credits" or "license" for more information.

#+BEGIN_SRC python :session main :results output
  import numpy
#+END_SRC

#+RESULTS:
#+begin_example
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.8/site-packages/numpy/__init__.py", line 152, in <module>
    from . import random
  File "/usr/lib/python3.8/site-packages/numpy/random/__init__.py", line 181, in <module>
    from . import _pickle
  File "/usr/lib/python3.8/site-packages/numpy/random/_pickle.py", line 1, in <module>
    from .mtrand import RandomState
  File "_bit_generator.pxd", line 14, in init numpy.random.mtrand
  File "_bit_generator.pyx", line 255, in init numpy.random._bit_generator
AttributeError: type object 'numpy.random._bit_generator.SeedSequence' has no attribute '__reduce_cython__'
#+end_example

Somehow, setting the name of the session to be main changes something
that makes things not work. Why is this?


texts:
I just upgraded to Emacs 26.1 on Linux (Ubuntu 18.04, but emacs26 from the kelleyk repo).

python-mode is now bringing up a *Python-Help* window whenever the cursor in on a symbol or keyword.  I'm finding this very distracting because it messes with my buffer layout and moves the cursor around.

It's a nice idea, but I don't want it happening automatically.

How can I disable the automatic *Python-Help* window?


texts: Use `%^{prop}p` `%^{prompt}` together in org-capture-templates

texts:
What I want is when the buffer asks me  a value for property , I can also  replace property name with some alternatives.

I tried the following code, but fails

(setq org-capture-templates
      '(("R" "Reference" entry (file+datetree "~/Dropbox/org/reference.org")
         "* %? (one sentence each
part)\n%^{^{Conclusion|default|come1}}p%^{Detail}p%^{Reason}p%^{Good_for_me}p\nEntered on %U\n %i\n" :prepend t
:kill-buffer t)
        )
      )


texts: Can htmlize un-collapse an org document?

texts:
I have an org document ~/foo.org

#+Title: testing htmlize
#+Date: <2015-08-21 Fri>

* Hello world

Lorem ipsum dolor sit amet, consectetuer adipiscing elit.  Donec hendrerit
tempor tellus.  Donec pretium posuere tellus.  Proin quam nisl, tincidunt et,
mattis eget, convallis nec, purus.  Cum sociis natoque penatibus et magnis dis
parturient montes, nascetur ridiculus mus.  Nulla posuere.  Donec vitae dolor.
Nullam tristique diam non turpis.  Cras placerat accumsan nulla.  Nullam rutrum.
Nam vestibulum accumsan nisl.

** Subsection

Mauris ac felis vel velit tristique imperdiet.

| this   | is   | a      | table  |
|--------+------+--------+--------|
| albeit | not  | very   | useful |
| john   | paul | george | ringo  |

Issuing M-x htmlize-file <ret> ~/foo.org <ret> writes an html file ~/foo.org.html whose output looks like

#+Title: testing htmlize
#+Date: <2015-08-21 Fri>

* Hello world...

It appears that htmlize reads ~/foo.org in its collapsed form. Is it possible to get htmlize to read ~/foo.org in its entirety?

I'm currently issuing M-x htmlize-buffer followed by C-x C-w to write the complete html file but I'd like to do this with only one command.


texts: How to get all full path list by a folder name?

texts:
I want to get all the full path by a folder name called autoload, in my config i had split it like this file structure.

├── init.el
├── packs
│   ├── +completion
│   │   ├── ivy
│   │   │   ├── autoload
│   │   │   │   ├── evil.el
│   │   │   │   ├── hydras.el
│   │   │   │   └── ivy.el
│   │   │   └── config.el
│   ├── +editor
│   │   ├── fold
│   │   │   ├── autoload
│   │   │   │   ├── fold.el
│   │   │   │   └── hideshow.el

so i want get all autoload folders path list, this function will return a list like
("/User/xxxx/.emacs.d/packs/+completion/ivy/autoload/","/User/xxxx/.emacs.d/packs/+editor/fold/autoload/"). thanks!


texts: Tuareg mode indentation after the first open clause

texts:
I'm working through the Real World OCaml book. Based on the installation instructions, I installed tuareg-mode for editing OCaml code.
It is version 2.0.9, which appears to be the latest version.

The corresponding code in my init.el looks like:

  (add-hook 'tuareg-mode-hook 'tuareg-imenu-set-imenu)
  (setq auto-mode-alist
        (append '(("\\.ml[ily]?$" . tuareg-mode)
                  ("\\.topml$" . tuareg-mode))
                auto-mode-alist))
  (autoload 'utop-setup-ocaml-buffer "utop" "Toplevel for OCaml" t)
  (add-hook 'tuareg-mode-hook 'utop-setup-ocaml-buffer)
  (add-hook 'tuareg-mode-hook 'merlin-mode)
  (setq merlin-use-auto-complete-mode t)
  (setq merlin-error-after-save nil)

When I try to type code into a .ml file, it indents things weirdly. For example,
if I type

open Core.Std
       (* it indents like this *)
       (* for every line in the rest of the file *)
(* But I would expect it to indent like this *)

When I type a let statement, it does move to the left, but only after I press return to move on to the next line.

Inside a function definition, indentation works as expected, but the top level of the file indents like the example above. How can I make the top-level indentation behave?


texts: Can Org Babel conditionally tangle code blocks based on system-type?

texts:
Edit: While I'm still learning the ropes of Babel, I've read about the system-type, emacs-version, and window-system variables, which sound like they contain all the information I need to get the behavior I've described here. In fact, I could just wrap OS-specific code in conditionals when needed in code blocks. I'm wondering if this is the best way to go about this, however.

I'm using Babel to write literate configuration files for Emacs. I would like my config files to work on all of the platforms I frequently use (so basically various Linux distros and Macs), and part of this involves having settings that depend on the system (e.g., the default font I use on my Mac is different than the one I use on Linux Mint).

While I'm sure I've seen ways to recognize whether or not I'm on a Mac using elisp (and hence could wrap any system-specific settings in some kind of conditional based on this), I'm wondering if Org/Babel has some way to detect the type of system I'm on which would enable me to write different code blocks for different systems. Better yet, can this also be done for different versions of Emacs? I'm envisioning code that would look something like the following (with platform and header names being contrived examples)

#+Platform: LinuxMint
#+Emacs: GNU Emacs
#+EmacsVersion: 24+
#+BEGIN_SOURCE EMACS-LISP
    [Some configuration for Linux Mint and GNU Emacs 24+]
#+END_SOURCE

#+Platform: LinuxMint
#+Emacs: GNU Emacs
#+EmacsVersion: 22.1
#+BEGIN_SOURCE EMACS-LISP
    [Some other configuration for Linux Mint and GNU Emacs 22.1]
#+END_SOURCE

#+Platform: Mac
#+Emacs: Aquamacs
#+EmacsVersion: 24+
#+BEGIN_SOURCE EMACS-LISP
    [Some other configuration for Mac and Emacs 24+]
#+END_SOURCE

The big fish to fry is the platform, since the version of emacs and the emacsen I use can probably be inferred from this in most situations. I should mention that the platform could be coarser than what I suggest above. (I really just need to know if I'm on a Linux, Windows, or Mac distribution.) Also, if these aren't built-in features, how would I go about creating code-block headers like these?

Edit: I suppose it might also be more likely to look something like the following.

#+BEGIN_SOURCE EMACS-LISP :os Linux :emacs GNU :emacs-version 24+
    [Some configuration for Linux and GNU Emacs 24+]
#+END_SOURCE

I imagine this can be found somewhere in the documentation if it exists but I couldn't seem to find a comprehensive list of headers for code blocks. Thanks for any help you can provide!


texts:
I'm trying to set up gnus for reading mailing lists.

According to some threads I have the following in my init.el

(setq user-mail-address "myname@domain.org")
(setq user-full-name "my name")

(setq gnus-select-method
             '(nntp "news.gmane.org"
                     (nntp-open-connection-function nntp-open-tls-stream)
                     (nntp-port-number 563)
                     (nnir-search-engine gmane)
                     ))

But running M-x gnus results in:

Warning: Opening nntp server on news.gmane.org...failed: >>> (error
Certificate validation failed news.gmane.org, verification code 42);
Server nntp+news.gmane.org previously determined to be down; not
retrying

Do I do something wrong or is gmane down?


texts:
Until very recently, I've been able to build emacs from source in a docker container using this recipe. However as of last week, all my builds have been failing with

Warning: Your system has a gap between BSS and the
heap (32188607 bytes).  This usually means that exec-shield
or something similar is in effect.  The dump may
fail because of this.  See the section about
exec-shield in etc/PROBLEMS for more information.

I've read the etc/PROBLEMS and it doesn't make any sense to me. Does anybody know how to interpret this for a docker container and what I can do to get emacs building again on hub.docker.com?

I've tried

cat 0 > /proc/sys/kernel/exec-shield

but I don't think that is really the problem, it doesn't exist in the container.

cross-posted to https://stackoverflow.com/questions/37544423
upstream bug report https://github.com/docker/docker/issues/22801


texts:
After having upgraded a computer from Ubuntu 15.04 to 15.10 the colors in Emacs (which I run in the terminal with --no-window-system) have changed substantially and some text is now illegible. I would like to find out to change the colors back to how they were.

After. Output of M-x customize-create-theme in a 15.10 terminal (some faces change only the background leading to illegible text):

Before. Output of M-x customize-create-theme in a 15.04 terminal: (both foreground and background are changed)

Some investigation has led me to believe that the problem lies with having upgraded the terminal or some related application rather than Emacs: I installed version 24.5 from source on two computers, one running 15.04 and the other 15.10, and ran emacs -q -nw in various configurations:

On the 15.04 install, the colors are "right"
On the 15.10 install, the colors are "wrong"
SSH from 15.04 terminal to run the 15.10 install, the colors are "right"
SSH from 15.10 terminal to run the 15.04 install, the colors are "wrong"

So I'm guessing that the terminal is providing some information to Emacs about what colors it should use, but I can't work out any more than that.

Can someone help me to understand how the OS and terminal can affect Emacs' color scheme, and what I might be able to change to get the old colors back?


texts: Result of arithmetic evaluation in buffer, not echo area

texts:
Windows 10, Emacs 25.1

I want to do some arithmetic operation I do this:

The result is in the echo area, but I want the result to be in cursor place in the buffer.  Something like this:

How do I do this?


texts: Latex-mode: spotting typos which are errors in text mode but not in math mode

texts:
For my purposes the string "( 1" is a typo when it occurs in text but, obviously it isn't a typo in (LaTeX) math mode as in $( 1 ...$ or in math environments.

What's the best emacs way to approach this kind of problems?


texts: emacs (exwm) freezing when inputing accented letters

texts:
I'm currently running a new install of exwm on a french laptop. Writing in french means I need to input accents. Those letters I can input using dead keys without any problem but I cannot use the actual pre accented letters (é,è,ç,ù,à) which is quite hard on my muscle memory.

Here's where the weird things start to show up.

If emacs hasn't frozen yet, I can input C-é, C-è, C-ç, C-à and C-ù without it freezing. I get a message in the minibuffer saying that these are not bound to any command which is normal.

I tried using ltrace -p <emacs PID> and while this is running (in a different  tty) emacs will not freeze but I cannot run it in backgroung in a dynamic way because the PID varies from one session to another. A soon as I stop ltrace, emacs freezes whatever the input. As soon as I start ltrace (after a freeze) everythings starts working again and my keystrokes all happen in order.

My XKbMap is set to pc105 fr latin9 which is the same as with my other window manager (herbstluftwm) which works fine. As for the emacs input method, I've left the default value which works fine if I start emacs in another window manager.

I am using the default config for exwm with the added line setting my XKbMap just before runing exwm.

2019-10-17 : Il seems the problem is linked to my vconsole.conf. If set to KEYMAP=fr exwm works as intended. If set to KEYMAP=fr-latin1 , my actual layout, it starts freezing again.


texts: Predictive mode, Auctex not playing nicely

texts:
I have predictive, auctex installed. I want predictive mode to work with my .tex files but I keep getting a warning of:

Warning (emacs): Predictive major-mode setup function predictive-setup-latex failed; latex-mode support disabled

after trying to turn on predictive mode with M-x predictive-mode when a .tex file is open.

I've found this issue here,

https://superuser.com/questions/326431/why-is-emacs-predictive-mode-not-working-for-latex-documents

https://tex.stackexchange.com/questions/26109/emacs-predictive-mode-does-not-work-for-latex-documents

But both are inconclusive to me as I know predictive mode has successfully installed, its being managed by el-get.

Usually I debug with emacs --debug-init, but this is happening long after the .emacs is loaded.


texts:
In normal mode in Vim, one can use y% to copy text between matching parenthesis. y starts the yanking command and % selects the matching closed or open parenthesis.

What is the Emacs equivalent of this operation?


texts:
The verilog-mode package contains this code:

(define-skeleton verilog-sk-header-tmpl
  "Insert a comment block containing the module title, author, etc."
  "[Description]: "
  "//                              -*- Mode: Verilog -*-"
  "\n// Filename        : " (buffer-name)
  "\n// Description     : " str
  "\n// Author          : " (user-full-name)
  "\n// Created On      : " (current-time-string)
  "\n// Last Modified By: ."
  "\n// Last Modified On: ."
  "\n// Update Count    : 0"
  "\n// Status          : Unknown, Use with caution!"
  "\n")

What is the cleanest and best way to redefine it in my .emacs init file ?


texts: Mac `option` key works as `meta` key in terminal Emacs but does not work in GUI Emacs

texts:
I checked the option key as meta in terminal preference. Now the option key works as meta in terminal.

Once I open Emacs through terminal option key doesn't work as meta anymore. If i type Option-v The result comes out as a check mark.

I've added the next line to my init file but still doesn't work.

(setq ns-option-modifier 'meta)

Now I can only use ESC as meta.

Any idea why the keybinding doesn't change in Emacs?


texts:
Most of the time my echo area sits empty while the modeline of each of my windows displays plenty of redundant redundant information (current time, system load, and various other buffer-independent pieces of information).

Can I display the current time (right-aligned) in the echo area (whenever it is not in use?)


texts: How do you properly bounce emacs installed via home-brew on macOS

texts:
I just added a snippet to my ~/prelude/personal/personal.el
Time to activate it.
In the past I've found that brew services restart emacs doesn't work out.
So,

While inside the emacsclient, if I do

M-x kill-emacs

and then in my terminal do

$ brew services start emacs

I get

Service `emacs` already started, use `brew services restart emacs` to restart.

But I just killed emacs?  Whats going on, this is weird.


texts:
Related: Emacs: GUI with emacs --daemon not loading fonts correctly

My init.el contains the following lines:

(require 'darktooth-theme)
(load-theme 'darktooth t)

If I start Emacs with

$ emacs

... the theme loads properly. [Scroll down!]

However, if I start Emacs with

$ emacs --daemon
   ...
$ emacsclient -c

... the theme doesn't load properly. [Keep scrolling]

Why does this happen, and how can it be fixed?


texts:
If I'm reading a book, that has 500 pages, and I'm in the page 253. I want to track that progress in Org-mode as %, is there a way to do it that is already built in (or, if is not the case, is there a plugin that allows what I want)?

Currently the ways to track progress that I know are by number of tasks done in a subtree. But in this case I won't create a task for each page, that wouln't be efficient.


texts: Help troubleshooting NPM logo misalignment in Treemacs

texts:
I am developing a Node.js project in Emacs 28.0.50 on macOS 10.15.7. I am using lsp-mode along with lsp-treemacs.
Using Treemacs 2.8, the NPM logo corresponding to package-lock.json is misaligned (everything shown is a top-level file):

I tried troubleshooting by looking for an alist of filenames or types to different logos for Treemacs, but I could not find such an alist. I dug through all-the-icons, treemacs, and other packages, and the best lead I could find was the treemacs-icon-for-file function, but got stuck there.
Any insight would be much appreciated.


texts: Opening a file from a new/different Projectile project in the same workspace in Doom Emacs

texts:
If I'm working on one project and I switch over to a buffer from another the default behavior of Doom Emacs seems to be to open the new buffer in a new workspace (when workspaces are enabled). I want the default behavior to be to open it in the current workspace, but I don't want to disable workspace functionality in general. Is there a good way to do this?
After more research this seems to be an interaction between persp-mode and projectile.


texts:
This works:

(require 'clojure-mode)
(when (member 'clojure-mode my-packages)
  (define-clojure-indent
    (-> 1)
    (->> 1)))

This gives the error Wrong type argument: listp, 1:

(when (member 'clojure-mode my-packages)
  (require 'clojure-mode)
  (define-clojure-indent
    (-> 1)
    (->> 1)))

Here's what I think is happening in the second version:

define-clojure-indent is a macro defined by clojure-mode, which is not loaded by default. So define-clojure-indent is only defined after (require 'clojure-mode) is evaluated.
Since both the require and the define-clojure-indent call are in the same top-level form, all macroexpansion happens before any evaluation happens. This appears to be similar to the Gilardi scenario from Clojure.
Both -> and ->> are macros defined by dash.el, which I also had loaded. They have the behavior that both of the forms (-> 1) and (->> 1) expand to just 1.
It appears that since Emacs does its macroexpansion on the define-clojure-indent form before it has loaded clojure-mode, it does not yet know that define-clojure-indent is actually a macro. Therefore, it goes ahead and macroexpands recursively, transforming

(define-clojure-indent
  (-> 1)
  (->> 1))

to

(define-clojure-indent
  1
  1)

by interpreting -> and ->> as macros instead of simply unevaluated symbols.
When clojure-mode is actually loaded and define-clojure-indent is invoked as a macro, it throws an error because it expects its arguments to be lists, not integers.

Whereas in the first version, since the require and define-clojure-indent are in different top-level forms, by the time Emacs gets to macroexpanding the define-clojure-indent form, it already knows that define-clojure-indent is a macro, and doesn't try to do macroexpansion on its arguments. So (-> 1) and (->> 1) are passed to define-clojure-indent as lists of symbols, as I would expect, and everything works.

So here is my question. If Emacs doesn't know whether or not something is a macro, why would it do macroexpansion on the arguments? In this situation, it clearly produces unintended behavior. As far as I know, this would never happen in the Clojure macro system. And I can't think of any situation in which the current functionality would be desired.

Surely I am missing something here. Is there an elegant way to avoid this problem? Or do I have a fundamental misunderstanding?

(P.S. I am aware that I could use eval-after-load. The same problem still occurs, but I used require in the example because it was simpler. Full code—obviously not yet working, because of this and other errors—available here.)


texts: How to execute one line in the .emacs file?

texts:
To test a function definition, for example :

(defun count-words-buffer ()
  (let ((count 0))
    (goto-char (point-min))
    (while (< (point) (point-max))
      (forward-word 1)
      (setq count (1+ count)))
    (message "buffer contains %d words." count)))

The goal would be to test a function while writing, without restarting Emacs.


texts: Getting the TAB key to work the same in Doom as in Spacemacs

texts:
When using the TAB key in a magit status/overview buffer, it says: Buffer is read-only.
If I manually disable read-only mode, the pressing TAB indents the text instead of expanding or contracting sections, as it should when bound to magit-section-toggle. In the magit buffer, TAB is bound to indent-for-tab-command.
If I remove the binding (map! :inv [tab] #'indent-for-tab-command) from my key config, then TAB gets bound to evil-jump-item in both Magit and Python buffers. How can I get TAB to behave like in Spacemacs, both in Magit and Python buffers? (I'm not entirely sure that TAB is bound to indent-for-tab-command in Python buffers in Spacemacs.
Here is my key-config: http://ix.io/2Olo/elisp


texts: Does use-package keep packages automatically updated?

texts: I'm using use-package in my init.el for all my package installations and configuration. I thought specifying :ensure t in use-package would make sure I always have the latest versions installed. But when I did M-x package-list-packages the minibuffer tells me I have a number of package updates waiting. Isn't it enough to specify :ensure t in use-package, do I have to manually check for and install updates using M-x package-list-packages? What is the best way to handle updates when using use-package?


texts: Yearly calendar view of agenda (with colored background)

texts: I would like to have a yearly calendar view of my agenda. The code from https://stackoverflow.com/questions/9547912/emacs-calendar-show-more-than-3-months shows how to display a calendar for the whole year. Ideally, I would like to connect it to my agenda such as to color the background of each day according to the number of events for this day. This would allow me to quickly visually check what are the busy days (I imagine I can probably query the information but I would prefer such a visual). Is there any package that could do that?


texts: Enabling a minor mode with a file-local variable prop line

texts:
The first line of a plain-text file reads:

# -*- eval: (auto-revert-tail-mode 1); -*-

Yet Emacs does not enable auto-revert-tail-mode after opening this file.  What is wrong?


texts: How to disable lisp-interaction when starting Emacs?

texts: When I open Emacs, the *scratch* buffer is in Lisp Interaction mode, but I don't want that.  How can I make the buffer have a text mode instead of Lisp Interaction?


texts: Is there a yasnippet producing a prepopulated doxygen comment?

texts:
For the following C++ function:

bool importantStuff(double a, double b);

It should output the following snippet, perhaps without the tags:

/**
 * <Insert description of importantStuff>
 *
 * @param a <Insert description of a>
 * @param b <Insert description of b>
 * @return <Insert description of the return value>
 */

I've looked around the net, but the closest I've gotten to an answer is this old SO question where the answer depends on the no longer maintained doxymacs mode.


texts:
Say below org-mode block:

#+BEGIN_QUOTE
item 1
item 2
#+END_QUOTE

If export as html, the display is:

item 1 item 2

It should be two line but actually merged as one line!
I wish to keep the line feed CRLF!


texts: How do I bind Caps Lock to Control on Windows?

texts: What are my options for making my Caps Lock key a Control key? Can this be done within Emacs?


texts: Why my minor mode bindings do not get precedence over global/major mode bindings? BUG?

texts:
EDIT: ANSWER
The cause for the problem in this question was pointed out in the Emacs mailing list. It is due to the (kbd ...) forms not getting evaluated because the keymap in the define-minor-mode is passed as a quoted list.
The (kbd ...) forms can be used by using a backquoted list and then placing a , before each (kbd ...) form so that they get evaluated.
END EDIT
I know there are similar questions like mine, but I could not find an answer to my question.
This question was edited (below) because it appears to be a bug (please confirm).
I want my minor-mode bindings to get precedence over the pdf-view major mode bindings.
I define my minor mode with the following code:
(define-minor-mode pdf-continuous-scroll-mode
  "Emulate continuous scroll with two synchronized buffers"
  nil
  " Continuous"
  '(((kbd "j") . (lambda () (interactive) (print "pushed j")))
    ((kbd "k") . (lambda () (interactive) (print "pushed k")))
    ((kbd "C-n") . (lambda () (interactive) (print "pushed C-n")))
    ((kbd "C-p") . (lambda () (interactive)(print "pushed C-p"))))
  (print "loaded minor mode"))

Now when I evaluate this while I am viewing a document with PDF-tools and enable the minor mode, then the j/k bindings work but the C-n/C-p bindings do not because Emacs still uses the pdf-view major mode keybindings (i.e. it scrolls the document).
I find here that minor-mode keymaps should have highest precedence behind overlay keymaps. I checked if maybe there is some overlay keymap used in PDF-tools but I could not find one.
Can anybody explain why my minor mode bindings do not get precedence over de pdf-view major mode bindings?
EDITS

I find the C-n and C-p do not even get precedence over the global-keymap. I can just start emacs using emacs -Q, evaluate the code and activate the minor mode. Then still C-n and C-p do not work. Please someone confirm this is a bug, then I will report the bug.

END EDIT


texts: How to define a variable which gives the last inserted character of the current buffer?

texts:
Is there a built-in variable which gives the last inserted character of a buffer (inserted by self-insert-command)?
Note that the cursor is not necessarily at the place of the last insertion.

If there is not such a variable, any other solution for defining a variable which determines this character would be helpful.


texts: `markdown-mode` only renders some, not all, LaTeX strings

texts:
I'm using markdown-mode.  I followed these instructions to render LaTeX math strings: http://jblevins.org/projects/markdown-mode/

I am rendering to HTML with markdown-export and markdown-live-preview-mode.  Have I assumed incorrectly that these LaTeX expressions can be rendered to HTML?

Simple LaTeX strings render fine:

  then the event ${ \tau \leq n }$ is just

Any LaTeX string with a function inside does not render:

  with probability $\frac{1}{2}$ and

Extra curly braces do not fix rendering:

  with probability ${\frac{1}{2}}$ and

I think I have the relevant Macports ports installed, and the relevant Emacs packages.

Thanks!


texts: How to remove an org-mode entry's effort property while viewing the agenda?

texts:
Is there any way to completely delete an entry's effort property from within the org-mode agenda?
Ideally, I'd also like to be able to bulk remove efforts from the agenda view.
"org-agenda-set-effort" doesn't provide a method to remove the property.


texts: Usage of vhdl-mode's vhdl-compose-place-component function

texts:
The command vhdl-compose-place-component is supposed to create the text to place a component. I can't figure out how to specify which component it places, though. Right now, when I use it, it places a random component that I don't want it to. Here's the M-x describe-function:

vhdl-compose-place-component is an interactive compiled Lisp function
in ‘vhdl-mode.el’.

It is bound to C-c RET C-p, <menu-bar> <VHDL> <Compose> <Place
Component>.

(vhdl-compose-place-component)

Place new component by pasting current port as component declaration and
component instantiation.

Does anyone know how to specify which component it should place?


texts: How can I detect if an elisp script is piped?

texts:
I want to be able to tell whether stdout is a pipe in an elisp script. This would allow to distinguish between:

$ emacs --script foo.el

and

$ emacs --script foo.el | cat

Is this possible in Emacs lisp? Most programming languages have this in the stdlib.


texts: How can I use Company to spell-check a word?

texts:
company-ispell can complete a word at point, but what if you want
to use Company to list the possible corrections for spelling?

As an added bonus, is there any way to integrate this into Flyspell?


texts:
I just pick up emacs after a while with Vim.
This is run on CentOS server.
I ssh to the server, and start with gnu screen, and emacs ess, when I start to run R, emacs just freeze.

Here is what I did before it get freeze:

ssh servername
screen
emacs -nw test.r
C-X 2
C-X o
M-X R

the process of emacs is still running with CPU 80-90%. And there is no R process coming up.

It is fine if I run emacs without screen.

Any suggestion for getting this work?


texts:
I have an org-formatted file named foo.org that consists only of headings (without
body).  Notice the absence of blank lines.

* one
** a
** b
* two
** c
* three

I want to use capture templates to add a sub-headings (without body) under
the top-level headings one or two while preserving the original format.
To do this I have these templates

(setq org-capture-templates
  (list
    '("f" "Foo")
    '("fo" "One" entry
       (file+headline "/tmp/foo.org" "one")
       "** TODO %?"
       :prepend t :unnarrowed t :jump-to-captured t)
    '("ft" "Two" entry
       (file+headline "/tmp/foo.org" "two")
       "** TODO %?"
       :prepend t :unnarrowed t :jump-to-captured t)))

The problem is the templates automatically include a blank line after the
heading

**␣TODO␣

which I have to delete manually every time.  Is it possible to tell Emacs not to insert
a newline character after the heading?


texts:
In my org mode file I have:
* TODO [#A] Call UPS 1 <2020-09-25 Fri>

* TODO [#A] Call UPS 2 <2020-09-25 Fri>

* TODO [#A] Call UPS 3 <2020-09-25 Fri .+1w>

But only:
TODO [#A] Call UPS 3
Shows up in the Agenda.
However, all 3 TODO's do show up in the Global TODO List.
I don't understand why, when all 3 TODO's have the same priority and the same date, that only the one with a repeating date shows up in the Agenda.
Any help is appreciated......
Thanks ahead of time.


texts: Run a command with C-c C-c for a specific major mode

texts:
I have a file with a .md extension, and I want to run a command to interpret/parse a file when markdown-mode is active with a C-c C-c key combination, for example. I want to run this shell command:

aglio -i foo.md -o foo.html

Wherefoo.md is the file name of the current buffer and foo.html is this name with replaced extension (to html). How can I do this in Emacs?


texts: Displaying workgroup details on powerline or telephone-line modeline

texts:
I recently came across various workgroup extensions for Emacs and have been doing some experiments. I had a look at:

eyebrowse
workgroups
workgroups2

(I have currently settled with workgroups2)

I could see the workgroup details on the default Emacs modeline but as soon as I enable the powerline or the telephone-line, I could not see the workgroups anymore, except for the wg as an indication that the minor-mode is enabled.

Can anyone provide me a few pointers for how I can get it on the custom mode-line?


texts: is any way to show empty paths in Dired like com/domain/example/database as single item?

texts:
for example, Java/Scala sources have a convention that packages like com.domain.example.database should be represented as com/domain/example/database folder structure (and all dirs are empty except last one the database). So I wish to show deep paths like this as a single item as Github does. The com/domain/example/database should be shown as a single folder item at Dired.

As an example on Github see https://github.com/elastic/elasticsearch/tree/master/modules/analysis-common/src/main - that folder has a java/org/elasticsearch/analysis/common and if you click on it, the common be opened.


texts: How can I save UTF-8 files with a Byte Order Mark?

texts:
I am trying to configure Emacs to save UTF-8 files with a Byte Order Mark. (Yes, I know that the BOM is evil and unnecessary for UTF-8 files. However, Microsoft has decided they know better, so I want to make sure I'm able to save files with BOM.)

However, for some reason my choice of utf-8-with-signature for buffer-file-coding-system won't stick when I save the file.

I'm using Emacs 24.5.1 on Windows 10. To reproduce:

emacs -Q
Open a file (optionally one that already has a BOM).
(setq buffer-file-coding-system 'utf-8-with-signature) (Or M-x set-buffer-file-coding-system RET utf-8-with-signature RET.)
C-x C-s
C-h v buffer-file-coding-system. It is now set to utf-8-dos. I also verified that the existing BOM was removed from the file.

Why is this happening, and how can I fix it?


texts: How to disable auto-indentation of new lines?

texts:
I've recently upgraded emacs to version 24.4.1 and something has changed in the indentation of new lines. When I hit enter I expect just "bare" new line character at point where cursor was present, in particular if I'm in the middle of the line, that line should be splitted and none character be deleted including spaces. Unfortunately this is not the case.

Here is example:

a b

When I put the cursor just after a and hit enter I get:

a
b

while it should be

a
 b

I googled a bit and probably this is due to auto-indentation, how can I disable this? I'm talking about text or fundamental mode if that matters.


texts:
Since projectile and treemacs are independent project and treemacs-projectile is written as helper. However I fail to understand the concept of it.

I want to see all my projectile projects be shows in treemacs as I add them via projectile (and be added to projectile if I add them to treemacs). And if I close a project in either mode it should be closed with all its buffers.

Right now I achieve the same result by calling commands from each manually. Which is very cumbersome.

How can I keep treemacs and projectile in sync?


texts: How to set up personal information alist with defcustom

texts:
I would like to have a variable, say my-info that would have an alist attached to it. In normal programming it would look like this:

(setq my-info '((my-name . "Giuseppe Sextus-Packus") (my-email . "joep@packllc.com") (my-phone . "39.06.4434.0147")))

However, I want to populate my-info in a customization buffer, i.e., callable with customize-variable my-info. Furthermore, I would like each key to be presented with a blank field to fill in the value. I know I have to declare this variable as a defcustom but the details of offering all three keys for the user to complete with values is beyond my understanding. Are there templates out there for how to declare such a defcustom? How could I do this?


texts: string-rectangle: how to make input vary?

texts:
How can string-rectangle or C-xrt convert

aRandomText_-1
aRandomText_-1
aRandomText_-1
aRandomText_-1
aRandomText_-1
aRandomText_-1
aRandomText_-1
aRandomText_-1
aRandomText_-1
aRandomText_-1
aRandomText_-1
aRandomText_-1
aRandomText_-1
aRandomText_-1
aRandomText_-1
aRandomText_-1

into this?

aRandomText_0
aRandomText_1
aRandomText_2
aRandomText_3
aRandomText_4
aRandomText_5
aRandomText_6
aRandomText_7
aRandomText_8
aRandomText_9
aRandomText_10
aRandomText_11
aRandomText_12
aRandomText_13
aRandomText_14
aRandomText_15

One can write the above from scratch with eval-expression (M-:) and then (dotimes (i 16) (insert (format "aRandomText_%d\n" i))), but how can you do it on an existing (rectangle of) text?

Also, how can you do this when using letters?

aRandomText_a
aRandomText_b
aRandomText_c
etc.


texts:
I'm using flycheck to check my .tex sources but find that the syntax checking is too comprehensive. In particular, I'm interested in skipping syntax checking of certain environments such as code listings. So essentially, I'd need to some way to tell flycheck to ignore the contents of myEnv but check the rest of the document:

\begin{document}
 Some text.

 \begin{myEnv}
   env content
 \end{myEmv}

\end{document}

Perhaps an even better solution would be to allow one to use comments to manually mark regions that should be ignored:

\begin{document}
 Some text.

% [BEGIN_FLYCHECK_IGNORE]
\begin{myEnv}
   env content
\end{myEmv}
% [END_FLYCHECK_IGNORE]

\end{document}

This approach could potentially work in other modes that use different syntax for comments.

What is the best way to achieve this?


texts: How to hide "code actions" from lsp-ui sidebar?

texts:
Hi,
I want to hide "code actions" which is recommended by lsp-mode from lsp-ui sidebar.

How can I do for that?


texts: org-datetree: is it possible to insert a datetree at point without using org-capture?

texts:
I would like to manually create a orgmode file with date entries. Is it possible to do it without the org-capture template? Just at point?
Thanks!


texts: How to paste text that had been copied (alt-w) prior to my latest paste (ctrl-y)?

texts: Once I have selected some text I use Alt-w to copy the region and then use ctrl-y to paste it. Is there a way to paste something I have selected and copied with Alt-w prior to my latest paste?


texts:
I want to be able to jump to definition with control left click when editing c++ code. I tried

(define-key c++-mode-map [C-mouse-1] 'rtags-find-symbol-at-point)

This does not seem to work because emacs (24.5.1) already define a global behavior for C-mouse-1 (buffer navigation in graphical mode). The contextual window opens, but rtags-find-symbol-at-point is not called.
Any way to make this work ?


texts: Highlight useless whitespace at end of file

texts:
How do I make Emacs highlight whitespace at EOF, eg. any whitespace after >?\n for PHP?

I think the general rule would be:

  After the last non-whitespace character, accept one newline, then highlight all whitespace after.

I know about delete-trailing-whitespace, but I want to highlight, not delete.  A web search didn't provide any solutions. Is this not supported out of the box? My current settings are:

(global-whitespace-mode)
(setq whitespace-style '(face trailing lines tabs big-indent))


texts: Org-mode agenda: Show list of tasks done in the past, and not those clocked

texts:
Similar to this thread and this one, I want to show an agenda view with all items marked as "DONE" in the last two weeks, but without the lines Clocked: (1:00) DONE Some task (because for that I only care about the totals and use a clock-report dynamic block). I would also like to restrict to second-level items only.

I tried this code and succeeded in restricting to second-level headings only:

(add-to-list 'org-agenda-custom-commands
             '("W" "Weekly review"
               agenda ""
               ((org-agenda-span 'week)
                (org-agenda-start-on-weekday 1)
                (org-agenda-start-with-log-mode nil)
                (org-agenda-skip-function
                 '(org-agenda-skip-entry-if 'notregexp "^\\*\\* DONE "))
                 )))

If I set org-agenda-start-with-log-mode to t, then Clocked: ... lines show, e.g.:

Monday     30 September 2019 W40
  gtd:        10:49-10:59 Clocked:   (0:10) DONE some task
  gtd:        10:50...... Closed:     DONE Some other task

If I set it to nil, then Closed: ... lines do not show.

Also, if I set org-agenda-span to 14, to include the past 14 days, it shows 14 days starting from today.

How can I include only Closed: ... lines, and list tasks in the past?


texts: How do you automatically populate org-agenda-files?

texts:
I recently encountered this problem:
Emacs org-mode agenda filter doesn't work. :(
And sure enough, on macOS, I find that org-agenda-files is nil. The answer suggests setting the variable to a static list of filenames in .emacs.
However, on my Linux machine, this is unnecessary. I find that org-agenda-files will always be a list of whatever Org files I have open. I'm using the same .emacs on macOS as I am on Linux.
I have Emacs 26.2 on the Mac, and 26.1 on Linux.
How do I get org-mode on the Mac to auto-populate the org-agenda-files list like it does on Linux?


texts: How can I use Regexp to rename files in Dired mode?

texts:
I've have some videos (.mp4) with subtitles files (.SRT) that I need to rename. These files have long names so I can only rename them manually. I've tried Python to rename them, but it fails.
I've tried to rename it with Spacemacs and I did it using Dired SPC f j to open the folder and renamed the files going line by line: Select the line, go after the number of the video and then deleting till the dot of the extension, I created a simple macro that do this and then ran the macro on all the files in that folder.
I would like to do it with a regexp, so that I can also learn about it.
The folder looks like this in Dired:
total used in directory 477255 available 38636028
drwxrwxrwx  1 User None     28672 02-23 19:04 ..
drwxrwxrwx  1 User None      8192 02-23 19:02 .
-rw-rw-rw-  1 User None  30019832 02-23 13:13 010 Introduction to Global Economics.mp4
-rw-rw-rw-  1 User None      8514 02-23 13:13 010 Introduction to Global Economics-subtitle-en.srt
-rw-rw-rw-  1 User None    263198 02-23 13:13 011 BLS-Unemployment.pdf
-rw-rw-rw-  1 User None 108247504 02-23 13:13 011 The International Monetary Fund GDP.mp4
-rw-rw-rw-  1 User None     28101 02-23 13:14 011 The International Monetary Fund GDP-subtitle-en.srt
-rw-rw-rw-  1 User None  35996597 02-23 13:14 012 Excel Exercise 1 Analyzing IMF GDP Data.mp4
-rw-rw-rw-  1 User None     11454 02-23 12:17 012 Excel Exercise 1 Analyzing IMF GDP Data-subtitle-en.srt
-rw-rw-rw-  1 User None  37911096 02-23 13:15 012 Exercise-1.xlsx
-rw-rw-rw-  1 User None 104361394 02-23 13:15 013 Excel Exercise 1 Part 1 of 3.mp4
-rw-rw-rw-  1 User None     37892 02-23 13:11 013 Excel Exercise 1 Part 1 of 3-subtitle-en.srt
-rw-rw-rw-  1 User None  77650639 02-23 13:13 014 Excel Exercise 1 Part 2 of 3.mp4
-rw-rw-rw-  1 User None     32563 02-23 13:13 014 Excel Exercise 1 Part 2 of 3-subtitle-en.srt
-rw-rw-rw-  1 User None  94068512 02-23 13:14 015 Excel Exercise 1 Part 3 of 3.mp4
-rw-rw-rw-  1 User None     34325 02-23 13:14 015 Excel Exercise 1 Part 3 of 3-subtitle-en.srt

I want to rename the file: 010 Introduction to Global Economics.mp4 to 010.mp4 and 010 Introduction to Global Economics-subtitle-en.srt to 010.srt. Also, there are some other files that should not be renamed.
Till now, I tried this \b[0-9]\{3\}\b\( w*\)+.mp4 and it selects the .mp4 files, but how can I then tell it to keep the number of the video?
Edit:
All the videos and subtitle files number have always 3 digits, from 001 to 252.


texts: Find org babel header arguments documentation for shell language

texts:
The org manual specifies in the this link: https://orgmode.org/manual/Languages.html#Languages the language it supports (including shell). It mentions this:

Additional documentation for some languages is at
https://orgmode.org/worg/org-contrib/babel/languages.html

The above link points further this page: https://orgmode.org/worg/org-contrib/babel/languages/index.html
But unfortunately it doesn't have any documentation for the shell language.
What I'm looking is to see if I can change the working directory where it is executed. Something like this:
#+begin_src sh working-dir:/home/some_dir #working-dir doesn't work obviously.
ls
#+end_src

But I'm not able to find documentation on where to find the header arguments for a specific language.


texts: Go to a bookmark that is not visible currently due to narrowing

texts:
Running emacs 25.2.2 spacemacs 0.200.13.

In an org file, I have defined several bookmarks(SPC f b) under different headings. Consider this:

* H1
  Some text
  Bookmark 1
* H2
  Some text
  Bookmark 2

Suppose I am in H1 narrowed and I SPC f b Bookmark 2, nothing happens.

Similarly, if I am in another buffer and I jump to Bookmark 2 when the buffer is narrowed to H1, I just switch buffer!

How do I tell emacs to adjust narrowing such that the bookmarked location is visible?


texts: How to programmatically answer "yes" to those commands that prompt for a decision from the user?

texts:
I made a custom function that combines two functions of twittering-mode , twittering-favorite and twittering-native-retweet, however these two needs input from me by answering an yes or no question.

I want to know if there is a way to wrap those those two functions with something that will make them receive an answer without my direct intervention.


texts: How to display date in Julian in the mode line?

texts:
The following setting display the date in Gregorian calendar in the mode line.

(setq display-time-day-and-date t)
(display-time)

My question is how to change the above settings for date to be shown in the Julian calendar?


texts: How configure the confirmation minibuffer to use Enter, instead y?

texts:
When you want to do something, you get sometimes a confirmation prompt in the minibuffer, with pressing yes or no to proceed.

I'm aware that you could change this with typing y instead yes with the following setting.

(fset 'yes-or-no-p 'y-or-n-p)  ;; Ask for y/n instead of yes/no

I'm wondering if you could configure this in a way that he will accept RET as y?


texts:
Is there a solution to highlight current line and column where the cursor is now?

I tried this plugin, but then emacs motion are lagging like hell.

I was able to highlight the line

(global-hl-line-mode 1)


texts: Programmatically execute evil-ex move command

texts:
I'd like to execute an evil-ex command from another command. Specifically, I'd like to do :'<,'>move'>+1 but when I do, it doesn't quite do the right thing. Instead of moving the text down, it moves it one line from the top of the file.

Here's what I'm using:

(defun evil-visual-move-line-down ()
  (interactive)
  (evil-ex-call-command
   (evil-ex-range (evil-ex-line (evil-ex-marker "<") nil)
                  (evil-ex-line (evil-ex-marker ">") nil)) "move" "'>+1"))
(define-key evil-visual-state-map (kbd "J") 'evil-visual-move-line-down)


texts:
I have both eldoc and flycheck enabled in a .el buffer.  I have a line, eg:

(setq load-dirs (concat emacs-repos-dir "internal"))

Here, load-dirs is underlined by flycheck as an error, but if point is over load-dirs then eldoc will display the definition of 'setq' for about half a second before the flycheck message is printed.  How do I reduce this timeout?


texts:
According to the documentation, the following setting enables subscript only in
the form like ‘a_{b}’.

  (setq org-use-sub-superscripts nil)

However, in 'a_b', 'b' is still exported as subscript. How to export '_' as
underscore?


texts: How can i make org mode export latex file with a custom language?

texts:
I need romanian for my school reports, i want to write them in org mode.
Is there some #+LANG attribute? Do i need to set some emacs variables? I'd really like a per-file solution more


texts:
Last year I created a package for Melpa. I have updated it in my Gitlab repo, but I don't know how to make Melpa aware of that.
Thanks in advance for any tips on that.


texts: Is there any way to expand sub 'item'(not headline) tree cyclically?

texts:
In org-mode, is there any way to expand sub 'item'(not headline) tree cyclically? I tried hitting TAB(org-cycle), but it expands headline and all sub item tree showed at once.

Here is the example. Let's say I have an org file like below.

* h1
  - i1
    - i2
      - i3

What I want is the key stroke X to expand sub item tree like below.

Open the org file. ('|' indicate the cursor)

buffer shows:

* h1|...

Press X.

buffer shows:

* h1|
  - i1...

Press X.

buffer shows:

* h1|
  - i1
    - i2...

Press X.

buffer shows:

* h1|
  - i1
    - i2
      - i3

Press X

buffer shows:

* h1|...

Is there any key storke like X?

Thank you for reading this question.


texts: How to show tasks with deadlines only on their due date?

texts:
Here is what I mean:

The task with a deadline is displayed more than once in the agenda, which confuses me. How can I show this task in my agenda only once, under its due date?


texts: Automatically switch focus to new window

texts:
Is there a way to automatically switch focus to any new windows?

For example, if I C-h f some-function, that creates a new window. But the focus remains where I was, so when I'm done reading and hit q, I just type a q in whatever buffer I was in previously.

Ideally, I'd like to always switch focus to a new window whenever one is created.

Ideas?


texts: I'm very new to emacs and am currently using it to edit files on mac os x. How do I open instances of the shell from inside emacs so that I can execute the code I'm working on?


texts: Exclude/Separate diary and Packages buffer from tabbar group

texts:
I admit it, I use tabbar. It is a bit quirky but it works for me. There is just one thing I really tried very hard to solve but it was not possible. I think mainly because a lot of people don't use tabbar so there is not so much information out there.

Below is my tabbar config, the grouping was stolen from some other init.el but it is exactly what I need. The problem is that as soon as I click on diary (a user buffer without stars) or *Packages* buffer (an emacs-buffer) the tabbar disappears. I think this is because of the different nature of diary and *Packages* buffer. Now to solve this I would like the buffers to be excluded from the groups below or put in a separate group. I have no skill in coding, I tried my best but a solution is beyond me. I hope someone could help.

#+BEGIN_SRC emacs-lisp
(use-package tabbar
:ensure t
:config
(setq tabbar-buffer-groups-function 'tabbar-buffer-groups)
(setq tabbar-background-color "black")
(setq tabbar-use-images nil)
(tabbar-mwheel-mode -1)
(tabbar-mode)
(defun tabbar-buffer-groups ()
  "Return the list of group names the current buffer belongs to.
This function is a custom function for tabbar-mode's tabbar-buffer-groups.
This function group all buffers into 3 groups:
Those Dired, those user buffer, and those emacs buffer.
Emacs buffer are those starting with “*”."
  (list
   (cond
    ((string-equal "*" (substring (buffer-name) 0 1))
     "Emacs Buffer"
     )
    ((eq major-mode 'dired-mode)
     "Dired"
     )
    (t
     "User Buffer"
     )
    ))))
#+END_SRC


texts: Org mode - Copy cells from a remote org-table with shifted columns

texts:
I want to copy the values of a shifted range of cells from a remote table.
Example:

#+NAME: TBL1
| 1 | 2 | 3 | 4 |
|   |   |   |   |

#+NAME: TBL2
|   | 5 | 6 | 7 | 8 |
|   |   |   |   |   |

The table TBL1 should look like this in the end:

#+NAME: TBL1
| 1 | 2 | 3 | 4 |
| 5 | 6 | 7 | 8 |

I'm currently doing this with a dedicated function for each of 15+ cells, which makes the #+TBLFM: line super long and is not maintainable.
An efficient way to accomplish this is by using the lisp function identity:

#+NAME: TBL1
| 1 | 2 | 3 | 4 |
|   | 5 | 6 | 7 |
#+TBLFM: @2$1..@2$4='(identity remote(TBL2, @1$$#))

Problem is, that this function looks for values in the cells @1$1..@1$4. I want to shift the cells to look at to the right (@1$2..@1$5).
This has to be done via the REF value for the remote function, (@1$$#).
If I understand the syntax correctly, $$# is pointing to the current column of the cell which is going to be filled with the remote value (e.g. for cell @2$1 in TBL1, $$# becomes $1). So this has to be shifted to the right with something like $$#+1.

What is the correct reference for my example?


texts: Detecting variable changed outside customize

texts: I have used "Customize" to set a value for semantic-lex-c-preprocessor-symbol-file. However, after loading up .emacs, this isn't the value I see. On opening up the "Customize" menu for this variable, I see that its state is "Changed outside customize". How do I find it where this was changed? Also, what is the right way of customizing variables to avoid such issues?


texts: Advertise a binding for TeX-next-error in AucTeX

texts:
How can I advertise a binding for TeX-next-error in AucTeX?I
There are several bindings for next-error, normally C-x `, M-g n, M-g M-n. With

(put 'next-error :advertised-binding "\M-gn")

I will see M-g n in the Compile menu in Compilation mode, for example.

In AucTeX’s LaTeX mode I haven’t been able to change the advertised binding for the Next Error command in the Command menu, either with the same code, or by using TeX-next-error instead, which it really is bound to. How can I do this?


texts: Prevent helm from prompting to create a new buffer

texts:
If you visit a directory with helm-find-files and type the name of a file that doesn't exist, before opening it in a new buffer helm will prompt:

File does not exist, create buffer?

I would like helm to just create the buffer, without the prompt. I can't find an option for it to do this: essentially I want a variable just like ido-create-new-buffer.


texts: How to bind a key-chord to the `C-c` prefix?

texts:
I am using the package key-chord. This package allows me to hit x x quickly instead of hitting M-x:
(key-chord-define-global "xx" 'execute-extended-command)

And here is another way to to set a key-chord (code below is equivalent to the above):
(global-set-key (kbd "<key-chord> x x") 'counsel-M-x)

How can I set a key-chord for the C-c prefix?
This question and this post are not the same as mine as he is creating his own prefix, whereas a I just want to bind <key-chord> c c to C-c


texts:
I'm having issues with ragged or cutoff fonts in emacs with windows10.
It's especially noticeable when looking at the bullets in org-mode bullets which seem pixelated and off center. Specs:

Display 24" 1920x1080
scaling: 100%
Let windows try to fix apps so they're not blurry (ON/OFF does not make a difference).

Please help


texts:
Q: (how) can I get org timestamps to include time zones?

I'm working with colleagues who live in different time zones.
When we set up phone calls and appointments, we often do the
elaborate and error-prone "X o'clock your time, X-Y o'clock mine"
dance.

I'd like to be able to schedule (or set a deadline for) a call
with an explicit time zone (e.g., "X o'clock EST"), and then
let org mode worry about doing the mental math for me based on
the time zone I happen to be in at the time.

Can I get timezone-aware timestamps in org-mode, and how?


texts: How to rebind org key sequence e.g., (C-a a m)?

texts:
org-mode newbie question.

I want to invoke the org agenda command that matches a tag query. Currently it is bound to C-a a m.

I found the key sequence too long and wanted to bind it to a shorter one, e.g., H-m (I've been abusing Hyper key a lot recently). But couldn't find anyway to do that.

Firstly, I tried to find the function that does org tag match. Using C-h k to describe the key sequence doesn't work because it stops at C-a a to describe agenda command.

Then, I tried to capture it with a keyboard macro like

(fset 'my-search-org-by-tags "\C-cam")

Ideally it should ask me to enter the tag, but it didn't work that way. It seems to pick the first tag of current entry and shows the result. So question comes to how to make a kbd-macro sequence to be interactive.

But is that the right direction?


texts:
I'm using cask and I usually reinstall all my packages every other day. Lately I have noticed a lot of Bad request responses from ELPA. I have to retry a few times before all the packages get fetched.

This is not a bug in Emacs-the-application, so the report-emacs-bug command seems like the wrong interface. Instead, I want to report a bug about the ELPA service.

Is there a way I can submit some kind of feedback to GNU ELPA about this?


texts: make statistics of the tag use in org mode

texts:
I want to create a list how many times one tag use.
It will make me decide which one to put in org-tag-persistent-alist

The data used can be obtained from org-agenda-files or a specified file. Is there any emacs function to do that? Thank you very much.


texts: I just installed Emacs 25.2 on my computer, but I can not access its manual. when I press C-h r this screen  opens which lacks any links related to the Emacs manual. Futhermore, the echo area displays the message Info file emacs does not exist. How do I debug and/or fix this?


texts: Ignore .folder inside projectile project

texts:
In spacemacs, I want SPC p f to ignore one directory in the files it suggests. I followed the Projectile docs for ignoring files. I added a line to both my ~/.emacs.d/.projectile file and the .projectile file in the root of the project. None of the following seem to work for ignoring a folder:

-.folder
-.folder/**
-**/.folder
-.folder/**/*

(note that the folder to ignore does have a . in its name)

Am I missing some reindex command? I tried SPC p I which did something, but didn't fix this problem. Closing and opening Emacs did nothing.


texts: What is #'eq and how does it differ from 'eq

texts:
I've seen a few snippets of code where symbols were prepended by #' instead '. like the following snippet

(seq-count #'not (seq-mapn #'eq seq1 seq2))

What is the difference and why couldn't I just use ' instead of #'?


texts:
I often need to swap s-expressions. How can I do that with paredit? I want to do things like the following:

(list |1 0)
(list 0 |1)

or:

(list 1 |0)
(list |0 1)


texts: How to set a variable that matches different type of strings?

texts:
I have these strings:

First Type:

arXiv:1234.56789
arXiv:1234.56789v1

Second type:

hep-th/123456789
hep-th.AB/12345689
hep-th/123456789v1
hep-th.AB/12345689

Belong to the second type even strings with no "-" in their names, such as math/123456789 or CoRR/123456789.

I have to do some "search and replace" on all these strings, so I would like to define a variable ARXIV that matches all of these strings. So, I have defined:

;; arXiv:1234.56789vK
(setq ARXIV-A "arXiv:\\([0-9]+\\)\\.\\([0-9]+\\)\\(v[0-9]+\\)?")

;; hep-th/1234567vK
;; math.XX/1234567vK
(setq ARXIV-NA "\\(astro-ph\\|cond-mat\\|gr-qc\\|hep-ex\\|hep-lat\\|hep-ph\\|hep-th\\|math-ph\\|nlin\\|nucl-ex\\|nucl-th\\|physics\\|quant-ph\\|math\\|CoRR\\|q-bio\\|q-fin\\|stat\\|eess\\|econ\\)\\(\\.[A-Z]+\\)?/\\([0-9]+\\)\\(v[0-9]+\\)?")

(setq ARXIV (concat "\\("
                    ARXIV-A
                    "\\|"
                    ARXIV-NA
                    "\\)"))

Test

---------- Buffer: foo ----------
-!-[arXiv:1234.56789]
[arXiv:1234.56789v1]
[hep-th/123456]
[hep-th.QA/123456]
[quant-ph.QA/123456]
[hep-th/123456v12]
---------- Buffer: foo ----------

(perform-replace (concat "\\(\\[\\)?"
                          ARXIV
                          "\\(\\]\\)?")
                 "\\1 BEG \\2 END \\3" t t nil 1 nil (point-min) (point-max))

---------- Buffer: foo ----------
[ BEG arXiv:1234.56789 END 1234
[ BEG arXiv:1234.56789 END 1234
[ BEG arXiv:1234.56789v1 END 1234
[ BEG hep-th/123456 END
[ BEG hep-th.QA/123456 END
[ BEG quant-ph.QA/123456 END
[ BEG hep-th/123456v12 END
hep-th/123456
---------- Buffer: foo ----------

The problem is that \\3 does not correspond to \\(\\]\\)? seeing as how ARXIV-A and ARXIV-NA do not have (always) the same length, I think.

I have tried different configurations of my variables, but the problem is always the same: in replacement code \digit does not work as I was expecting after ARXIV. Indeed,

(perform-replace (concat "\\(\\[\\)"
                          ARXIV
                          "\\(\\]\\)")
                 "\\2" t t nil 1 nil (point-min) (point-max))

works as I was expecting (groups are useless here, but this is only an example to clear better my question).

Is there a way to do this "search and replacement" with only one variable?

P.S. Any better idea to entitle my question is welcome!


texts:
I have two files A.java (base class) and B.java (class). The class B succeed A. In file B.java, I compiled by C-c C-v C-c, then it can not detect file A.java with error message:

cannot find symbol

But it works well in compiling manually in terminal.

Also, when I try debugging in JDE, I only get:

cd: No such directory found via CDPATH environment variable in mini buffer.

I guess it is a path problem. I do not know how to fix this.


texts:
I use Emacs to write LISP and Python code. I have tried NetBeans and Eclipse before, which had the advantage of parsing the buffer and highlighting problems, e.g. if one function or symbol is not defined.
Is such syntax highlighting of errors and warnings possible in Emacs?


texts: Is there a way to make tags work well with line wrapping in emacs org mode?

texts:
If the buffer is too narrow, if I make a tag for a heading, the amount of whitespace before the tag causes the tag to wrap past the end of the line onto a new line (I have visual-line-mode turned on). This makes it difficult to skim and read the headlines, and wastes vertical screen real-estate.

I think ideally the tag would always display as right aligned, regardless of the true number of spaces. Is there a way to do that? If not, is there some other way of avoiding the wasted space?


texts: How to provide keyboard input programmatically for org-export-dispatch UI in elisp?

texts:
The org-export-dispatch command in org-mode (C-c C-e) brings up an UI from which one can, e.g. select l and l to export the .org file to latex format.

My question is:

Can one use elisp to fix the input to l and l programmatically in order to get the exported (latex) file without any keyboard interaction?

If so, what would the expression/command be?

This is with Emacs 26 under Ubuntu 20.04. I read this article but just don't know elisp enough to understand its workings.


texts: Ipython console on emacs like Spyder IDE

texts:
I am use Python sympy on IDE Spyder and the equations are shown on console, but in Emacs the equations are shown in another windows with ImageMagick.
I want configure my Emacs like Spyder the show sympy equations directly on console.
In the IDE Spyder, the equation renderized are view like that

I think that logic way to solve this problem it is run Qtconsole directly embedded on Emacs, but I do not find way to make this.
I hope fixed this problem,Thanks!


texts:
My .emacs file includes a line I presumably added ages ago

(require 'some-random-package)

I haven't actually been able to learn anything about the package.

My load-path is quite complicated (it takes up about a screenful) so a manual solution digging through the load path isn't ideal.

I'm aware emacs' rules for loading a package are to look through the directories in the load path for foo.elc and foo. How can I find where the package came from?


texts:
I want to copy just one character underneath the cursor. Its not ascii, so I can't type it. Is there a function or key that allows for this?
Vanilla emacs welcome, though evil and spacemacs answers are also acceptable.


texts: How to open org files with some, but not all headings expanded?

texts:
I have an org file which looks like this:
* Chores
#:PROPERTIES:
#:VISIBILTY: showall
#:END:
# STARTUP: showeverything # no + so this does nothing right now
** NEXT Brush Teeth in Day
   SCHEDULED: <2020-10-22 Thu +1d>
** NEXT Brush & Floss Teeth at Night
   SCHEDULED: <2020-10-21 Wed +1d>
* Math...
* English...
* Geology...

What I want is open up my file, and immediately see "Chores" ' direct children expanded (everything underneath Chores is also fine I guess).
Right now when I open up the org file, I get everything collapsed. How can I see just some headings immediately expanded? I looked at some other questions on this StackExchange community but I didn't find my answer.
In the manual, I found something close to what I'm looking for: Initial Visibility. This mentions one of the STARTUP options that you can have, where you have these possible options:
#+STARTUP: overview
#+STARTUP: content
#+STARTUP: showall
#+STARTUP: showeverything

I tried to set this option underneath the "Chores" heading to set it locally, but that expanded all the headings instead of just "Chores". I tried also to set the VISIBILITY property mentioned in the manual entry, but that does not seem to have any effect at all.
Is there a way that I can achieve this behaviour?


texts: Mark a local variable safe for any value

texts: The variable safe-local-variable-values can store name/value pairs that are safe as file-local or directory-local. However sometimes I want to say any value is valid for a given variable. The manual page I linked to says that any integer value is considered safe for fill-column. Is there a way to do this for my own variables?


texts: Display custom org-entities as UTF-8 characters

texts:
I've recently added some custom entries to my org-entities-user (below), but they do not display as UTF-8 characters, even with org-toggle-pretty-entities on. Is it because they are more than one UTF-8 character long? Any ideas how to change this behaviour?

(setq org-entities-user
      '(("dO" "\\(\\delta^{18}\\)O" nil "&delta;18O" "δ18O" "δ18O" "δ¹⁸O")
        ("eO" "\\({}^{18}\\)O" nil "18O" "18O" "18O" "¹⁸O")
        ("dC" "\\(\\delta^{13}\\)C" nil "&delta;13O" "δ13C" "δ¹³C" "δ¹³C")
        ("tC" "\\({}^{13}\\)C" nil "13C" "13C" "¹³C" "¹³O")
        ("COt" "CO\\(_{2}\\)" nil "CO2" "CO2" "CO₂" "CO₂")
        ("D" "\\Delta_{47}" t "&Delta;47" "Δ47" "Δ47" "Δ₄₇")
        ("celsius" "\\(^{\\circ}\\)C" nil "&deg;C" "°C" "°C" "°C")
        ;; unit space, something like 15\us{}Ma
        ("us" "\\," nil "&nbsp;" " " " " " ")
        ("appr" "\\sim" t "&tilde;" "~" "~" "~")
        ;; for gps-coordinates
        ("degree" "^{\\circ}" t "&deg;" "°" "°" "°")
        ("arcminute" "^{'}" t "&prime;" "'" "′" "′")
        ("arcsecond" "^{''}" t "&Prime;" "\"" "″" "″")
        ))


texts: Changing evil-forward-word behavior by modifying a syntax table

texts:
Currently in Emacs Lisp files I have the following behavior when I run evil-forward-word-begin

|some-lisp-function
some|-lisp-function
some-|lisp-function
some-lisp|-function
some-lisp-|function

In other words, dash is treated as it's own word.

I'd like it to be this way:

|some-lisp-function
some-|lisp-function
some-lisp-|function

Under syntax table dash is listed as a symbol, so I fugired if I changed dash to whitespace in the syntax table, it would be skipped:

(modify-syntax-entry ?- " ")

However that accomplished nothing. What am I doing wrong?


texts: How to open a file in another window by clicking on a file in my window manager?

texts:
When I double click to open a file, a new Emacs session is launched, like this:

So now there are two sessions. What I want to do is that when I double click a file, it will be opened in another window in the existing session, so there is only one session. I know I can use C-x C-f to open a file, but the point is "double click".
I am using emacs 25.1.1, linuxmint 18.1. How can I do this?


texts: Define a customizable (defcustom) key binding

texts:
I want to allow the user to redefine key bindings for the interactive commands in a major mode. I tried putting them in strings, but I can't get the customized variable value in my mode-map. Here's what I tried:

In the init file:

(require 'myfeature)

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(myfeature-kb-configure "C-c C-u"))

In myfeature.el:

(defcustom myfeature-kb-configure "C-c C-p"
  "Plop."
  :type 'string
  :group 'myfeature-mode-keyboard-shortcuts)

(defvar myfeature-mode-map
   (let ((map (make-sparse-keymap)))
     (define-key map (kbd myfeature-kb-configure) 'myfeature-conf) ; => "C-c C-p"
     map)
   "Keymap for `myfeature-mode'.")

;;;###autoload
(define-derived-mode myfeature-mode prog-mode "myfeature"
"Myfeature mode"
  (kill-all-local-variables)
  (message "key: %s" myfeature-kb-configure) ; => "C-c C-u"
  (use-local-map myfeature-mode-map)
  (run-hooks 'change-major-mode-after-body-hook 'after-change-major-mode-hook))

(provide 'myfeature)

Apparently, I'm defining myfeature-mode-map too early for the mode to pick up the "customized" value ; I get the old value, C-c C-p in the mode-map, because anywhere else in the file (including in the mode definition) I get the customized value. How can I ensure that the customized value gets read every time?

Nota bene:

Ideally, I would present to the user a menu with a fixed list (choice) of my  commands and a field next to it to input proper key bindings (not string), already properly filled with default values so he/she would understand right away what to do, but I don't know how to do that, and found no example of such a marvel.


texts: how to supply universal-argument (C-u) to a function call inside a binding statement

texts:
I have this on my init.el

;; magit status
(define-key evil-motion-state-map "gs" 'magit-status)

But I would like to have another binding, for C-u M-x magit-status (C-u is the universal-argument)

Something like (which obviously does not work):

;; magit status
(define-key evil-motion-state-map "ga" 'C-u magit-status)

rationale: with C-u M-x magit-status, magit allows you to supply a directory where a git repo resides, so you do not have to have an opened file that resides inside the git repo where you want to perform git actions.


texts: Issue with face heading for certain todo keyword in orgmode

texts:
When I define todo keywords relative to "done" states, the formatting of the heading disappear as below

Where should I start to look ?