texts:
Is it available a mode that, entering a source file, scans it to find all the function, class and methods declarations and eventually install a menu that enables jumping around in the source file?

I used to use fume-mode (?) where fume is for function menu, but I haven't seen it in the list of installable packages...


texts:
I want to take a literate programming approach to managing my library of code snippets with org-babel.

I have a ~/Code folder which I use to save various org-mode documents, each of which contains a number of library functions, embedded in org-babel code blocks.

My question is, how can I now #include or (require ') these functions in subsequent org-mode documents?


texts: How to customize Helm buffers' mode-line

texts:
I'm trying to customize Helm buffers' mode-line.

I have set mode-line-format with powerline package:

(setq-default
 mode-line-format
 '("%e"
   (:eval
    (let* ((active (powerline-selected-window-active))

           ;; Conditionnal faces (in function of `active')
           ...

           ;; Left elements
           (lhs ...)

           ;; Right elements
           (rhs ...))

      ;; Build the result
      (concat
       (powerline-render lhs)
       (powerline-fill mode-line-3-face (powerline-width rhs))
       (powerline-render rhs))))))

From what I understand from helm-mode-line-string's documentation:

  Help string displayed in mode-line in helm'. It can be a string or a list of two args, in this case, first arg is a string that will be used as name for candidates number, second arg any string to display in mode line. If nil, use defaultmode-line-format'.

I should be able to have my customized mode-line everywhere (in every buffers) with:

(setq-default helm-mode-line-string nil)

Isn't this line from helm.el supposed to do exactly what I want?

(setq mode-line-format (default-value 'mode-line-format))

Edit

Works as intended with: helm-colors, helm-projectile-ag, helm-projectile-grep.

But not with: helm-M-x, helm-projectile-find-file, helm-projectile-switch-project.


texts: monitor commands from gud/gdb command line not showing output

texts:
In a plain terminal, I can run gdb, connect to gdb server via 'target remote :nnnn` and then use the 'monitor' command to send commands to the remote app, and the results from running those commands on the remote app are displayed at the gdb command line.
Under gud/gdb, if I type the same 'monitor xxx' command, the results of the command, if the command has output, do not get echoed on the gud comint command line. The monitor interface does work -- I can send output-less monitor commands and observe that they are followed. The issue is that if the remote command has output, it does not make its way all the way back to the gud command line.
I can create a rudimentary workaround, printing each line to the Messages buffer, with code such as:
(defun gts-gud-gdb-mon (mon-command)
  "send command as monitor command, collect output"
  (interactive "MMonitor command: ")
  (let* ((gdb-command (format "monitor %s" mon-command))
     (out-lines (gud-gdb-run-command-fetch-lines gdb-command gud-comint-buffer)))
    (dolist (l out-lines)
      (message (format "monitor output line: %s." l)))))

But I would like to either (1) be able to type 'monitor xxxx' and see multiple lines of output at the gud command line, or (2) have a new window, "monitor", that echos the result of any monitor commands.
How can I see the output of 'monitor' commands within gud?


texts: How to disable show-trailing-whitespace in emacs shell?

texts: I have set show-trailing-whitespace as default in my .emacs file but I don't want it to work on shell and some specific buffer. I can disable it manually every time I open an emacs shell but I want more of a permanent solution. How can I do that?


texts:
Windows 10, Emacs 25.1, Magit

If I want to add exist git repo to Magit I add it in variable magit-repository-directories

OK.
But if I have about 20 git repo?
I wan't add it manutaly to Magit. Is it possible Magit to do something like autoscan all git repositories?


texts: speedbar sr-speedbar flush cache and full expand current buffer when saving it

texts:
I'm using sr-speedbar.
I would like it to automatically full expand current file buffer, and update the bar content when I save the current buffer.
I tried something like : (add-hook 'after-save-hook 'speedbar-flush-expand-line) in my init file but it does not work since my cursor is in my file buffer window.
The point is to have tags of file buffer always displayed and up to date with file content on disk.


texts: Calculating with timestamps in org-mode tables


texts:
Emacs 26.1. Windows 10

In buffer I has text like this:

    3333333
    1111111
    $PAC_LTC
    1337_BTC
    1337_LTC
    404_BTC
    42_BTC
    222222
    42_LTC
    808_ETH
    8BIT_BTC
    8BIT_BTC
    8BIT_BTC
    8BIT_DOGE
    8BIT_ETH
    8BIT_LTC
    ACC_DOGE
    ACC_USDT
    ACC_USDT
    ADC_DOGE
    ADC_DOGE
    ADC_DOGE
    ADC_ETH
    ADC_USDT
    8BIT_USDT
    8BIT_USDT
    42_ETH

I need to keep only duplicate lines.
The result must be like this:

8BIT_BTC
8BIT_BTC
8BIT_BTC
8BIT_USDT
8BIT_USDT
ACC_USDT
ACC_USDT
ADC_DOGE
ADC_DOGE
ADC_DOGE

P.S. I try by this command: delete-non-matching-lines

But after press Enter whole text delete from buffer.


texts: Generate a new table out of old one with sorting

texts:
Here is a table where scores are calculated at last row with a formula. How to generate a new table TotalResults with 1 and last columns? Can we even sort the last column in the process?
#+TBLNAME: ScoreCard
| team | 1st round | 2nd round | total |
|------+-----------+-----------+-------|
| A    |         7 |         9 |    16 |
| B    |         3 |         5 |    8 |
#+TBLFM: $4=vsum($2..$3)

Like this one
#+TBLNAME: ScoreCard
| team | total |
|------+-------|
| B    |     8 |
| A    |    16 |


texts: Single function to return file contents as a string

texts:
I'm wondering if there's a terse (i.e. single function) approach for reading a file's content given its path and returning it as a string.

My go-to has been:

(with-temp-buffer
  (insert-file-contents some-path)
  (buffer-string))
  => "it's a short file"

but a helper function defined per project or this two-functions-and-a-macro copy-pasta seem unnecessary.  Is there a utility function or common pattern I'm missing?

Judging from the existence of gntp-file-string, ffap-file-exists-string, org-file-contents, and a few others I'm guessing there is not.


texts: zsh EXTENDED_HISTORY corrupts shell-mode history

texts:
I use zsh with the EXTENDED_HISTORY option, which makes it so that in the shell history timestamps are stored which is useful for going back and diagnosing how you screwed up production. I'm trying to transition to using emacs for my terminal with shell-mode, but when I try to browse my previous commands they come up like this:

: 1423012245:0;ls

The first number is the timestamp, and the second number is the number of seconds the command took. This is exactly how the command looks in the history file too, but zsh is smart enough to filter it out when you press up to browse your previous commands in the real shell. So it appears that comint mode tries to read the history file separately, and doesn't know about the timestamp format.

How do I get shell-mode to ignore the timestamps while keeping the option on?


texts:
I ran a command and received a warning in the minibuffer.

The exact warning was comint-completion-at-point failed to return valid completion data, after I autocompleted a command in shell-mode.

How can I determine the elisp origin of the warning?


texts: How to place a box around a piece of text in Org mode

texts:
Whenever, I export my org-documents to html, I notice that by default,
my source code snippets get placed inside a box, which is good. I don't see the same behavior when I export my org documents as pdfs via latex.

So given a paragraph of text, not necessarily source code, how would I place a box around the text.

So I would imagine the solution would look like

#+BEGIN_BOX -- how to do this? Any other solution also will do

The quick brown dog jumped over the lazy fox.
#+BEGIN_SRC python
 print "Hello World"
#+END_SRC

#+END_BOX

Creates a box around the text and source code after exporting.


texts: Division sometimes breaks syntax highlighting in ruby-mode

texts:
Interesting bug in ruby-mode. When a variable called index is followed by a slash /, syntax highlighting breaks.

Here's a screenshot to show you what I mean:

I'm not really sure how to file a ticket on the ruby-mode repo since I've never used SVN. Anyone know where to go from here?


texts: Break key as a shortcut -- what am I doing wrong?

texts:
I would like to define a keyboard shortcut in my .emacs file so that the Break (a.k.a. Pause) key does a C-x C-s C-x C-c. As a warmup, I thought I would try something simpler, so as a test I did this, which seemed almost identical to examples I found by googling:
(global-set-key [C-r] 'next-line)

This doesn't actually work. Control-r is still bound to something else.
For my actual intended mapping, I was imagining something like this:
(global-set-key [pause] ('save-buffer 'save-buffer-kill-terminal))

But I haven't attempted this yet because I couldn't even get the simpler example to work.
How does one find out what name Rmacs gives to a key such as the one labeled Pause/Break on my keyboard? Are the square brackets a lisp thing, or are they just interpreted as literal characters? Is this different from using angle brackets or the kbd function?


texts: How can I use 'emacsclient' as $PAGER in eshell with pipe? or any better PAGER which works well with eshell?

texts:
When I typed git diff in eshell, it has weird attribute such like print : in every single line, cannot scroll back, and so on.

I think this is because the default eshell env PAGER is set as less, and I checked with typing echo $PAGER which returns a result, less.

So, as I wrote (setenv "VISUAL" "emacsclient") in my init.el, I added (setenv "PAGER" "emacsclient") line. However, it failed and I found that emacsclient doesn't support pipe, which means echo aaaa | emacsclient ended with an error. and I heard about magit, but I don't think it is a general solution.

Is there any solution to set $PAGER to work properly with eshell?

or How can I make emacsclient to support pipe in eshell?


texts: Get how many times a task has been rescheduled

texts:
I'm trying to get how many times a task has been re-scheduled (the Sched.00x: you see in org-agenda for "today tasks"). But so far, I don't know how to extract information from the structure returned by org-agenda-get-day-entries.

My original plan was to regexp the hell out of the title, since it carries the information I'm looking, but I don't even know how to obtain from the data structure for the title of the entry. It doesn't seems like the number of times an entry was re-scheduled comes within the data structure.

This is my current code:

(let* ((files (org-agenda-files))
         (due-todos 0)
         (due-older 0)
         (today (calendar-current-date)))
    (dolist (file files)
      (let* ((entries (org-agenda-get-day-entries file today :scheduled :deadline)))
        (dolist (entry entries)
          ;; Get how many times the task was re-scheduled, and count it
          ))))


texts: How do I encourage Emacs to follow the output of the SQL-buffer?

texts:
This issue might be related.

I have a SQL process viewed in a buffer in a frame.

When I send SQL-statements from another window in frame to the SQL-process in the another frame, I have to scroll my SQL buffer to see the details of output. When I'm in an another buffer,  emacs stops "following" the SQL buffer, i.e., scrolling to automatically display new output.

Any idea how I can "reattach" or encourage Emacs to follow the SQL buffer?

UPDATE: As noted in the replies below, you can set up Emacs to follow the tail of the output again, with to set up the point to the end of the buffer with M->


texts: custom delete-backward-char key-binding does not work in helm

texts:
I use C-h instead of backspace, and it does not work in helm's minibuffer, however it works in normal minibuffer.

The related section from my init.el

(global-unset-key (kbd "<backspace>"))
(global-unset-key (kbd "C-h"))
(global-set-key (kbd "C-h") 'delete-backward-char)
(global-unset-key (kbd "<f1>"))
(global-set-key (kbd "<f1>") help-map)
(global-unset-key (kbd "M-h"))
(global-set-key (kbd "s-h") 'mark-paragraph)
(global-set-key (kbd "M-h") 'backward-kill-word)


texts: I would like to sign a pdf file using epa from within emacs using the --clearsign option from gpg. Is this possible? epa-sign-file creates an armor file, so I assume that it needs to be tweaked slightly to use the --clearsign option instead. Thank you in advance.


texts: library for code execution for markdown via org-babel

texts:
Are there any libraries out there that can take the markdown code fence block and execute it via org babel? Ie, something like
'''js
var a = 1
var b = 2

return a + b
'''

Reasoning:
I don't see not too much difference between a #+BEGIN_SRC .... #+END_SRC block and a '''...'''  block. I know that it's ultimately possible to be able to convert back and forth between a markdown file and an org file (via pandoc) but I'd like to have the code execution functionality of org-babel within a markdown file. I'm wondering if anyone has extracted that functionality from org-babel and if not, maybe a guide to how to go about it.


texts:
I'm not entirely sure what the problem is. I'm using the same version of Emacs on three different computers ( laptop, work, home ), and the problem only shows up on one machine ( the home machine ).

Basically, when I'm using Emacs ( 24.4, compiled from downloaded tar.gz ) Emacs seems to take quite a while to do any sort of vertical rendering. Scrolling, finding a file ( using a custom ido vertical mode ), helm... anything that requires Emacs to render vertically seems to slow down Emacs.

It doesn't seem to have to do anything with how many lines are in the current buffer, the slow-down happens even in the scratch buffer.

I've also tried starting with emacs -Q, and it still happens.

Oddly, it's CPU/memory usage stays pretty low while this rendering is happening.

I took a video of the weirdness, just in case my description wasn't super clear.


texts: Get yasnippets out of company completions list in lsp-mode

texts:
Using company-mode and yasnippet, when I tab, I can see my snippets in the drop down menu.
I'd like to not see them, and I'm not sure what variables to check out to make it so.
I looked through company's customization options, and there aren't any yasnippet related ones.
I saw this post,
Get Company to show suggestions for Yasnippet names
and tried copy pasting it into my config, and changing
(defvar company-mode/enable-yas t
to
(defvar company-mode/enable-yas nil, to no avail.
I'm getting pretty close with this:
(set (make-local-variable 'company-backends)
  '((company-bbdb company-semantic company-cmake company-capf company-clang company-files
)))

which drops some stuff from what company's default backends were, still trying to figure out which of these is puttin snippets in.
....
Okay, so what I've figured out is that company-capf is the culprit of...all the completions I'm getting in lsp-mode. So I can't just pluck it out and take the yasnippet completions with it, unless I want NO completions at all.
This seems like an issue for the lsp-mode team, so I'm going to drop them an issue now.


texts: So this is probably a weird question but out of muscle memory I tend to save files constantly. This becomes a slight inconvenience when I have a compilation buffer then accidentally save that. I was wondering if there was a way to disable saving a file or something for buffers like this. Thanks.


texts: How to prompt to save the modified buffer before switching?

texts:
Vim prompts to save the buffer before switching if no other window is holding it. In other words, it prompts to save the buffer before putting it in background. How can I get the same behavior in Emacs?
A related question is about automatically saving the buffer.


texts: Bulk convert text under heading to individual sub-headings?

texts:
I have this in an org-mode buffer
* Synonyms

culture
discipline
improvement
information
learning
literacy
scholarship

and would like to simply highlight this list starting with culture and ending with scholarship and turn them all into sub-headings directly under Synonyms. Is this possible, already a feature? I realize I can put the cursor in front of each entry and hit M-Enter, but is a bulk way possible?


texts: Start Process Not Working: Process List Claims Process Started but Process UI not shown

texts:
Start Process is not working when starting GUI application in WSL on Windows 10 Pro.
I am calling Start Process as follows.
(start-process
 "yekneb-exec-2" nil
 "/mnt/c/WINDOWS/explorer.exe" "\\\\wsl$\\Ubuntu\\home\\bkey1\\.emacs.d\\yekneb")

According to the Process List this is starting a process but the UI is not being displayed.


texts:
I would like to make sure I know where I am fetching, pulling, and pushing to.
How to view remote URLs in magit?

From the magit manual "7.1.1 The Remote Popup" on https://magit.vc/manual/magit/The-Remote-Popup.html

M C     (magit-remote-config-popup)
        This command shows remote related variables in a separate popup.

The magit 'M' menu does not list 'C'.  Apparently the magit manual is not up to date.

A similar question was posted on Magit equivalent for "git remote -v" (list remotes)


texts: sct-dot fails on updated simple-call-tree

texts:
sct-dot is convenient for visualizing relationships by graphviz(dot) among functions in programs.

EmacsWiki: Simple Call Tree

Unfortunately, since simple-call-tree has updated from 20150806.1133 to 20151116.802 on melpa, sct-dot does not work.

Are the any work arounds?


texts: in org-mode, how to delay the display of SOME scheduled tasks until the day of?

texts:
I'd like to delay the display of some of my scheduled tasks until the day of. But for other scheduled tasks, I'd like them to display a couple days in advance as per default.

From the manual:

  If you want to delay the display of this task in the agenda, use SCHEDULED: <2004-12-25 Sat -2d>: the task is still scheduled on the 25th but will appear two days later. In case the task contains a repeater, the delay is considered to affect all occurrences; if you want the delay to only affect the first scheduled occurrence of the task, use --2d instead. See org-scheduled-delay-days and org-agenda-skip-scheduled-delay-if-deadline for details on how to control this globally or per agenda.

So that's a way to delay the display of tasks in the agenda until two days AFTER the scheduled task. But I want certain tasks to display the day they occur but not before.

I tried SCHEDULED: <2015-09-13 Sun -0d> but that didn't work... how do I ask Emacs to delay the display of certain scheduled tasks, specifying on a per-task basis?

UPDATE: Here's what my org-agenda looks like:

Below are the contents of my org-mode file (or see the actual org file here).

* dailies - week of <2015-09-14 Mon>
*** COMMITTED <2015-09-16 Wed> [0%]
***** TODO meditate
        SCHEDULED: <2015-09-16 Wed>
***** TODO morning pages
      SCHEDULED: <2015-09-16 Wed>

*** COMMITTED <2015-09-17 Thu> [0%]
***** TODO wake up 8:30am
      SCHEDULED: <2015-09-17 Thu 8:30am>
***** TODO blue light therapy
      SCHEDULED: <2015-09-17 Thu 8:31am>
***** TODO meditate
      SCHEDULED: <2015-09-17 Thu>
***** TODO morning pages
      SCHEDULED: <2015-09-17 Thu>
***** TODO lights out by 12:30am
      SCHEDULED: <2015-09-17 Thu 11:59pm>

*** COMMITTED <2015-09-18 Fri> [0%]
***** TODO wake up 8:30am
      SCHEDULED: <2015-09-18 Fri 8:30am>
***** TODO blue light therapy
      SCHEDULED: <2015-09-18 Fri 8:31am>
***** TODO meditate
      SCHEDULED: <2015-09-18 Fri>
***** TODO morning pages
      SCHEDULED: <2015-09-18 Fri>
***** TODO lights out by 12:30am
      SCHEDULED: <2015-09-18 Fri 11:59pm>

BTW, results of C-h v RET org-scheduled-delay-days:

org-scheduled-delay-days is a variable defined in `org.el'.
Its value is 0

In my .emacs:

(setq org-todo-keywords
  '(
    (sequence "TODO" "STARTED" "|" "DONE! :-)")
    (sequence "MISSED" "|" "DONE! :-)")
    (sequence "COMMITTED" "RESULTS" "|")
(sequence "WAITING" "DAILIES" "WEEKLIES" "MONTHLIES" "QUARTERLIES" "YEARLIES" "GOALS" "SOMEDAY" "|")
    ))

What am I doing wrong and how do I fix it?


texts:
Running emacs 25.2.2 on Kubuntu 17.10.

I have an Org mode file that is mostly in English but certain headlines contain text in Devanagari.

From Options -> Set Default Font, I have chosen Hack 13 size as my default font.

But Hack is not a good font to display Devanagari characters.

So, when I want to edit contents of those headlines, I narrow the buffer to that region using C-x n s and using C-x C-e, evaluate the following command which is part of the headline:

(face-remap-add-relative 'default :family "Lohit Devanagari")

But that still changes the font for the entire buffer when I widen using C-x n w.

How do I achieve the behavior that I intend? Change the font back to the default when I widen?


texts: Replace "ﬂ"like two-letter combo with two letters

texts:
I have a text file, whose content is from a pdf file.

I would like to replace two letter combos, such as "ﬂ" and more, with the two letters.

Is it possible to do that in Emacs just once, without repeating for each specific combo?

Thanks.


texts: Is there a function for removing trailing spaces in a buffer?

texts: Does emacs have a built in function for removing trailing spaces in a buffer?  I want to remove trailing whitespace at the end of all the lines in a buffer.


texts: `C-c C-c` compilation stopped working in SLIME but works if manually typed, how to fix it?

texts:
I am new to Emacs and Slime. I have been using both of them daily for the last 10 days. And it is amazing! I am impressed.
Today, I decided to install and try the package Paredit. Not sure if this is a coincidence, but after a while, Slime stopped working as it used to.
I was using C-c C-c all the time to compile specific Common Lisp functions. Now, it does not work.
Even with slime running after pressing M-x slime I get from the mini-buffer:
C-c C-c is undefined

If I try a stronger compilation with C-c C-k the keyboard also does not work.
However, the compilation works if I manually compile the region or the whole file after typing on the mini-buffer:
M-x slime-compile-region

M-x slime-compile-and-load

Before writing this, even the manual typed compilation was not working. Suddenly, it started to work again. But the keyboard shortcut is not back.
I do not really understand this behavior from emacs/slime.
This is my current config file.
Why is this happening? Did I break something after installing Paredit?
What should I inspect to understand why the famous commands (C-c C-c and C-c C-k) suddenly stopped working?
Thanks for your attention.


texts:
A pretty basic Helm question.  What is the Helm window/command/feature that lets us search for text (preferably using regexp) within any type of buffer (i.e., including read-only such as w3m)?

In other words, I'm looking for Helm's equivalent of Emacs' native commands for isearch-forward (C-s) / isearch-backward (C-r).

To illustrate: after invoking one of the native isearch commands (C-s or C-r), we can exit search mode in one of two ways:

we can exit and return to original point (via C-g), or
we can exit and continue browsing buffer from current point i.e., from the
currently-matched text (via RET among others).

I'm looking for the second of these two options.

Here's what I've tried so far:

helm-regexp: this is the closest thing to what I'm looking for but it only performs the equivalent of C-s/C-r + C-g (i.e., it takes us back to the original point; no option for terminating the search and continuing to browse the buffer from the currently matched point).
helm-do-grep: it seems like this is only for searching for text within files (i.e., doesn't work on w3m)
helm-buffer-run-grep / -zgrep: running this command/function results in an error message in the mini-buffer: Running helm command outside of context
when helm-mode is enabled, invoking C-s or C-r brings up Emacs' native isearch feature (it isn't replaced by Helm's interface).  (maybe there's a setting we can change so Helm can take over this command?  i.e., similar to how Helm takes over the native command for write-file (C-x C-w) which can be used to rename a file in an open buffer.  just brainstorming.)


texts: Why is there a newline in the result of `shell-command-to-string`?

texts:
It seems that emacs appends a newline to the return value for shell-command-to-string. For example, the return value for (shell-command-to-string "pwd") is:

"/path/to/directory
"

While the return value for (pwd) is "/path/to/directory". In other words:

(string= (shell-command-to-string "pwd") (pwd))

will return nil.

I am wondering:

What is the reason for this?
What would be an idiomatic way to remove the newline from the output so that (string= (shell-command-to-string "pwd") (pwd)) would return t?


texts: defun removes function in spacemacs config

texts:
I re-defined the function org-archive-subtree to call another function as described in the function below. I did this in spacemacs/user-config, now I can't call org-archive-subtree and C-h v (describe variable) can't find org-archive-subtree anymore. Why does the variable disappear?

(defun org-archive-subtree ()
  (org-archive-subtree-hierarchical)
  )

Everything I did is described in this post:
https://stackoverflow.com/a/35475878/5114384


texts:
When I execute describe-mode from within a .texi file, I see:

Texinfo/P mode defined in `texinfo.el' (`texinfo-mode'):
:override advice: ‘TeX-texinfo-mode’

What happens is that AUCTeX takes over the builtin Texinfo mode.

Where does that override advice come from? And how do I get back the native Texinfo mode?


texts: How to create org-mode recipe for melpa?

texts:
I'm trying to use github.com/milkypostman/melpa for creating a package from my own org-mode git repository. There are many recipes which I can create by make recipes/foo command, but there isn't the recipe for org-mode.

I look org-mode.rcp, el-get's recipe - it uses special commands for building. Also I know that elpa org-mode package and el-get org-mode package have slightly different file structure: el-get org-mode package has etc and lisp directories, but elpa org-mode package has few additional files.


texts: Can orgmode be made to open all property drawers by default upon opening my document?

texts:
I'd like all the property drawers of my org document to be expanded by default when opening my document or launching Emacs with the org document already in my persistent desktop file.  I have the following options set at the top of the document:

#+OPTIONS: toc:nil
#+STARTUP: showblocks
#+STARTUP: showeverything

This shows the tree structure, but keeps property drawers hidden/collapsed.  I want the property drawers to be shown/expanded.  If no such setting exists, is there a command I can use, and perhaps even bind to a key, to expand all property drawers?

The properties I have set contain important data, which I use org's builtin functions to process.  If I were to move the data out of the property drawers then I'd have to write functions to parse and process the data.  I could, but I'd rather keep the document structure as is.


texts: org-agenda won't show up when entries have timestamp with time range

texts:
been using org-mode for quite a while now (native emacs 26 on win10). Since yesterday, my org-agenda won't show up anymore if there is an entry to be displayed with an active timestamp that has a time range in the simple format (e.g. <2021-05-17 Mo 14:00-15:30>). There's no problem with either 'Deadline' or 'Scheduled' entries and also the format <2021-05-17 Mo 14:00>--<2021-05-17 Mo 15:30> works (but is kind of inconvenient...)
I get the following error message: org-duration-to-minutes: Invalid duration format: #("14:00-15:30" 0 11 (fontified t line-prefix #("**" 0 2 (face org-indent)) wrap-prefix #("***** " 0 2 (face org-indent) 2 6 (face org-indent)) face org-date mouse-face highlight keymap (keymap (follow-link . mouse-face) (mouse-3 . org-find-file-at-mouse) (mouse-2 . org-open-at-mouse)) org-category "Lehre"))
I have no idea if it's a bug or if it's a problem of my configuration...


texts: How to make the tab key act normally in C++ mode?

texts: I'm switching over to Emacs as my C++ editor, and what I miss the most is when I use tab, it would write 8 spaces, I could use tab more than once and use it in the middle of code, when I pressed back space it would remove the whole tab area, and it wouldn't auto indent. How can I make this happen? Thanks.


texts:
Is there a way to stop a Recurring Event in Org-Mode such as:

TODO Blabla bla :SCHEDULED: <2019-07-05 +1w>

I know I can go delete +1w , but then that's not good for my reference when I check the calendar and such.


texts:
The children of a heading at point can be sorted alphabetically
with C-c ^ a.  Can this sorting method be customized?
What I want is to sort Greek words according to their Latin
translitteration.  For instance, I want κατά to be sorted as
if it were 'kata'.


texts: Regular expression for finding 'href' attribute value of  HTML element

texts:
I need a regex pattern for finding web page links in HTML.

For example

I can use (?<=href=\").+?(?=\") | (?<=href=\').+?(?=\') in Python to get the value of href.

But that involves positive lookbehind assertions (?<=...) and positive lookahead assertions (?=...) which I didn't find in elisp Regular Expressions.


texts: How to write this advice for inject code into let-binding?

texts:
I want to write an advice on original code. But don't know how to write it in my case.
I just did some modification, and do an diff. Hope the you can understand what I need.

Here is the diff screenshot output:

And diff:

*** /tmp/org-babel-expand-1.el  2018-02-14 11:54:36.225719891 +0800
--- /tmp/org-babel-expand-2.el  2018-02-14 11:54:42.471852389 +0800
***************
*** 10,16 ****
                             (lambda (var)
                               (format "%S (quote %S)" (car var) (cdr var)))
                             vars "\n      ")
!                           "]\n" body ")")))))
      (if (or (member "code" result-params)
              (member "pp" result-params))
          (format "(clojure.pprint/pprint (do %s))" body)
--- 10,29 ----
                             (lambda (var)
                               (format "%S (quote %S)" (car var) (cdr var)))
                             vars "\n      ")
!                           "]\n" body ")"))))
!          (directory (and (buffer-file-name)
!                          (file-name-directory (buffer-file-name))))
!          (out-file (cdr (assq :file params)))
!          (add-to-body (lambda (code)
!                         (setq body (concat code "\n" body))))
!          )
!     (when directory
!       (funcall add-to-body (format "(System/setProperty 'user.dir' '%s')" directory)))
!     (when out-file
!       (funcall
!        add-to-body
!        (format "(save ob-clojure-incanter-plot '%s')" ; use static variable as convention.
!                (concat directory out-file))))
      (if (or (member "code" result-params)
              (member "pp" result-params))
          (format "(clojure.pprint/pprint (do %s))" body)


texts:
What's the right way to disable Emacs' default indent-relative behaviour and make sure that TAB always indents by a single level (be it a tab or whitespace character)?

There doesn't seem to much information about this in Emacs, but I get the impression that perhaps tab-stop-list is part of the solution if I remap indent-relative to tab-to-tab-stop.


texts: TAB doesn't indent just pops up completion list

texts:
When I enter a new line and with the cursor auto indented due to electric-indent-mode, I see indent-cycles (x) in the modeline, so I hit TAB to cycle the indentation to where I want the cursor to be for my next code. However, the indentation isn't cycled instead completion list pops up instead.
And even with that when I RET, it just jumps onto a new empty line.
(use-package company
  :after lsp-mode
  :init
  (setq company-selection-wrap-around t
        company-minimum-prefix-length 1
        company-idle-delay 0.0)
  ;;:hook (after-init . global-company-mode)
  :hook ((prog-mode latex-mode ess-r-mode lsp-mode) . company-mode)
  :bind ((:map company-active-map
          ("<tab>" . company-indent-or-complete-common)
            ("C-n" . company-select-next-or-abort)
            ("C-p" . company-select-previous-or-abort))
         (:map lsp-mode-map
          ("<tab>" . company-indent-or-complete-common)))
  :config
  ;; Documentation popups
  (use-package company-quickhelp
    :hook (company-mode . company-quickhelp-mode))

  (use-package company-box
    :hook (company-mode . company-box-mode))

  ;; Suspend page-break-lines-mode while company menu is active
  ;; (see https://github.com/company-mode/company-mode/issues/416)
  (with-eval-after-load 'page-break-lines
    (defvar-local sanityinc/page-break-lines-on-p nil)

    (defun sanityinc/page-break-lines-disable (&rest ignore)
      (when (setq sanityinc/page-break-lines-on-p (bound-and-true-p page-break-lines-mode))
        (page-break-lines-mode -1)))

    (defun sanityinc/page-break-lines-maybe-reenable (&rest ignore)
      (when sanityinc/page-break-lines-on-p
        (page-break-lines-mode 1)))

    (add-hook 'company-completion-started-hook 'sanityinc/page-break-lines-disable)
    (add-hook 'company-after-completion-hook 'sanityinc/page-break-lines-maybe-reenable)))

The question is, how to get TAB to both cycle indentations (when available) and perform completion. I already have  (setq tab-always-indent 'complete)


texts: The number of downloads of packages in packages' repositories

texts:
On MELPA website, the number of downloads of each package is given.
I am wondering if one can see this info within Emacs. It seems that the built-in package installer list-package does not provide this info.
I know the package paradox can give the popularity of many packages on github.
I just interested in the numbers of downloads.


texts: Open HTML email in browser but preventing loading of images and scripts

texts:
Email mail clients such as mu4e are not perfectly suited to view HTML emails.  I usually try to view it in Emacs (using Emacs' own HTML redinging enging shr) but revert to opening the email in a browser if it is not readable.  However, one problem with this approach is that the browser will load images, java scripts, and other remote resources references in the HTML potentially compromising my privacy.  The question is: how can I prevent remote resources from being loaded?

I considered to filter the HTML to remove java script and images but it turns out that there are so many different ways to load remote material that filtering is not feasible (CSS, Adobe Flash, ...).  So I think it would be better to open the HTML in a browser (tab?) that doesn't connect to the internet.  Is there a way to do this?


texts: In elisp, how can I calculate the number of days remaining until a given date?

texts: I feel like elisp (or org-mode) must have something like (days-until '2018-01-01) which would calculate the days between today and 2018-01-01. How would I go about implementing that?


texts: Increment file name and create a new version of the file

texts:
Assume that I am working with a file whose name contains a unique version number for example myfile_03.tex or 03jhcjh.tex and so on. Currently I create a new version of the file by C-x C-w and incrementing the number manually.

To be precise I would like to maintain the number length if possible, i.e. 027 → 028 instead of 28, but 9 → 10.

Is there a function in emacs which automatizes this procedure? Other solutions are welcomed.


texts: In helm-find-files, how do you quit entering pattern and go back to selecting files?

texts: All I want is to just quit entering patterns and go back to searching a different directory. C-g quits the whole search process.


texts: org mode evaluate code blocks up to the current cursor?

texts:
Is there a way to execute all code blocks in an org file up to the current cursor point?
I know that there is C-c C-v C-b for evaluating all code blocks. But often times, I'd like to resume from a point where I left off last time. Therefore, I'd like to execute all previous code blocks before that point.
(This is with Emacs 26.x under Ubuntu 20.04)


texts: Search/replace inside a rectangular region, without CUA mode

texts:
I want to use search/replace (string or regexp) inside a rectangular region (aka column selection?).

Consider this question: Search and replace inside a rectangle in emacs

That's what I want, except I'm not using CUA mode.  Maybe I should, but I'd have to disable C-v stuff and the changes to C-x ...

The rectangular region selection I use came straight from this question/answer: Enable Emacs column selection using mouse

So, how may I search/replace within the type of rectangle created by that mouse-start-rectangle function?


texts: What is the default location of Info files?

texts:
I am looking for "An Introduction to Programming in Emacs Lisp", by Bob Chassell.

I can find two Info files on my Spacemacs:

SPC SPC emacs-index-search
SPC SPC elisp-index-search

Does Spacemacs come with any other Info files?
How would I find them?


texts: How to update packages installed with use-package

texts:
I'm using use-package to install and configure packages (most of these packages are in melpa).
Is there a clean automated way of keeping all these packages up-to-date ?

If not, what is the best work flow in this case ?

Note: A very similar question here with an answer, but I wanted a clarification on "You'll still need to deal with installing updates".
I could not comment on the answer for clarification as I do not have enough reputation.


texts: How to pass the buffer being save to after save hook?

texts:
This question How to run an `after-save-hook` only when the buffer has been saved manually provides a way to have after-save hook run after pressing Ctrl-x Ctrl-s, in the answer Here's an alternative solution.
However the hook cannot take a argument. I understand a -function is needed and add-function is to be used instead.
The argument I wish to pass to the function is the file path of the buffer being saved as I wish to rsync it to a remote compile server.


texts: syntax highlighting and auto-completion for CSS?

texts: How can I set up css-mode for syntax highlighting and autocompletion?  I installed web-mode, but it doesn't seem to be giving me any of those features.


texts: How to navigate SPC commands with Vim cursor?

texts:
I am very used to Vim keys BUT I love to use Emacs. That's why Spacemacs in Evil mode is perfect for me. There is one thing I still cannot figure out how to do. I don't know how to use h,j,k,l for navigation in the SPC (M-x) prompt.

It is very awkward for me to use the cursor keys on my keyboard because they are very out of reach. So I am looking for a way to omit them completly when using Spacemacs and Evil mode.

One other thing is to select an autocomplete suggestion. Also here I need to use cursor keys because Vim cursor won't work. If you have an idea to fix this, too - please let me know!


texts: How to use header-args variables to fill cell values of a table

texts:
I have an org-mode file as such:
* Header level 1
:header-args: :var filename="somefile.csv"

** Header level 2
:header-args: :var foo="bar"
#+begin_src emacs-lisp
foo
#+end_src

#+RESULTS:
: bar
| / |                         |       |       |      |
|   | Datetime                | Price | Attr  | Note |
|---+-------------------------+-------+-------+------|
|   | 2021-01-13 13:45:46 UTC |  12.4 |       |      |
|---+-------------------------+-------+-------+------|
#+TBLFM: @3$3=12.4
#+TBLFM: @3$4='(message "%S" foo)

I would like to be able to C-c C-c on the second formula and have "bar" written on the Attr cell for that entry.
Is this possible using header-args?
Thank you very much.


texts: Can EMMS prevent my laptop from going to sleep?

texts:
Q: how do I keep EMMS from allowing my laptop to go to sleep?

I use EMMS to play music files.  When I've got a long playlist going, I expect it to keep my laptop awake and continue working through the playlist, even when I'm not otherwise interacting with my laptop.

However: my laptop still falls asleep at its regularly scheduled time if I don't touch it.  It seems to be the case that the laptop reaches the "go to sleep after X minutes" mark that I've set, finishes whatever track EMMS is currently playing, and then goes to sleep.  It then begins the next track on the playlist immediately after it wakes up.

I'd like to have continuous play without needing to intervene.  Currently, I have to tap a key or jiggle the trackpad every 15 minutes or so to prevent the sleep, which is obviously silly.  How do I get continuous play and have EMMS prevent the laptop from sleeping?

FWIW: this is a problem on laptops with Linux (Fedora, Ubuntu) and OSX.


texts: How to figure out which parameters a function actually need?

texts:
I would like to insert the number 1, and then increase the number with calling
the function evil-numbers/inc-at-pt from the package evil-numbers.

So I went looking into the source code of the function evil-numbers/inc-at-pt:

(defun evil-numbers/inc-at-pt (amount &optional no-region)
"Increment the number at point or after point before end-of-line by `amount'.
When region is selected, increment all numbers in the region by `amount'

NO-REGION is internal flag that allows
`evil-numbers/inc-at-point' to be called recursively when
applying the regional features of `evil-numbers/inc-at-point'.

"
(interactive "p*")
[...]

This function don't need any region by the way. You can place your cursor after the number, without any region. It will increase
the number if there is no region, then it will look for any number and increase it.

So I created a function around this

(defun eshell-go-to-number-down ()
    (interactive "p*")
    (evil-insert)
    (insert "0")
    (evil-numbers/inc-at-pt 1))

So when I call that function, it will insert the number and increase it. I plan to modify it, when there is already a number then don't insert any number. But that's a later concern. I'm trying to figure out how I call evil-numbers/inc-at-pt properly.

As it seems from the source code, the function evil-numbers/inc-at-pt expects
a number, which I provide with 1 But I get the error message:

funcall-interactively: Wrong number of arguments: (lambda nil (interactive "p*") (evil-insert) (insert "1") (evil-numbers/inc-at-pt 1)), 1

So where went I wrong? Please don't verdict me, I'm trying to learn Lisp.


texts: Calfw - How to integrate with Google calendar?

texts:
From the man page I read to insert theese statements into init.el

(require 'calfw-ical)
(cfw:open-ical-calendar "http://www.google.com/calendar/ical/.../basic.ics")

What I don't undertand is what I have to put in place of the ellipsis.

Any clue?

Thanks in advance.


texts:
In dired mode, with the key m, you mark a file.

You can unmark this with the key u.

I find that somewhat cumbersome, so I would bind the key m to mark or unmark a file under the cursor, depending of the status of file.
When looking around, I found dired-toggle-marks. But it toggles the marks on all files, but the function dired-toggle-mark doesn't exist yet.

It surprised me, given how big and extensible Dired is.

Then I thought I could devise my own function, to toggle mark on the file. When I do C-h f dired-toggle-marks to read the source code, it doesn't display the source code to me.

So what would be a good way to find out how to detect the status of file under cursor, and mark/unmark it?


texts:
What is the easiest way to get autocompletion for math symbols when I write latex formulas between \(..\) or \[...\] in org-mode?

Could packages like company-math or ac-math be used in org-mode, for example? How should I configure them to use them in org-mode?


texts: Is there any way to display multiple tooltips, or something similar to them? Overlays wont work because i need to display them using xy coordinates.


texts:
In my init.el file, I have some code to hide the Emacs toolbar:

;;; Hide the toolbar
(tool-bar-mode -1)

But when I load Emacs, it first enables the toolbar, and then quickly hides it, after it reads through my init.el file. This alone is a small annoyance. But my init.el file is getting pretty long. And now Emacs must go through a whole series of spastic corrections, every time it loads...

Is there a way to make Emacs process init.el before it launches the first frame?

I am on a Mac, running MacPorts Emacs, version 24.5.4.


texts:
$defs = {
   "key1" => 1,       # indented correct with tab
       "key2" => 2,   # indented too much, should align with key1
       "key3" => 3,   # keeps indentation from here on
};

With regular perl-mode in Emacs 26.5 the indentation is "staggered" like above, where key2 and key3 are not aligned with key1 when tab is pressed, but should be. How to make perl-mode do that? (not cperl-mode).


texts: Gracefully exiting emacs while afplay is running

texts:
When I exit emacs while my music is playing using afplay -- music keeps playing.

What is the right way of stopping/killing afplay process?

Should I use exit hooks or is there emms built-in setting I can tinker?


texts: How do I get colour emoji to display in Emacs

texts: Emacs 27 gained support for Cairo for font rendering and this is supposed to let me render emojis but I can't find out how to make it work. I just about managed to set up some fontsets but the emoji which are made out of multiple characters don't work. Is it possible to make them work?


texts: Errors after update: "File already exists error list-utils-pkg.el"

texts:
When I relaunched emacs after updating some packages, I had an error:

Debugger entered--Lisp error: (file-already-exists "File already exists "/home/linevich/.emacs.d/elpa-24-3-1-x86-64-pc-linux-gnu/list-utils-20140508.1341/list-utils-pkg.el")
  write-region("(define-package \"list-utils\" \"20140508.1341\" \"List-manipulation utility functions\" (quote nil))\n" nil "/home/linevich/.emacs.d/elpa-24-3-1-x86-64-pc-linux-gnu/list-utils-20140508.1341/list-utils-pkg.el" nil nil nil excl)
  package-unpack-single("list-utils" "20140508.1341" "List-manipulation utility functions" nil)
  package-download-single(list-utils "20140508.1341" "List-manipulation utility functions" nil)
  package-download-transaction((ucs-utils list-utils pcache persistent-soft font-utils unicode-fonts))
  package-install(unicode-fonts)
  ergoemacs-component-struct--ensure(unicode-fonts)
  ergoemacs-component-struct--apply-inits()
  run-hooks(ergoemacs-mode-startup-hook)
  ergoemacs-mode(1)
  eval-buffer(#<buffer  *load*> nil "/home/linevich/.emacs.d/init.el" nil t)  ; Reading at buffer position 524
  load-with-code-conversion("/home/linevich/.emacs.d/init.el" "/home/linevich/.emacs.d/init.el" t t)
  load("/home/linevich/.emacs.d/init" t t)
  #[0 "\205\262

I tried to remove this file, and had the next one traceback:

Debugger entered--Lisp error: (file-already-exists "Файл вже існує" "/home/linevich/.emacs.d/elpa-24-3-1-x86-64-pc-linux-gnu/pcache-20150125.1653/pcache-pkg.el")
  write-region("(define-package \"pcache\" \"20150125.1653\" \"persistent caching for Emacs\" (quote ((eieio \"1.3\"))))\n" nil "/home/linevich/.emacs.d/elpa-24-3-1-x86-64-pc-linux-gnu/pcache-20150125.1653/pcache-pkg.el" nil nil nil excl)
  package-unpack-single("pcache" "20150125.1653" "persistent caching for Emacs" ((eieio (1 3))))
  package-download-single(pcache "20150125.1653" "persistent caching for Emacs" ((eieio (1 3))))
  package-download-transaction((ucs-utils list-utils pcache persistent-soft font-utils unicode-fonts))
  package-install(unicode-fonts)
  ergoemacs-component-struct--ensure(unicode-fonts)
  ergoemacs-component-struct--apply-inits()
  run-hooks(ergoemacs-mode-startup-hook)
  ergoemacs-mode(1)
  eval-buffer(#<buffer  *load*> nil "/home/linevich/.emacs.d/init.el" nil t)  ; Reading at buffer position 524
  load-with-code-conversion("/home/linevich/.emacs.d/init.el" "/home/linevich/.emacs.d/init.el" t t)
  load("/home/linevich/.emacs.d/init" t t)
  #[0 "\205\262

When I removed this file too, I had the same error as at the beginning "list-utils-pkg.el" exists.
How to fix this?
My config is messy, but I think that the problematic package is ergoemacs which tries to install some packages.
Config here.
P.S Sorry for my English :)


texts: How to abort saving in a before-save-hook function?

texts:
If, in a function run from before-save-hook, I want to abort the saving of a file, so that the file is not saved and the user is signaled, how can I do that?  Is it possible (without rebinding C-xC-s or doing defadvice around save-buffer)?

(It used to be, I think in Emacs 23, that all you had to do was (error "Bad!"), and the file save operation would be aborted.  But that does no longer work; any errors in a before-save-hook are ignored.)


texts: How to set a terminal-local variable in all terminals?

texts: Specifically, I want to set overriding-terminal-local-map to nil in all terminals.


texts: In shell, eshell and comint-modes, the cursor moves back one chacacter when I switch buffers

texts:
When I'm in a shell and I change buffers, if I switch back to the shell buffer, the cursor has moved back a character and I can't start typing new shell commands until I hit -> first.

This happens even with: (setq evil-move-cursor-back nil)

I'm using evil. This doesn't happen when with emacs -Q or in spacemacs, so there must be something wrong with my config, but I don't know what to look for that might be causing it.


texts: Set multiple keys at once with global-set-key?

texts: Is it somehow possible to set multiple keys with global-set-key without having to repeat the statement, like setting multiple variables with setq?


texts: Trouble importing tags from certain mp3 files in EMMS

texts:
I'm finding that EMMS fails to import the info from the tags for certain mp3 files and I'm not sure why.

If I select such a track and press E to call emms-tag-editor-edit, all fields show empty. But if I check a problem track directly with mp3info, the files seem to be tagged correctly.

What might be going wrong here and how do I fix it?


texts: Org mode tables with Devanagari characters look misaligned

texts:
Here is the table:
|----+-----------|
| No | Name      |
|  1 | Mumbai    |
|  2 | मुंबई       |
|  3 | पुणे        |
|  4 | उस्मानाबाद |
|----+-----------|

With devanagari characters, the table cell alignment is completely lost.
Any solution around this?


texts:
I just started out on emacs so this might have a really simple answer. I'm getting an error message on startup and have no idea what it means. The debug message doesn't help much either.

What do these messages mean and how can I rectify the error?

I'm on emacs 24.4.1, Debian 8.

When starting up emacs I get the following error:

Warning (initialization): An error occurred while loading `/home/user/.emacs.d/init.el':

Symbol's value as variable is void: elpy-modules

Looking through my .emacs/init.el, I can't find anything what looks like a variable called elpy-module (however I don't know lisp, so perhaps that's part of the issue).

When starting with emacs --debug-init I get:

Debugger entered--Lisp error: (void-variable elpy-modules)
  (delq (quote elpy-module-flymake) elpy-modules)
  (setq elpy-modules (delq (quote elpy-module-flymake) elpy-modules))
  (progn (setq elpy-modules (delq (quote elpy-module-flymake) elpy-modules)) (add-hook (quote elpy-mode-hook) (quote flycheck-mode)))
  (if (require (quote flycheck) nil t) (progn (setq elpy-modules (delq (quote elpy-module-flymake) elpy-modules)) (add-hook (quote elpy-mode-hook) (quote flycheck-mode))))
  eval-buffer(#<buffer  *load*> nil "/home/user/.emacs.d/init.el" nil t)  ; Reading at buffer position 1923
  load-with-code-conversion("/home/user/.emacs.d/init.el" "/home/user/.emacs.d/init.el" t t)
  load("/home/user/.emacs.d/init" t t)
  #[0 "\205\262


texts: Enable python pdb on emacs with virtualenv

texts:
While running pdb within emacs, this answer (python -m pdb myscript.py) is successful for enabling python pdb on emacs with virtualenv.

The problem is that I need to type it manually after calling M-x pdb

How could I edit my .emacs file to use it automatically, without the need to type it manually every time?

Thanks!


texts: some unicode characters such as "⊆" occupy 3 lines in emacs 24.4.1 on ubuntu gnome 15.04 64bit

texts:
Not every unicode character occupies 3 lines, but '⊆', '∈', and other unicode mathematical symbols occupy 3 lines in emacs on my system.

How can I fix this rendering bug?


texts:
I need to get weblinks from a buffer (http....) and put them into scratch buffer. This code partially works, but the weblinks are
inserted in the same buffer.

I'm new at programming.

(defun get-weblinks ()
  "Get weblinks from a buffer"
  (interactive)
  (let (p1 p2 url)
    (while (search-forward "http")
      (backward-char 4)
      (setq p1 (point))
      (search-forward "jpg")
      (setq p2 (point))
      (setq url (buffer-substring p1 p2))
      (insert url "\n")
      )))

How can I finish the function?

Thank you for your help.


texts: Org-mode sitemap not updated after re-publish

texts:
It turns out to be that the titles are cached and originally they are not supposed to change frequently.

One workaround is to delete all the cache:

Cache in ~/.org-timestamps doesn't get updated to reflect the change in page title. Deleting everything under the folder and re-publish then everything goes fine, until page titles are changed again.

For more detail, see the link in the comment below.

In my org-mode project, modified page title is not updated in sitemap after re-publish. I did following steps to reproduce:

a.org(title A) --> change title to AA --> re-publish --> title in sitemap.org: A -->
rename a.org(AA) to b.org(AA) --> re-publish --> title in sitemap.org: AA -->
change b.org(AA) to b.org(BB) --> re-publish --> title in sitemap.org: AA

Here for (1) and (3) the sitemap doesn't reflect the change in page title.

What I tried:

Invoke org-publish-project, delete published contents, re-publish, doesn't work
Add prefix C-u to org-publish-project, delete published contents, re-publish, doesn't work

It seems to be some kinds of sitemap cache, but I couldn't find any clue.

I am using GNU Emacs for Mac OS X 26.1.

Below is my project configuration init.el:

(setq make-backup-files nil)

(setq project-dir (file-name-directory load-file-name))
(setq publish-dir (concat project-dir (file-name-as-directory "publish")))
(setq css-dir (concat project-dir (file-name-as-directory "css")))

(setq current-theme "readtheorg")

(load (concat project-dir "src/theme.el"))

;; for latex

(setq org-latex-pdf-process
  '("latexmk -pdflatex='pdflatex -interaction nonstopmode' -pdf -bibtex -f %f"))

(org-babel-do-load-languages
 'org-babel-load-languages
 '((emacs-lisp . t)
   (clojure . t)
   (shell . t)
   (ditaa . t)
   (dot . t)
   (plantuml . t)))

;; org project

(require 'ox-publish)

(setq org-publish-project-alist
      `(("org"
     :components("org-pages" "org-assets"))
    ("org-pages"
     :base-directory "."
     :base-extension "org"
     :publishing-directory ,publish-dir
     :makeindex t
     :recursive t
     :publishing-function org-html-publish-to-html
     :with-author "Myself"
     :headline-levels 4
     :auto-preamble t
     :auto-sitemap t
     :sitemap-title "Notes"
     )
    ("org-assets"
     :base-directory "."
     :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf"
     :publishing-directory ,publish-dir
     :recursive t
     :publishing-function org-publish-attachment)
    ))

(org-publish "org" t)
(delete-directory "./publish/publish" t)

(defun pub ()
  "Publish org-project \"org\""
  (interactive)
  (org-publish-project "org")
  (delete-directory (concat publish-dir (file-name-as-directory "publish")) t))

Any help is appreciated! Thanks!


texts: How to highlight other square brackets in custom major mode?

texts:
I'm working in a custom major mode, and part of the syntax are the square brackets, like [Hello world] and so they can contain nested square brackets as in [Hello [World]], however I see this problem were Emacs will highlight the inner most square bracket first.

This is the current rx expression I have come with using some external help:

(rx (submatch-n 1 "[" (submatch-n 2 (+ (not (any ?[ ?])))) "]"))

It does the job, but I prefer that it match the outer most square bracket first.


texts: How do I symlink .spacemacs files to a version controlled .spacemacs file?

texts:
I am using Windows 10. I have cloned spacemacs repository inside my %APPDATA% folder. When I launch Emacs for the first time, it asks me usual question about preferring Evil and Helm mode. Then it creates a .spacemacs files in %APPDATA% folder. So far, so good.

Now, I want to use .spacemacs file that I have in my dotfiles repository. To do so, I open up cmd with administrative privileges, and use following command

$ mklink %APPDATA%\.spacemacs %HOMEPATH%\Repos\dotfiles\spacemacs\spacemacs

It successfully creates a soft linked .spacemacs file. But when I launch Emacs, it asks me again about Evil and Helm mode and overwrites original file, %HOMEPATH%\Repos\dotfiles\spacemacs\spacemacs.

If I instead of creating a soft link, copy spacemacs file from repository to the folder, then Emacs respects the settings in it.

How do I make Emacs to treat this soft linked .spacemacs as a normal configuration?

I have similar setup on macOS where soft link poses no issues.


texts: error checking system type: wrong type argument gnu/linux

texts:
setting different config options depending on OS. When checking if gnu/linux I get a "wrong type argument char-or-string-p, gnu/linux"

Tried so far:

(string-equal (upcase system-type) "GNU/LINUX")

(string-equal (format "%S" system-type) "gnu/linux")

(string-prefix-p "gnu" system-type)

(string-equal system-type "gnu/linux")

if(eq system-type 'gnu/linux)

if(eq string= (system-type) 'gnu/linux)

None of them worked.


texts: how to ignore hyphens in completion candidates using company-dabbrev backend?

texts: How can I modify company-dabbrev to behave like other company-backends, so I also receive words as completion candidates, that are connected with hyphens.


texts: Clone content in another part of document?

texts: Is it possible to clone a part of a document in another part of the document? So that changing one, changes both?


texts: Show Helm candidates at left, immediately above minibuffer

texts:
If I split a frame vertically, keep point in left split and press M-x, minibuffer will be on bottom and M-x will be in left corner like this.

This is very convinient as I can 'see' what I am typing and helm sources without moving my head.

On the other hand, If I keep point in right split, press M-x, minibuffer will be on bottom and M-x still will be in left corner like this.

If M-x starts from the middle, it would be very convenient.

How can I position text in minibuffer w.r.t to split?

Also, when window is split horizontally, how can I position minibuffer at the bottom of top slit?


texts: Elisp function to see a date for next Wednesday

texts: Admitting up front that I am not capable of much Lisp, I have found ways to produce the current date or a number of seconds from a date, but I am looking for a simple equivalent to shell command like date -d "next wed" I believe that with the output fed to (format-time-string ... I can get what I need.


texts: When to use quote for lists? Modifying quoted lists in Elisp

texts:
The Common Lisp Hyper Spec says:

  The consequences are undefined if literal objects (including quoted objects) are destructively modified.

This is further motivated at the Constant Modification Issue that lead to the corresponding clarification in the CL Spec.:

  CLtL states that an implementation is permitted to "collapse" constants appearing in code to be compiled if they are EQUAL. This implicit sharing of compiled data structures may result in unpredictable behavior if destructive operations are performed. However, CLtL does not explicitly allow or disallow destructive operations on constants.

Does Emacs Lisp have the same behavior/rules as Common Lisp in that aspect?

In the Emacs Lisp Manual there are many examples where quoted lists are assigned to variables and afterwards modified.

Section "Altering the CDR of a List" gives such an example:

> (setq x '(1 2 3))
     => (1 2 3)
(setcdr x '(4))
     => (4)
x
     => (1 4)

On the other hand there is a warning not to use quoted list as non-last element of nconc in the Emacs manual:

  A common pitfall is to use a quoted constant list as a non-last argument to nconc. If you do this, your program will change each time you run it! Here is what happens:

(defun add-foo (x)            ; We want this function to add
  (nconc '(foo) x))           ;   foo to the front of its arg.

(symbol-function 'add-foo)
     => (lambda (x) (nconc (quote (foo)) x))

(setq xx (add-foo '(1 2)))    ; It seems to work.
     => (foo 1 2)
(setq xy (add-foo '(3 4)))    ; What happened?
     => (foo 1 2 3 4)
(eq xx xy)
     => t

(symbol-function 'add-foo)
     => (lambda (x) (nconc (quote (foo 1 2 3 4) x)))

Is there a complete list of correct rules when to use quoted lists and when not anywhere in the Elisp manual?

Or are those examples in the Emacs manual even erroneous because they modify quoted lists?

Maybe a question of itself: Is there a Spec for Elisp?

An even more simple example for the modification of a function add-foo through the modification of its return value:
(This is used in the discussion with Drew in the comments.)

(defun add-foo ()
  '(1 2 3))

(setq x (add-foo))
(setq x (nconc x 4))
(add-foo)

The last statement gives (1 2 3 . 4).


texts: Auto-update org tables before each export

texts:
I am looking for a solution (a function) that evaluates all the tables in the org file/buffer. I should be then simply able to add that to the local value of before-save-hook in org-mode.

Currently, I need to remember to C-u C-c C-c on all the tables before exporting to ensure that the calculated values in all tables are current.

Or am I missing some org variable, setting which should take care of this?


texts:
In Emacs, one can use asterisks * to achieve bold font, for example, *bold*. My question is can I make the asterisks invisible? i.e. bold instead of *bold*.
Same question for strike through, italics, etc.

I know this should be achievable. As an example, one can set the org-indent asterisks the same color of the background, so it becomes invisible:

* Headline one
** Headline two

vs.

* Headline one
 * Headline two

You can still move the caret over to see the asterisks there, which is nice.

Back to my question, I don't know if or how to do the same thing for the markups in text formatting.


texts: Open org-mode link of gif image and display inside of Emacs buffer with command image-animate

texts:
I want to open gif image link (in Org-mode) with emacs lisp function
image-animate. Here is my try.
https://gist.github.com/e2e05b28e0a6bf3bd9f27f345696892d But I got some
problems, how to open a temp buffer window to display the image? and Seems
image-animate require IMAGE as absolute path. I don't know how to use
org-file-apps parameters FILE and LINK.

Usually the org-mode GIF file link looks like this:

[[file:data/eb/cf96ad-9e34-4ef6-b0c2-5c31bb869aa6/59715_170807115059_1.gif]]


texts: How to use org-capture in a function without killing the buffer, customize capture refile

texts:
I am trying to create a function, which captures a note and then copies the same note to another file (In my case for a google calendar synchronization). The problem ist that after giving the capture parameters the capture buffer closes automatically unlike the regular behaviour, where I have the option to finalize or refile the capture:

How should I edit the following function to remain in capture buffer?

(defun org-capture-copy-to-gcal ()
  (interactive)
  (beginning-of-buffer)
  (org-capture)
  (org-copy-subtree)
  (find-file "D:/Google Drive/Documents/gcal.org")
  (end-of-buffer)
  (org-paste-subtree)
  (save-buffer)
  (kill-this-buffer))

And is there a way to customize the capture refile shortcut to another shorter key?


texts: How to find out what advice has been defined for a function?

texts:
I accidentally added a lambda function that wasn't done being written to the advice of a function, and the function doesn't work. I don't know the exact text of the lambda function. Obviously, I could fix the problem by restarting emacs, but I don't want to have to do that.

How do I get a list of advice defined for a function so I can remove the lambda function?


texts: Elfeed - how to change database location?

texts:
I found in elfeed-db.el code:
(defcustom elfeed-db-directory "~/.elfeed"
  "Directory where elfeed will store its database."
  :group 'elfeed
  :type 'directory)

but I don't know how/where to customize it. I need this, because i synchronize Emacs between computers.
Cheers
Kuba


texts:
I searched logviewer and still not get right one!

My idea is:

Open a log file with log mode, then screen split with 3 window: 1 for orignal log file, the second one for filter keyword lines (regex support). the third one is all output line of the filter output.
If cursor move in filter output line, the main window will scroll to that line and hightlight the keyword.
If user change the second window keywords, the filter output window update as well.

Any exist package has similar functionality?


texts: Write a function that runs another function after adding a hook

texts:
I want to run some function f after adding a hook to a mode and after running f remove the hook that I added, returning the result of f if there is one.

Here is a non-working version that I hope makes the intent clear:

(defun run-function-with-hook (mode-hook hook-fn fn)
  (add-hook mode-hook hook-fn)
  (message (concat "mode hooks before running: " (prin1-to-string (symbol-value mode-to-slowdown))))
  (funcall fn)
  (remove-hook mode-hook hook-fn))

  (run-function-with-hook 'org-mode-hook (message "opening org file") (message "opened org file"))

Is this a better fit for a macro? If so, perhaps the right answer to this is an answer using a macro instead.


texts: How to call org-lint against org-mode file from command-line

texts:
I am configuring a CI/CD pipeline to process org-mode files into documentation, source code, and other file formats.

I would like to add a call to org-lint to do basic syntax checking against org files as part pipeline.

Unfortunately I haven't be able get the command line to work.

I've tried the following commands:

emacs --batch -l org -f org-lint org-lint-notes.org

emacs --batch -l org --eval '(org-lint)' org-lint-notes.org

But both return the error below:

  Symbol’s function definition is void: org-lint

I'm not sure what I'm doing wrong.

Thanks for your help!

  This code was tested using:
  emacs version: GNU Emacs 25.2.1 (x86_64-unknown-cygwin, GTK+ Version 3.22.10)
  org-mode version:  9.1.2


texts: Emacs evil-mode C-c/C-x to "cc"/"cx". ( key translation)

texts:
I read in evil wiki that I can change prefix keys such as C-c or C-x and so on to cc, cx, but I'm not experienced in Elisp and I tried a lot of variants but I can only define c as C-c but not a cc to C-c here is my evil.el file. What do I need to change in my evil.el or maybe in init.el to set cc as C-c and cx as C-x?

My evil.el file:

  (defvar evilPackages
  '(goto-chg
    evil-magit
    evil-matchit
    evil-escape))

(mapc #'(lambda (package)
    (unless (package-installed-p package)
      (package-install package)))
      evilPackages)

;; Undo-tree (as dependency of Evil)
(add-to-list 'load-path "~/.emacs.d/undo-tree")
(global-undo-tree-mode)

(use-package evil
  :ensure t
  :init
  (setq evil-want-C-u-scroll t)
  (setq evil-want-integration t) ;; This is optional since it's already set to t by default.
  (setq evil-want-keybinding nil)
  (require 'evil-magit)
  (require 'evil-matchit)
  (global-evil-matchit-mode 1)
 :config
  (evil-mode 1)
  (setq-default evil-escape-key-sequence "jk")
  (evil-escape-mode t))

(use-package evil-collection
  :after evil
  :ensure t
  :config
  (evil-collection-init))


texts: Run interactive shell script in new buffer using elisp

texts:
I am looking for a way to display and interact with long running shell scripts in a separate buffer. While using eshell works, I'd like to automate most shell tasks using elisp.

The best way I came up with is (example for git pull):

(let ((new-buffer (get-buffer-create "*script*")))
     (switch-to-buffer-other-window new-buffer)
     (eshell-command "git pull" t)))

While this displays procedural output in a new buffer, emacs locks until the process finishes and I can't interact with git if it prompts for information.

(start-process "script" new-buffer "git" "pull") runs asynchronously, but does not accept interactive input either.

The git pull command is just an example here.

Update:

I think I got everything I wanted using make-comint-in-buffer. I got correct ansi-colors and can interact with the process if it reads stdin.

Just the gist:

(let* ((script-proc-buffer
           (apply 'make-comint-in-buffer "script" new-buffer "git" nil '("pull")))
       (script-proc (get-buffer-process script-proc-buffer)))

    (set-process-sentinel script-proc 'special-mode-sentinel))

Where special-mode-sentinel is a defun that switches to special-mode when the process has finished, allowing me to quit the buffer using q.

It's not pretty, but it works...


texts:
I'm trying to have a clickable button in the header-line. The code below works for the mode-line but not for the header line. Is there something specific to add?

(setq-default header-line-format
 (list `(:propertize " ☰ "
                    face       mode-line-mode
                    mouse-face mode-line-highlight
                    local-map  ,mode-line-major-mode-keymap)
       `(:propertize "%m " face mode-line)))


texts: I need example of correct using of comint and getting last comand output

texts:
I had a problem with execution of (comint-simple-send process command). My previous example would not show the last output because I didn't use the hook and the result was being dispalyed before the command finished it's execution. Als I didn't know about having to restart the process to reflect the code changes.

My solution

The following code works.

(add-hook 'comint-output-filter-functions
          '(lambda (txt) (message (format  " output ----------- %c%s" 10 txt))))

(let* ((process-buffer (make-comint-in-buffer "StrangeTerm" "*strange-term*" "/bin/bash"))
       (p (get-buffer-process process-buffer)))
  (comint-simple-send p "ls -l /"))

The lambda has the expected output, which I can see in Messages and in future I can do what I want with it.

Please confirm if this is the correct approach.


texts:
I have one table (TBL1), I want to generate another table with unique items from TBL1.
Currently, I can do it with elisp as below but I think it's too complicate.

#+NAME: TBL1
| Item | Amount |
|------+--------|
| A    |    100 |
| B    |     20 |
| A    |    120 |
| C    |     40 |
| B    |     50 |
| A    |     20 |
| C    |     16 |
|------+--------|
#+BEGIN_SRC elisp :var x=TBL1[1:-1] :results output raw :exports both
  (let (y)
    (dolist (line x)
      (setq y (append y (list (car line)))))
    (setq y (delete-dups y))
    (dolist (elem y)
      (princ (format "|%s|\n" elem))))
#+END_SRC

#+RESULTS:
| A |
| B |
| C |

I can find a similar unique API from the document.what's the best way to do that?


texts: Org-mode Integration with Google Calendar?

texts:
It seems that the various methods of calendar integration have not been working well. The tutorial on worg is outdated and the function is now called org-icalender-export-to-ics. However running this function on an .org file gives me an .ics file which does not have any entry:

BEGIN:VCALENDAR
VERSION:2.0
X-WR-CALNAME:Personal
PRODID:-//Xiang Ji//Emacs with Org mode//EN
X-WR-TIMEZONE:HKT
X-WR-CALDESC:
CALSCALE:GREGORIAN
END:VCALENDAR

I used to use mobileorg to directly sync with Google Calendar on Android. However the project has long been out of maintenance and recently I haven't been able to sync any of my org files with mobileorg at all, with various undecipherable errors occuring.

All I need is to sync those entries with SCHEDULED and DEADLINE to my calendar so that I can also check on them when I'm on my cellphone.

There has been a similar question on Reddit but none of the solutions mentioned there have been able to achieve this end.


texts: How to detect if current major-mode supports which-function and semantic/find?

texts:
I am implementing a feature to automatically generate a bookmark name by extracting information from the current context. Many packages provide such info. For example which-func (through (which-function)) and semantic/find (through (semantic-current-tag)).

How do I detect availability/support of which-func or semantic/find for the current buffer?

Is this exposed by the mode writer through modes so from (eq major-mode DESIRED-FEATURE-mode) and DESIRED-FEATURE-minor-mode variable?


texts: Prevent org mode from checking if file exists in external link

texts:
I am trying to open pdf files in specific folder using org mode.
For example, in a org file test.org:

My sample org file. Here is an external link: file:test.pdf

When I click on the link, it should open the file /home/hakon/my_pdf_files/test.pdf.

I have tried this: I added the following to my Emacs init file:

(eval-after-load "org"
  '(progn
     (setcdr (assoc "\\.pdf\\'" org-file-apps) "/home/hakon/my_org_pdf_viewer.sh %s")))

Where the shell script my_org_pdf_viewer.sh is:

#! /bin/bash

file_name=$(basename $1)
evince ~/my_pdf_files/"$file_name"

However this only works if the file name in the external link in test.org : file:test.pdf also exists as file name in the same folder as test.org, which is usually not the case. If the file does not exist in that directory, Emacs shows

No such file: <path/test.pdf>

in the echo area.


texts: How to automatically run inferior process when loading major mode for the first time?

texts:
Let's say we are working with Python (or Matlab) with company.
Without an inferior process company messages that

Completion needs an inferior Python process running

However, the obvious solution to automatically run an inferior process

 (add-hook 'python-mode 'run-python)

would run a new python process every time I open a .py file (this becomes more expensive with Matlab)

Is there a hook that gets run only the first time a major mode is run ?
Or is there a way to detect if a python/matlab inferior process is already running ?
Or is there another way to solve this problem of running an inferior process automatically with a major mode but only once ?


texts:
Whenever I select a region and execute an extended command (M-x), Helm opens and I immediately lose the ring selection highlighting. Is there a way of stopping Helm from doing so?

My Helm configuration (which I adapted from here) is this:

(use-package helm
  :init
  (progn
    (require 'helm-config)
    (setq helm-candidate-number-limit 10)
    ;; From https://gist.github.com/antifuchs/9238468
    (setq helm-idle-delay 0.0 ; update fast sources immediately (doesn't).
          helm-input-idle-delay 0.01  ; this actually updates things
                                        ; reeeelatively quickly.
          helm-quick-update t
          helm-M-x-requires-pattern nil
          helm-split-window-in-side-p t
          helm-buffers-fuzzy-matching t
          helm-move-to-line-cycle-in-source t
          helm-ff-search-library-in-sexp t
          helm-ff-file-name-history-use-recentf t
          helm-ff-skip-boring-files t)
    (helm-mode))
  :config
  (progn
    ;; I don't like the way switch-to-buffer uses history, since
    ;; that confuses me when it comes to buffers I've already
    ;; killed. Let's use ido instead.
    (add-to-list 'helm-completing-read-handlers-alist '(switch-to-buffer . ido)))
  :bind (("C-c h" . helm-mini)))
(ido-mode -1) ;; Turn off ido mode in case I enabled it accidentally


texts:
I don't want themes.
I use bold,italics, and highlights.
I also use background colors per file, so the code as in  for background need to be embedded inside file.

But when I Edit->Text Properties->Face->other
And select highlight upon reopening the file it's gone as the encoding isn't embedded inside the file, but bold does in this format when I open M-x find-file-literally I see this encoding <bold> BOLDED FONT <\bold>.

  Background color is not changed even though foreground color of text changes! What's wrong with background color?

I save them in enriched mode.


texts: A faster method to obtain `line-number-at-pos` in large buffers

texts:
The function line-number-at-pos (when repeated about 50 times) is causing a noticeable slow-down in semi-large buffers -- e.g., 50,000 lines -- when point is near the end of the buffer.  By slow-down, I mean a combined total of about 1.35 seconds.

Instead of using a 100% elisp funciton to count-lines and goto the top of the buffer, I'd be interested in a hybrid method that taps into the built-in C abilities responsible for the line number appearing on the mode-line.  The line-number that appears on the mode-line occurs at light speed, regardless of the size of the buffer.

Here is a test function:

(defmacro measure-time (&rest body)
"Measure the time it takes to evaluate BODY.
http://lists.gnu.org/archive/html/help-gnu-emacs/2008-06/msg00087.html"
  `(let ((time (current-time)))
     ,@body
     (message "%.06f" (float-time (time-since time)))))

(measure-time
  (let* (
      line-numbers
      (window-start (window-start))
      (window-end (window-end)))
    (save-excursion
      (goto-char window-end)
      (while
        (re-search-backward "\n" window-start t)
        (push (line-number-at-pos) line-numbers)))
    line-numbers))


texts: AUCTeX doesn't run bibtex even though .emacs file is set up appropriately

texts:
I created a simple BibTeX file as well as a simple LaTeX file that references said BibTeX file. However, when I printed out the LaTex file in pdf format by running C-c C-a (which, according to the AUCTeX manual, runs BibTeX, amongst other things),the bibliography section didn't appear and the citations were broken.

Trying to debug the problem, I replaced the single C-c C-a command by a sequence of C-c C-c commands (since, according to the AUCTeX manual section linked to above, C-c C-a is an abbreviation for such a sequence), and noticed that the bibtex command was not executed.

A similar question was posted in the past, to which the solution was to add a couple lines to the initialization file, but these lines are already in my initialization file.

Bibliography.bib

@book{WEN08,
    Author = {Jochen Wengenroth},
    Date-Added = {2017-05-08 08:16:51 +0000},
    Date-Modified = {2017-05-08 08:19:24 +0000},
    Publisher = {de Gruyter},
    Title = {Wahrscheinlichkeitstheorie},
    Year = {2008}}

MyDoc.tex

\documentclass[11pt]{article}
\usepackage{cite}

\begin{document}

\title{My Article}
\author{Nobody Jr.}
\date{Today}
\maketitle

Blablabla said Nobody ~\cite{WEN08}.

\bibliography{Bibliography}{}
\bibliographystyle{plain}
\end{document}

.emacs includes the following lines:

(setq TeX-auto-save t)
(setq TeX-parse-self t)

Resulting pdf file

AUCTeX 11.90.0
Emacs 25.1.1
TeX Live 2016, v. 3.14159265
macOS Sierra, v. 10.12.4


texts:
While in org-mode I've tried calling fill-paragraph directly.  I've tried using auto-fill-mode and refill-mode.  I've tried org-fill-paragraph.  The fill-column is set appropriately.  None of them make the fill happen; absolutely no changes occur.

Does anyone know if this is a known bug or is otherwise a problem? Even better, do you know of a solution?


texts: Does Emacs 26.3 require older version of ImageMagick?

texts:
I've just upograded Ubuntu 19.04, which installs imagemagick 7. When trying to start my Emacs install, I see the following error:

emacs: error while loading shared libraries: libMagickWand-6.Q16.so.3: cannot open shared object file: No such file or directory

However, I already have imagemagick installed:

imagemagick is already the newest version (8:6.9.10.14+dfsg-7ubuntu2.2).

I'm still fairly new to Emacs. I'm guessing this means Emacs depends on an older version of this thing called imagemagick?

How do I fix this problem?


texts:
Hello I am new to Emacs and I have started using org mode for improving my productivity.

Currently when I press C-c . the date format displayed is <2016-01-26 Thu> I would like to change it to <Thu Jan 26th 2016>

How do I make the corresponding changes in my .emacs?


texts: Add change to a previous commit with Magit

texts:
I have 2 commits, A then B, ready to be pushed. I realize I forgot to add something in A.

How can I add this change to A using Magit? I don't even know which part of the Git documentation I should look at.


texts: How can I prevent recentf to add files do the list which I didn't open but just previewed with helm follow mode?


texts: How to make emacs recognise C + SHIFT combinations in terminal mode?

texts:
Emacs cannot currently pick up C-SHIFT sequences in terminal mode. For example, C-) and C-( are instead just read as 0 and 9 respectively. I'm aware that using GUI mode is one way around this, but I need terminal mode when working over SSH. I use iTerm2 on macOS.

I have been through the keyboard shortcuts both in system preferences and iterm preferences, and have tried disabling shortcuts that contain C-SHIFT in case they are conflicting with emacs, but I've had no luck. Is there any way of fixing this?


texts: Is anyone combining Google Search Autocompletion with Emacs/Helm?

texts:
When you go to Google or to the address bar, and type your search query, you see various completion candidates for your query as suggested ed by google.

I thought it would be great if you could fire Helm with a shortcut key, and then type your query. The candidates are delivered by the autocompletion suggestions from Google.

I planned to develop a Helm source, in order to get this working. To find a way to connect Emacs/Helm with Google API for their search autocompletion, I found this: https://webmasters.googleblog.com/2015/07/update-on-autocomplete-api.html

Since the CSE is a paid service, I wonder if there are any Emacs packages that succesfully connects with Google's API/CSE? Then I could figure out how they did it.


texts: How might I define (or fake) a mode-local ex command with evil?

texts:
It is possible to define ex commands using evil-ex-define-cmd. For example, :quit is defined as:

(evil-ex-define-cmd "q[uit]" 'evil-quit)

I'd like to override this behaviour in particular modes; in particular, when running in git-commit-mode, I'd like for :q or :wq to instead perform a git-commit-commit rather than a regular evil-quit (or evil-save-and-close).

As far as I know, evil does not maintain a mode-local ex command map, and so I need to write a function that calls git-commit-commit if the major mode is git-commit-mode (the easy part); otherwise, delegate to a separate evil function (with arguments forwarded down; the hard part).

The definition would look something like:

(evil-define-command evil-save-and-close-or-commit (<args>)
   (if (eq major-mode "git-commit-mode")
      (git-commit-commit)
    (evil-save-and-close <args>)))

Any thoughts on how I could achieve this -- in particular, the forwarding of arbitrary arguments to an evil command?


texts: Managing source code annotations and version control

texts:
I would like to be able to annotate source code files with my own personal notes, strip these notes out before committing to version control, and merge changes back in from version control without generating merge conflicts when my own changes come back in.

I was inspired by org-mode's approach to literate programming, but I don't think org mode itself would be feasible because of the issues described above.

Is there any way of attaching annotations to source code in Emacs, either as in-place annotations that can be stripped and reinstated in the manner described, or in a separate file with Emacs marking the annotations dynamically?


texts: Indent drawers in plain lists (Org Mode)

texts:
I use drawers in Org Mode plain lists, which I insert by hitting C-c C-x d after a list entry. With this I get

1. [X] This task is completed.
   The task description spans two lines.(here I hit C-c C-x d)
:myDrawer:
(Point is here)
:END:

I find it annoying that the drawer is always inserted so that it is aligned with the list item (1. in my example above).

How to make it automatically indent itself to the item content? I would like to have

1. [X] This task is completed.
   The task description spans two lines.(here I hit C-c C-x d)
   :myDrawer:
   (Point is here)
   :END:

Note: I use org-indent-mode but it is of no help.


texts: Why some extra tramp related packages does not show url schema prefix?

texts:
When I press [C-x C-f] , I got some TRAMP methods shown like ssh: , sshx:. But not get docker: when I installed package docker-tramp.
Does docker-tramp.el provide this? If yes, then how to configure it? If no, then is it possible to add it?
There are many other tramp related packages like kubernetes-tramp and vagrant-tramp and adb: for Android etc.


texts: Equivalent of pausing (CTRL-Z bindkey) in shell-mode

texts: Let's say that I run a process in the foreground, I then wish to pause it, and maybe assign it to the background. In normal C-shell, it is very easily done. I just press C-z, and then I input the command bg &. How can I achieve the same in emacs shell-mode?


texts:
I am learning my way around Emacs. I installed Ivy/Counsel recently. I am trying to use search with Swiper but cannot get the key binding to work. I can get it to work with M-x swiper. I am not sure where I am going wrong. This is my config:
(ivy-mode 1)
(setq ivy-use-virtual-buffers t)
(setq ivy-count-format "(%d/%d) ")
(setq enable-recursive-minibuffers t)
(global-set-key (kbd "C-s") 'swiper)

I have this as well:
(define-key global-map "\C-s" 'swiper)

None of the above works. I can still use with M-x swiper.


texts:
I'm new to Emacs (after 10+ years of Vim) and want to use it primarily for clojure.

Coming from Lighttable, one thing I absolute liked was the way it evaluated just the right sections of code no matter where I am. This is basically: Evaluating a paragraph surrounding the cursor position. Some examples (|| represents the cursor, $FROM ... TO$ represents what I'd like to have evaluated):

(comment

$FROM
(my-func ||[:test :one])
(xy)TO$

$FROM
(defn [y]
  (let [x y]
    (println|| "xy")))
)TO$

)

So basically I want to evaluate the paragraph (Note: Not necessarily a top level form since I surround them in (comment)). I have no knowledge of Elisp. I tried this as an effort.

(defun my-cider-eval-paragraph ()
  (interactive )
  (safe-excursion
     (mark-paragraph)
     (command-execute 'cider-eval-region)))

But I'm clearly making many mistakes. Edit: Actually, my example works if I just change safe-excursion to save-excursion. Funny, I actually think both spellings makes sense.

Thanks for reading.


texts: Yasnippet expand snippet automatically instead of prompting possible completions

texts:
I have two snippets:

e[TAB] expands to $ $1 $ $0 ($1 and $0 are placeholders);
emph expands to \emph{$0} ($0 is a placeholder, this is a default snippet I suppose)

I'm writing a lot of equations between text in Auctex and whenever I type "e[TAB]" I want yasnippet to expand the first snippet directly. Instead, what it does is to prompt a list of possible completions, which in this case is those two snippets. What can I do about that?


texts: I have both .el and the byte compiled version (.elc) of an elisp file. Accidentally I delete the .el file. Can I retrieve the .el file from its .elc version? Is an .elc file without its .el file functional?


texts: Toggling between term-char-mode and term-line-mode

texts:
How do I bind a key sequence to toggle between term-char-mode and term-line-mode (using multi-term)?

There doesn't seem to be a term-char-minor-mode-map and a -line- that could be used for this purpose.


texts: Recursively go up to find Makefile and compile

texts:
The problem with M-x compile is that if the Makefile isn't in the current directory, it fails.

I'd like to have a function that recursively goes up to find a Makefile and run make from this directory.

I've seen this question, but it's path-specific, and it's something I have to think about running.


texts: How to get the value of :ID: property of a org-contacts-entry in an org-capture-template?

texts:
Problem

I want to get the value of a property of a org-contacts-db entry:

\* Example Contact :MYTAG:
:PROPERTIES:
:ID: foobar
:END:

With the function call (org-contacts-filter "Example Contact" nil nil) I get an alist of the contact "Example Contact" from the org-contacts-db, which looks something like

((#("Example Contact" 0 15 (fontified nil org-category "contacts"))
  #<marker at 14837 in contacts.org>
 (("CATEGORY" . "contacts")
  ("ID" . "foobar") …

In order to get the value corresponding to the key "ID" I tried (cdr (assoc "ID" (org-contacts-filter "Example Contact" nil nil))), which only results in nil.

How do I get the value of the :ID: property?

Context

I want to build a capture template for events which can only take place at certain locations. Those locations and their addresses are all managed with org-contacts. The entries for the locations of interest share tagged the same.
During the capture process I want to provide a list of locations, from which I can select the right one via the function my-capture-selection.

(defun my-capture-selection (list variable)
  "Let the user choose between a pre-defined set of strings"
  (make-local-variable variable)
  (let ((selected-value (ido-completing-read "Select from list: " list)))
    (set variable selected-value)
    selected-value))

To create the list I can search my org-contacts-db for all entries with a certain tag.
(org-contacts-filter nil "MYTAG" nil)
The result is something like:

((#("NAME_1" … )) …
 ("ID" . "ORG_ID_1") …
 (#("NAME_2" … )) …
 ("ID" . "ORG_ID_2")

By calling %(my-capture-selection (org-contacts-filter nil "MYTAG" nil) 'my-selection)) in my capture template, I see all contacts tagged "MYTAG", select one of them and save the selection to "my-selection".

In order to provide a link to the org-contact for the location, I want to get the "ID" property, which was created with org-id.
Since I already saved the name of the org-contacts-entry in "my-selection", I should be able to access any property of the entry.
With access to the value of "ID" I could build a link to the entry with (concat "[[" …value of ID… "][" my-selection "]]")


texts: Fix org-publish links when using org-wiki & ox-pandoc

texts:
I'd like to use org-wiki to keep a personal wiki. Org-wiki will also publish to html. In doing so it converts all org links of the form wiki:foo to foo.html. It does this using the function org-wiki--org-link. I would like to use org-wiki html functions but with a different publishing backend -- specifically ox-pandoc. While this publishing function using pandoc works, it does not convert the wiki:file links from org-wiki into file.html links in html. This suggests that org-wiki--org-link isn't working the way I would want it to. I have tried the following to fix this (I'm on org 9.0.6 & emacs 25.2.1).

(org-link-set-parameters
 "wiki"
 :export (lambda (path desc backend)
  (cond
   ((eq backend 'html)
   (format "%s" path (or desc path)))))))

However this doesn't work. In the html output all links are of the form wiki:foo rather than foo.html.

Any ideas about how to fix this are appreciated.


texts: How is a separator added to the main toolbar? I have no trouble adding an icon/item with tool-bar-add-item but can't find a way to add a separator.


texts:
I am installing mu4e. Pulling email and indexing with mu both work. But calling M-x mu4e gives:

error in process filter: Invalid byte opcode: op=183, ptr=6

In addition, if I add these lines to ~/.emacs:

(add-to-list 'mu4e-bookmarks
       (make-mu4e-bookmark
        :name "Inbox"
        :query "maildir:/Exchange/INBOX"
        :key ?i))

I am unable to even load it:

Symbol's function definition is void: record

The same code works with my colleagues. How can I fix it?


texts: kill-region deletes entire buffer content instead of selected text

texts:
In emacs, i have a small text selected as shown in the picture.

When i do eval-buffer, i like the kill-region to remove only the highlighted text. But this code empties the buffer.

;;this is a simple comment....
(message "%s" (region-active-p))
(kill-region (region-beginning) (region-end))

Doesn't region-end retun the selection region's end?


texts: Why does emacs sh-mode ignore indent-tabs-mode?

texts: sh-mode won't care if indent-tabs-mode is on, it will still insert spaces instead of tabs! Can this be fixed?


texts: How do I install An Introduction to Programming in Emacs Lisp?

texts: This may sound odd, but when I type C-h i m Emacs Lisp Intro -- it's not there. I'm on Ubuntu 19.10 with Emacs 26.3. I tried apt-get install emacs-lisp-intro as the EmacsWiki said, but there's no such thing in the Ubuntu world. How can I get it installed?


texts:
I recently notice that there's some strange behaviours of the font-lock of the c++-mode.

Let's start emacs by emacs -Q in the terminal, edit a new file test.cpp and save the following contents

Then put the cursor two lines above the int main line, type int test, you will find that the color of word main changes from blue to black

Backspace the current line to in or i, you will see that the color of main change back to blue.

This is not a very big problem under this test, but I use color theme that the function names are in bold type. So when I add a function above another function, the font-lock of the below one keep changing all the time which is really annoying.

Is this a emacs bug ? I want bold function name and other keywords but how can I get rid of it ? Any help will be appreciated.


texts: In ansi-term, it automatically rebinds C-c to have the same keybindings as C-x. I want to turn this behaviour off, so I can access the keybindings I have behind C-c. (I know about C-c C-j, but that's too many keys for my taste.)


texts: Is there a way to make Org mode ignore src blocks when exporting to html?

texts:
I have an org document with scattered with source blocks that I'd like excluded when I export the file to html.

Is there a variable or option I can set which will ignore the src blocks?

I have tried using the noexport as shown below but the code still appears in the resultant html.

#+BEGIN_SRC json :noexport:
{ ... }
#+END_SRC

Thanks!


texts: Disable auto-fill mode in all the major modes

texts:
When try to disable 'auto-fill-mode`, I search the following answers

how to disable minor mode (enabled using prog-mode-hook) for a particular major mode

This answer narrow it focus on the python-mode

word wrap - How can I disable auto-fill mode in emacs? - Stack Overflow

This answer provide various solutions.

(auto-fill-mode -1)
(remove-hook 'text-mode-hook #'turn-on-auto-fill)

What's the decent solution to disable a minor mode in version 26+


texts: Uppercase instead of lowercase Greek letter shown in Julia mode

texts:
I am writing Julia code in Emacs, which allows the use of unicode characters in the source code. However, some symbols come out looking weird. For example the Greek letter nu:

becomes:

Does anyone know how to fix this to be the correct lowercase nu letter?


texts: org-mode HTML export - difference in behavior with org-html and org-pandoc

texts:
I have an example org-mode file with the following contents:

- only text\\
  only text\\
  only text
- image... (works with org-html but not pandoc-html because of no brackets around "file:" statement)
  #+ATTR_HTML: :width 15%
  file:emacsimage.png\\
  and text
- image... (works with pandoc-html but does not respect HTML attributes)\\
  #+ATTR_HTML: :width 15%
  [[file:emacsimage.png]]\\
  and text
- image... (works with pandoc-html but does not keep image or following text as part of this list item)

#+ATTR_HTML: :width 15%
  [[file:emacsimage.png]]

  and text

If I export using org-html-export-to-html, I get the following HTML file:

If I export using org-pandoc-export-to-html (from the ox-pandoc package), I get the following HTML file:

The main point is that for the #+ATTR_HTML tag to be recognized by pandoc (not an ox-pandoc issue), two conditions have to be met: 1) blank lines must be placed before and after the #+ATTR_HTML and figure specifications, and 2) #+ATTR_HTML must start at column 1 regardless of whether it is in a list item or not. This is true with other tags; e.g. #+BEGIN_QUOTE/#+END_QUOTE. This is not the case with the regular org-mode html export function.

Two questions:

Is it expected for the two to have different behavior? I thought
there was only one org-mode specification (in contrast to markdown) as suggsted here (the "Org-Mode Is Standardized" argument, which I guess is not true?).
Is it possible to get the pandoc to behave like org-html with respect to these lists? Being able to place "and text" after the image in the second list item is more desirable as it belongs grouped with the preceding content. Pandoc's requirement for blank lines to be placed before and after the image insertion syntax prevents the image and anything that follows to be associated with the same list item. This also applies to other elements to be included in lists like #+BEGIN_QUOTE/#+END_QUOTE and so on.


texts:
How can I bring all files with names that conform a specific regex, recursively in a directory tree, to a single dired buffer?

So I can rename/delete them all at once?


texts: Save all helm input history even if I cancelled the helm command at the end

texts: Helm only saves user input history that was not cancelled.  Could I include those cancelled input to history?  I sometimes cancel some useful inputs because I just wanted to have a peek.  I would like to keep those inputs in history so that I can re-search again quickly.